Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Generate and submit JCL and step dynamically using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Generate and submit JCL and step dynamically using DFSORT
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

Active User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Wed Jul 25, 2018 11:52 pm    Post subject:
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    Post subject:
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: 2448
Location: @my desk

PostPosted: Thu Jul 26, 2018 12:48 am    Post subject:
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    Post subject:
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    Post subject:
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: 2448
Location: @my desk

PostPosted: Thu Jul 26, 2018 2:03 am    Post subject:
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    Post subject:
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: 8747
Location: Welsh Wales

PostPosted: Thu Jul 26, 2018 11:40 am    Post subject:
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: 2448
Location: @my desk

PostPosted: Thu Jul 26, 2018 7:52 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Thu Jul 26, 2018 9:29 pm    Post subject:
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: 2448
Location: @my desk

PostPosted: Mon Jul 30, 2018 7:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Single step to take backup of multipl... Vignesh Sid JCL & VSAM 1 Thu Nov 29, 2018 8:12 pm
No new posts Need advise in calling DFSORT from REXX ajithajt CLIST & REXX 9 Thu Nov 29, 2018 10:50 am
No new posts How to handle different file length b... javen777 DFSORT/ICETOOL 15 Mon Nov 26, 2018 12:13 pm
No new posts How to count the number of times key ... vnktrrd DFSORT/ICETOOL 14 Thu Nov 15, 2018 9:19 pm
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us