View previous topic :: View next topic
|
Author |
Message |
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
I want to insert the sequence number at the end of the record depending on icn
ICN sequwnce number
00000001 1
00000001 2
00000001 3
00000001 4
00000002 1
00000002 2
Can any body suggest any solution? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
insert what sequence number ? where is the end of the record ?what is the LRECL ? RECFM ?.
Give example on what the output will look like.
You need to explain what is needed a lot clearer than you have done so far.
Gerry |
|
Back to top |
|
|
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
consider the input file is fixed byte and lrec=80
i want to insert sequence number at 81 position
INPUT file has ICN and other fields i want sequence number depending on ICN
1-
80
ICN other fields
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000002 ............................................................
00000002 ............................................................
output file
INPUT file
1- 81
00000001 ............................................................1
00000001 ............................................................2
00000001 ............................................................ 3
00000001 ............................................................4
00000002 ............................................................1
00000002 ............................................................ 2 |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//STEP0001 EXEC PGM=SORT
//SORTIN DD *
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000002 ............................................................
00000002 ............................................................
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,8,BI,A)
OUTREC OVERLAY=(81:SEQNUM,3,ZD,RESTART=(1,8))
|
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Nazia,
If the records are already in order as shown in your example, you can use a copy application which is more efficient than a sort application. Just replace the SORT statement with:
|
|
Back to top |
|
|
|