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
 
[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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm

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