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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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