View previous topic :: View next topic
|
Author |
Message |
Rajesh MS
New User
Joined: 12 May 2009 Posts: 5 Location: Chennai
|
|
|
|
I have a VB file with entries as below
INPUT:
Code: |
AAAA352XXX
BBBB352YYY
CCCD352WEF |
Now, i need all records in the above file but with 352 replaced with 441 & 568.
My output should appear as below
Code: |
AAAA352XXX
BBBB352YYY
CCCD352WEF
AAAA441XXX
BBBB441YYY
CCCD441WEF
AAAA568XXX
BBBB568YYY
CCCD568WEF |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Rajesh MS,
What is the LRECL and the format of the field to be replaced? Do you the generated entries at the end or can they be right after the record that is being repeated like shown below?
AAAA352XXX
AAAA441XXX
AAAA568XXX
BBBB352YYY
BBBB441YYY
BBBB568YYY
CCCD352WEF
CCCD441WEF
CCCD568WEF
What happens if a record does not have 352 ? |
|
Back to top |
|
|
Rajesh MS
New User
Joined: 12 May 2009 Posts: 5 Location: Chennai
|
|
|
|
Skolusu,
LRECL is 50 and is a VB file. The output can be repeated as you mentioned.
For sure, there will be record with 352(key value in file) |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Rajesh MS,
Use the following DFSORT JCL. I assumed that your input has only 352 records and every records need to repeated twice.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input VB lrecl 50 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL BUILD=(1,4,5,/,
1,4,5,4,C'441',12,/,
1,4,5,4,C'568',12)
//* |
|
|
Back to top |
|
|
Rajesh MS
New User
Joined: 12 May 2009 Posts: 5 Location: Chennai
|
|
|
|
kolusu,
Thanks a lot!! It worked fine |
|
Back to top |
|
|
Rajesh MS
New User
Joined: 12 May 2009 Posts: 5 Location: Chennai
|
|
|
|
Kolusu,
I am facing INCONSISTENT REFORMATTING FOR SORTOUT if I use the above jcl with recfm FB for LRECL 19. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Rajesh MS wrote: |
Kolusu,
I am facing INCONSISTENT REFORMATTING FOR SORTOUT if I use the above jcl with recfm FB for LRECL 19. |
I showed you a solution specifically for VB files. You can't take same the logic and apply it for a FB file. Vb files has RDW and and varying length records.
If the input file is FB and lrecl of 19 then use the following control cards
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL BUILD=(1,19,/,
1,4,C'441',8,12,/,
1,4,C'568',8,12)
//* |
|
|
Back to top |
|
|
|