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
 
How to Generate JCL using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
naveen katkuri

New User


Joined: 12 Mar 2018
Posts: 2
Location: Australia

PostPosted: Tue Mar 13, 2018 3:50 pm    Post subject: How to Generate JCL using Sort
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: http://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: 8714
Location: Welsh Wales

PostPosted: Tue Mar 13, 2018 5:36 pm    Post subject:
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: 2407
Location: @my desk

PostPosted: Tue Mar 13, 2018 5:52 pm    Post subject: Reply to: How to Generate JCL using Sort
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: 2407
Location: @my desk

PostPosted: Tue Mar 13, 2018 5:57 pm    Post subject:
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

Senior Member


Joined: 14 Mar 2007
Posts: 10515
Location: italy

PostPosted: Tue Mar 13, 2018 6:03 pm    Post subject: Reply to: How to Generate JCL using Sort
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: 8714
Location: Welsh Wales

PostPosted: Tue Mar 13, 2018 8:12 pm    Post subject:
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

Senior Member


Joined: 14 Mar 2007
Posts: 10515
Location: italy

PostPosted: Tue Mar 13, 2018 9:57 pm    Post subject: Reply to: How to Generate JCL using Sort
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: 2
Location: Australia

PostPosted: Fri Mar 16, 2018 7:47 am    Post subject: Reply to: How to Generate JCL using Sort
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    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 Need help on the multiple files refor... wik123 DFSORT/ICETOOL 7 Wed Sep 19, 2018 10:47 am
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am
No new posts Sort card to find duplicates, without... anand1204 DFSORT/ICETOOL 15 Fri Aug 31, 2018 12:13 am
No new posts Generate SQL query dynamically using ... vnktrrd DB2 7 Tue Aug 28, 2018 8:11 pm
No new posts COBOL - JSON GENERATE husni1972 COBOL Programming 1 Fri Aug 17, 2018 3:29 am

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