Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

[Solved]How to append serial No. on records in output through JCL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 07, 2007 9:38 pm    Post subject: How to append serial No. on records in output through JCL ?
Reply with quote

Hi,

I was asked this question:

I have one input say: HLQ.TEMP.FILE, records in file are:
Code:
111   $$$$$
333   CCCCC
444   EEEEE
555   GGGGG
222   AAAAA


Using any utility in a JCL, get the outout as:
Code:
1.   111   $$$$$
2.   333   CCCCC
3.   444   EEEEE
4.   555   GGGGG
5.   222   AAAAA


I hope SORTs' OVERLAY or OUTFIL option can do this but I know to append the same value, I mean, can get the following out put easily using OVERLAY etc.:
Code:
1.   111   $$$$$
1.   333   CCCCC
1.   444   EEEEE
1.   555   GGGGG
1.   222   AAAAA


But how can I keep incrementing the appended value in column 1 of output? Please suggest.
Back to top
View user's profile Send private message

ranjanp

New User


Joined: 02 May 2006
Posts: 25

PostPosted: Thu Jun 07, 2007 11:27 pm    Post subject:
Reply with quote

Use a sort card like

//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(001:SEQNUM,1,ZD,002:C'.',006:001,75)
//*

SEQNUM parameter will take care of the numbering and the incrementing.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jun 08, 2007 1:55 pm    Post subject:
Reply with quote

Hey Thanks, I didn't think about SEQNUM verb. I am stupid enough..!
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us