I have a file coming from diffrent system and landing in my mainframe let's say file name is Dvj.ql1.ql2.trigger1. it contains a single record which is
0001 Ax0.data.jcl(mem1)
where mem1 has a JCL job and my requirement is i want to execute this JCL written in mem1 its an automation task. In simple word i want to execute the jcl written in mem1 soon the file arrives in my mainframe system. What are the ways i can achieve it. Any hint or suggestion would be helpful.
Joined: 08 Aug 2023 Posts: 2 Location: United States
I am a new member but have been a programmer for 50 yrs and have found ways to get around a majority of the software/utility will not let you do. You may have already solved your problem but, I will go ahead and throw this out there.
Because your file name is within the file being transmitted, about the only way you could turn your file name to a symbolic would be to use a pgm/utility and it would have to be instream. You can have it in a separate member so, that you don’t have 20 jobs all with that pgm in the jcl. You can create it as a proc include. Now as far as what kind of pgm, you could use something simple like rexx, ezy+, file manager, waapdsut or anything that can read a file. I know the four that I mentioned allow you to use symbolics. You would set up your transmitted file to have a field that starts in col. 19, length 8, name IJOB. Then read the record, move IJOB to &OJOB. Because the software usually has different names for pulling in the software commands, I am just going to use SYSIN, as the example, same for the actual jcl of the software being executed.
The first part is the jcl for the software:
// SET PJOB=’ ’ --- This creates the symbolic and will clear it out every time
//EXTSTEP EXEC EZY,
//TRANSIN DD DISP=SHR,DSN=Dvj.ql1.ql2.trigger1
// INCLUDE MEMBER=EZYPGM01
The second part is the proc include which is the EZY+ pgm inline:
//SYSIN DD *,SYMBOLS=JCLONLY
TRANSIN
IJOB 19 8 A
JOB INPUT(TRANSIN)
&PJOB = IJOB
The third part is your gener to submit the job:
//STEP050 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=SYSPDA.JCLLIB(&PJOB)
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
I currently do the same thing for any of that type of software/utility. This allows me to have just one copy of the pgm that can be executed by any number of jobs. Only have to maintain one pgm/member. Now, when you go try and figure out a problem and you see in the pgm it has &PJOB and it is not defined in the pgm. You go ok where did &PJOB come from, as I usually have a job execute a proc and the pgms bring in the proc include so, you don’t see everything if you are just looking at the pgm. It hits you when you see the set statement. I like to automate as much as possible and reduce having multiple versions of proc’s just because of different LOB’s. I hope it will help you out or anybody that wants to do the same kind of thing.