EBP has several options for class writers (log, lpr etc) but there are times when you'll want to use a custom writer.
The following example shows how to use a simple shell script to receive the output from IEBGENER and write it to its own file. You can call any script or application you wish but it must be able to process piped input in order to receive the output from the job.
This article assumes you have Elastic Batch Platform running and configured in its standard folders.
Adjust the example(s) below to fit your install.
File setup:
- Copy FILE1 to c:\ebp\data or /ebp/data (or your datalib)
- Copy FILE2 to c:\ebp\data or /ebp/data (or your datalib)
- Copy custom.bat or custom.sh to c:\ebp or /ebp/data
- Ensure the custom.sh is executable (chmod 755)
EBP setup:
- Open the EBP config screen:
- Change the A to an S in the "Output:" field:
- Enter "/ebp/custom.sh &JOBID" in the field to the right:
- OR (for Windows) enter "c:\ebp\custom.bat &JOBID" in the field to the right:
- Click Save.
Job Execution:
- Run the following JCL either from the IDE or via the Elastic Batch Platform submit option:
//CUST01 JOB (HCIACCT),'EBP Custom',CLASS=A,MSGCLASS=A,
// MSGLEVEL=(4,4),NOTIFY=USERID
//PS0010 EXEC PGM=IEBGENER,COND=(0,NE)
//SYSUT1 DD DSN=FILE1,DISP=&DISP
// DD DSN=FILE2,DISP=&DISP
//SYSUT2 DD SYSOUT=(S,SMTP)
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
Results:
You'll see a custom.txt file in /ebp or c:\ebp that contains the contents of FILE1 and FILE2 surrounded by the comments produced by the custom script. It will contain the JOBID passed on the command line and as mentioned above, the contents of the files that were piped to it by the Elastic Batch platform.
You can call any custom code you wish, or a standard utility assuming it understands how to process piped input.
More information on Elastic Batch Platform writers can be found here: https://support.heirloom.cc/hc/en-us/articles/212578626-Elastic-Batch-Platform under 'Output Spoolers'
0 Comments