View previous topic :: View next topic
|
Author |
Message |
Rajesh1979
New User
Joined: 24 Dec 2007 Posts: 9 Location: Chennai
|
|
|
|
Hi,
I want the header record to be skipped while adding the sequence no at the end of the file.
The header file should be copied as it is from input file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What are the attributes of the input file
DSORG, RECFM, LRECL |
|
Back to top |
|
|
Rajesh1979
New User
Joined: 24 Dec 2007 Posts: 9 Location: Chennai
|
|
|
|
RECFM=FB,LRECL=381,DSORG=PS |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Rajesh1979 wrote: |
Hi,
I want the header record to be skipped while adding the sequence no at the end of the file.
The header file should be copied as it is from input file. |
Rajesh, What you are trying to ask is not at all clear.
Can you please show us sample example for what you want. |
|
Back to top |
|
|
Rajesh1979
New User
Joined: 24 Dec 2007 Posts: 9 Location: Chennai
|
|
|
|
Sambhaji,
Here is some sample layout of input.
HEADER123
WWW3234232
XXX43432432
YYY13123213
ZZZ33123232
Incorrect Output file:
HEADER123 01
WWW323423202
XXX4343243203
YYY1312321304
ZZZ3312323205
Desired Output file:
HEADER123
WWW323423201
XXX4343243202
YYY1312321303
ZZZ3312323204
with sequence no 01,03,03,04,05 added at the end of record.
But I dont want any sequence number for header record HEADER123.
The header record should be written in the output file with out any sequence number. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Assumed INPUT LRECL=15 and
Code: |
//S1 EXEC PGM=SORT
//SORTIN DD *
HEADER123
WWW3234232
XXX43432432
YYY13123213
ZZZ33123232
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,6,CH,NE,C'HEADER'),OVERLAY=(16:SEQNUM,4,ZD))
OUTFIL BUILD=(1,19)
/*
|
Output will be:
Code: |
HEADER123
WWW3234232 0001
XXX43432432 0002
YYY13123213 0003
ZZZ33123232 0004
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I believe this DFSORT solution more closely fits the description of what's wanted, but adjust as needed.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/381)
//SORTOUT DD DSN=... output file (FB/383)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,6,CH,NE,C'HEADER'),
OVERLAY=(382:SEQNUM,2,ZD))
/*
|
|
|
Back to top |
|
|
Rajesh1979
New User
Joined: 24 Dec 2007 Posts: 9 Location: Chennai
|
|
|
|
Thanks Sambhaji and Frank. |
|
Back to top |
|
|
|