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

How to Generate JCL using Sort


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

New User


Joined: 12 Mar 2018
Posts: 3
Location: Australia

PostPosted: Tue Mar 13, 2018 3:50 pm
Reply with quote

My Input file contains change# no from 3rd pos and length is 8 bytes.

Code:
 *************
  C0304169   
  C0316689   
  C0321192   
  C0324289   

My expected output should be like

Code:
//PRODJCL JOB (PPPP000,546,RMA),RMA,CLASS=U,MSGCLASS=X,     
//     NOTIFY=&SYSUID,REGION=256M                           
//*                                                         
//PGNAME  EXEC PGM=TESTPGM,PARM='ACTION,PROD',DYNAMNBR=500,
//         TIME=1440                                         
//PTSPRINT DD   SYSOUT=*                                     
//PTSIN    DD   *                                           
APPROVE                                                     
;                                                           
APPROVE_OR_DISAPPROVE='APP',                                 
CHANGE_GROUP_ID='C0304169',                                 
APPROVE_STREAM='M',                                         
APPROVE_LEVEL='O',                                           
SIGNATURE_LEVEL='TLDR',                                     
.                                                           
/*                                                           
//PGNAME  EXEC PGM=TESTPGM,PARM='ACTION,PROD',DYNAMNBR=500,
//         TIME=1440                                                   
//PTSPRINT DD   SYSOUT=*                                               
//PTSIN    DD   *                                                       
APPROVE                                                                 
;                                                                       
APPROVE_OR_DISAPPROVE='APP',                                           
CHANGE_GROUP_ID='C0316689',                                             
APPROVE_STREAM='M',                                                     
APPROVE_LEVEL='O',                                                     
SIGNATURE_LEVEL='TLDR',                                                 
.                                                                       
/*                                                                     
//PGNAME  EXEC PGM=TESTPGM,PARM='ACTION,PROD',DYNAMNBR=500,
//         TIME=1440                                                   
//PTSPRINT DD   SYSOUT=*                                               
//PTSIN    DD   *                                                       
APPROVE                                                                 
;                                                                       
APPROVE_OR_DISAPPROVE='APP',                                           
CHANGE_GROUP_ID='C0321192',                                             
APPROVE_STREAM='M',                                                     
APPROVE_LEVEL='O',                                                     
SIGNATURE_LEVEL='TLDR',                                                 
.                                                                       
/*                                                                     
//PGNAME  EXEC PGM=TESTPGM,PARM='ACTION,PROD',DYNAMNBR=500,
//         TIME=1440                                                   
//PTSPRINT DD   SYSOUT=*                                               
//PTSIN    DD   *                                                       
APPROVE                                                                 
;                                                                       
APPROVE_OR_DISAPPROVE='APP',                                           
CHANGE_GROUP_ID='C0324289',           
APPROVE_STREAM='M',                                                     
APPROVE_LEVEL='O',                                                     
SIGNATURE_LEVEL='TLDR',                                                 
.                                                                       
/*


To be precise, I am generating a JCL and JCL steps using SORT utility for each of the change #no from the input file. I know that we can achieve the above requirement using BUILD and SEQUENCE by incrementing SEQUENCE NO by 14 times for each of the line. but it will take 14 steps all together. So could you please let me know, if we can do this requirement in less no of steps.

P.S This post is different from the other post which says "Need better approach to create a sort card Read more: ibmmainframes.com/viewtopic.php?t=66479#ixzz59cg60wDa "

EDIT:Code'd, please use Code tags while posting code/sample data to preserve alignment.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Mar 13, 2018 5:36 pm
Reply with quote

ISPF file tailoring would be the way to go, do it all in one easy step
and as a bonus you would be using the correct tool for the job

What happens if there are 33 lines in the input file, will that take 33 steps, how do you control the flexibility for a change in the number of records.
Unless you mean the number of lines of code for each step, incidentally only 13 lines.

ISPF will do all of that easily.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 13, 2018 5:52 pm
Reply with quote

naveen katkuri,

Welcome to the forums. Maybe I am missing something, but could you try something like this?
Code:
OUTFIL BUILD=(C'//PGNAME EXEC PGM=TESTPGM,.....DYNAMNBR=500,',80:X,/,
              ....
              ....
              C'CHANGE_GROUP_ID='''',3,8,C'''',/,
              ....
and you might want to include a HEADER1 for your job card.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 13, 2018 5:57 pm
Reply with quote

expat wrote:
ISPF file tailoring would be the way to go, do it all in one easy step
and as a bonus you would be using the correct tool for the job
oops, sorry missed your reply. icon_redface.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Mar 13, 2018 6:03 pm
Reply with quote

having batch ISPF jobs in production is usually frown upon

but, why 33 steps ?

Arun logic fits well
the only thing to add is
to push a sequence number on the records

for sequence number 1
build the job card and the step;
for the other ones just the step
using as a guide the sample posted

one might also think about building a distinct step number using the sequence number
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Mar 13, 2018 8:12 pm
Reply with quote

expat wrote:

What happens if there are 33 lines in the input file, will that take 33 steps, how do you control the flexibility for a change in the number of records.
Unless you mean the number of lines of code for each step, incidentally only 13 lines.


enrico-sorichetti wrote:

having batch ISPF jobs in production is usually frown upon
but, why 33 steps ?


Not everywhere frowns upon using ISPF, or other products, to generate batch jobs. I know, I've worked at quite a few

I was asking clarification of things from the OP
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Mar 13, 2018 9:57 pm
Reply with quote

Quote:
I know, I've worked at quite a few


I know
but I was just proactive in trying to avoid a new topic asking for the code icon_wink.gif
Back to top
View user's profile Send private message
naveen katkuri

New User


Joined: 12 Mar 2018
Posts: 3
Location: Australia

PostPosted: Fri Mar 16, 2018 7:47 am
Reply with quote

Thank you all for your valuable guidance. I am getting by desired result.
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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top