IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

calling a JCl inside a JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Wed Dec 28, 2022 4:04 pm
Reply with quote

Hi All,

I have requirement which is like.

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.

Thanks
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Wed Dec 28, 2022 4:08 pm
Reply with quote

will this work as i researched about it.


//STEP050 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=SYSPDA.JCLLIB(JCL2),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Wed Dec 28, 2022 4:11 pm
Reply with quote

The FTP could submit the Job itself remotely on Mainframe. There is a version 1 and version 2 variant of this (AFAICR). No need for extra steps.
Back to top
View user's profile Send private message
Leonard Peters

New User


Joined: 08 Aug 2023
Posts: 2
Location: United States

PostPosted: Tue Aug 08, 2023 5:07 am
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts SRCHFOR ‘string’ command inside P... TSO/ISPF 14
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top