View previous topic :: View next topic
|
Author |
Message |
morpheus007
New User
Joined: 27 Dec 2005 Posts: 58
|
|
|
|
We have a requirement wherein we have to copy all records from one flat file to another.The records which have a X'FD' at position 55 have to be replaced with a space and copied to output and those records which do not have a X'FD' are copied as they are.I have done it using a program.However I wanted to do it using SORT and compare the outputs to check if they match.The reason being that the files are too big to manually check if they are correct.Kindly let me know if there is any technique using SORT to do this. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
Please find the attacehd sort card
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL OUTREC=(1:1,54,
55:55,1,CHANGE=(1,X'FD',X'40'),NOMATCH=(55,1),
56:56,25)
/* |
Here i assumed that record length is 80.
Hope it will helpful |
|
Back to top |
|
|
morpheus007
New User
Joined: 27 Dec 2005 Posts: 58
|
|
|
|
Thanks for the response.I will try it out and update about the results.
In our case the input record length is 84,FB.In that case does the last part become:
56:56,29).Kindly let me know. |
|
Back to top |
|
|
morpheus007
New User
Joined: 27 Dec 2005 Posts: 58
|
|
|
|
Just tried it out and its giving RC=16.Does this sort card work for SYNCSORT as well or is it specific only to DFSORT.We are using SYNCSORT here. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Yeap this is for syncsort.
Would you please paste the error message? |
|
Back to top |
|
|
morpheus007
New User
Joined: 27 Dec 2005 Posts: 58
|
|
|
|
I just retried it with EXEC PGM=SYNCSORT instead of PGM=SORT and it did give RC=0.I think its working.Thanks a million for your help on this.I will match with the result from cobol pgm and confirm.In your solution you had assumed LRECL=80.The actual rec length is 84.I have used the following control statements for it.
OPTION COPY
OUTFIL OUTREC=(1:1,54,
55:55,1,CHANGE=(1,X'FD',X'40'),NOMATCH=(55,1),
56:56,29)
Kindly let me know if the last part from position 56 onwards is correct or I need to change it. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Its correct. |
|
Back to top |
|
|
|