Page 1 of 1

SORT - Multiple Records

PostPosted: Thu Jan 06, 2011 6:28 pm
by Vineet
I have a Sequential File having Length = 80, RECFM=FB. File has only One Record. My Requirement is using SORT I want to have Same Record (Input File Record) To be written 100 Times in the Output File & with Each Record there should be an Associated Sequence Number. Below is Format of I/P File & O/P File.

Input File:
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y

Output File:
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y 0001
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y 0002
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y 0003
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y 0004
.....
.....
.....
.....
00000000166100012003-03-31-14.08.04.740000A2010-10-11Y 0100

Here In O/P File 0001,0002,0003,0004 ............. 0100 is SEQUENCE NUMBER.

Note: O/P File has Same Attribute as I/P File I.e. LRECL = 80, RECFM = FB.

Vineet Anand

Re: SORT - Multiple Records

PostPosted: Thu Jan 06, 2011 8:03 pm
by NicC
And if DFSORT cannot do it (it most likely can - all you need to do is look up the manual) what then with your requirement? That is...WHY does it HAVE to be SORT?

Re: SORT - Multiple Records

PostPosted: Thu Jan 06, 2011 8:10 pm
by Vineet
Hi NicC,

Same Activity I can do by writing a Program. I am specifically looking for SORT to do the required activity. can U provide me URL or the manual or any sample JCL.

Thanks.

Re: SORT - Multiple Records

PostPosted: Thu Jan 06, 2011 11:30 pm
by Frank Yaeger
Here's a DFSORT job that will do what you asked for:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION COPY
  OUTFIL REPEAT=100,OVERLAY=(56:SEQNUM,4,ZD)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Please don't both post a question on a help board and send me the same question via e-mail. Do one or the other, but not both.