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

Generate and submit JCL and step dynamically using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 34
Location: New York

PostPosted: Wed Jul 25, 2018 11:31 pm
Reply with quote

Hi All,

I have a requirement where I don't want to repeat the steps coded under HEADER3. Instead the job with one step has to be repeated for every value of the input and submitted through internal reader.

Please advise how to do it. When I move the "Sections=(81,3," above HEADER1, its giving me error.


Code:

//GTMCREO1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=FILE1,
//            DISP=SHR
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY,STOPAFT=255
  OUTREC OVERLAY=(81:SEQNUM,3,ZD)
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),
  HEADER1('//JOB1 JOB ',X'7D','SPLIT JOBS',X'7D',
            ',CLASS=A,',/,
            '//',13X,'MSGCLASS=Y,MSGLEVEL=(1,1),',/,
            '//',13X,'NOTIFY=&SYSUID',/,
            '//*',/,
            '/*JOBPARM S=P000',/,
            '//PROCLIB JCLLIB ORDER=PROCLIB'),
    SECTIONS=(81,3,
    HEADER3=('//STEP0',81,3,X,'EXEC PROC1,',/,
             '//   FRMTS=2018-07-25-00.00.00.000000,',/,
             '//    TOTS=2018-07-25-00.00.00.000000,',/,
             '//   VALUE=P001,VERS=VERS1,INPFIELD=',1,4),
      TRAILER3=('//*'))
//*



To explain clearly this is the code I have to create a job and add one step for each value of the INPFIELD from input file FILE1.
I want this code to be modified to generate a 'job and one step' for each value of the INPFIELD and submit it to internal reader. I dont multiple steps in the same job for each field. I want one job for each INPFIELD.


Thanks in advance.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1008

PostPosted: Wed Jul 25, 2018 11:52 pm
Reply with quote

It’s impossible just to “move SECTION=(81,3 above HEADER1”.

Please, speak slowly, and clearly.
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 34
Location: New York

PostPosted: Thu Jul 26, 2018 12:01 am
Reply with quote

Hi,

I would also want to make the "FRMTS=2018-07-25-00.00.00.00000" , "TOTS=2018-07-25-00.00.00.000000" and "VALUE=P001,VERS=VERS1" parameters dynamic by passing symbolic parameters. When I pass symbolic parameters, DFSORT is not evaluating them.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 26, 2018 12:48 am
Reply with quote

You can probably pass the parameters using the JPn parameter.

Just curious, why would you want separate jobs instead of one job with several steps in it?
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 34
Location: New York

PostPosted: Thu Jul 26, 2018 12:52 am
Reply with quote

Hi Arun,

In each step of the job I'd be calling another proc which has around 20 steps. So if I create 40 steps for each value of the input file, it would cross the 255 limit for a job.

Then I thought of having a single job with one step created at once and submit it immediately.

Please advise if there is a way around to to do this.

Thanks.
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 34
Location: New York

PostPosted: Thu Jul 26, 2018 1:47 am
Reply with quote

I am able to create this for the first value of the input file. Would you please advise how to repeat this for each value of the input file ?

Code:

  OPTION COPY
  OUTREC OVERLAY=(81:SEQNUM,3,ZD)
  OUTFIL REMOVECC,NODETAIL,
  HEADER1('//JOB1 JOB ',X'7D','SPLIT JOBS',X'7D',
            ',CLASS=A,',/,
            '//',13X,'MSGCLASS=Y,MSGLEVEL=(1,1),',/,
            '//',13X,'NOTIFY=&SYSUID',/,
            '//*',/,
            '/*JOBPARM S=P000',/,
            '//PROCLIB JCLLIB ORDER=PROCLIB',/,
            '//STEP0',81,3,X,'EXEC PROC1,',/,
            '//   FRMTS=2018-07-10-15.00.00.000000,',/,
            '//    TOTS=2018-07-19-17.00.00.000000,',/,
            '//   VALUE=P01,VERS=VERS1,INPFILE=',1,4,/,
            '//*')
//*


Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 26, 2018 2:03 am
Reply with quote

You could do this using a bit of rexx code, if you would like to do that way. Using the sort utility, it might be a bit more complex. You may have to build a file with all the jobs-one after the other, then read this file, route each job into different OUTFIL dd data sets dynamically.
Back to top
View user's profile Send private message
vnktrrd

New User


Joined: 12 Jan 2010
Posts: 34
Location: New York

PostPosted: Thu Jul 26, 2018 2:08 am
Reply with quote

Hi Arun,

Can't we write the built JCL statements to INTRDR directly without writing to a file ? That way its submitted upon writing to INTRDR which is what we want.

I am able to submit the JCL statements to INTRDR built for first value of the file. I just have to repeat the BUILD for each value of the input file. Please advise on this.

Thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 26, 2018 11:40 am
Reply with quote

Why not use ISPF file tailoring for the purpose it was designed for, tailoring pre defined JCL skeletons for certain situations. Gives you far better control when things change.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 26, 2018 7:52 pm
Reply with quote

vnktrrd wrote:
Hi Arun,

Can't we write the built JCL statements to INTRDR directly without writing to a file ?
Yes that is what I meant by writing multiple OUTFIL DDs and each routed to INTRDR.

Also look at expat's suggestion above.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1008

PostPosted: Thu Jul 26, 2018 9:29 pm
Reply with quote

expat wrote:
Why not use ISPF file tailoring for the purpose it was designed for, tailoring pre defined JCL skeletons for certain situations. Gives you far better control when things change.

So far, the task seems to be too trivial for FT with the whole ISPF environment to get involved.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jul 30, 2018 7:50 pm
Reply with quote

vnktrrd,

I did not realize you can have multiple job cards in the same data set and once that is routed to internal reader, those would get submitted as individual jobs, until a friend of mine discussed about this with me. You can remove the HEADER1 and move the job card to the HEADER3 and build a single output with multiple job cards. You might as well talk to your scheduling guys if they can set something up instead of you building this submission process.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts SOC7 error with DFSORT DFSORT/ICETOOL 9
No new posts How to replace a string dynamically i... CLIST & REXX 16
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts Dynamically switching terminal model TSO/ISPF 9
No new posts Join lines with dfsort DFSORT/ICETOOL 5
Search our Forums:

Back to Top