Pavani Donepudi Beginner
Joined: 07 Apr 2004 Posts: 13 Topics: 7
|
Posted: Mon Nov 07, 2005 4:35 pm Post subject: Replace string in the first line using SYNCSORT |
|
|
Hi,
Here is my requirement. I wanted the solution either in SYNCSORT or FILEAID.
1. My input file is of length 80 bytes of Fixed type. And there will only three records.
2. I need to replace from position 15-21 of only first line irrespective of what the field contains. Rest of the file contents should remain as is.
Can anyone of you help me out in solving this.
Thanks,
Pavani. |
|
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Nov 07, 2005 5:16 pm Post subject: |
|
|
Pavani Donepudi,
Here is an untested code . You can change "pawanid" to the string of your choice.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT DSN,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT DSN,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CY,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,80,SEQNUM,3,ZD)
OUTREC FIELDS=(01,14,
15:81,3,CHANGE=(7,C'001',C'pawanid'),
NOMATCH=(15,7),
22,59)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|