IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Replacing a value @ position 55 with another value in sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Thu Mar 15, 2007 11:41 am
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 11:46 am
Reply with quote

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
View user's profile Send private message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Thu Mar 15, 2007 11:58 am
Reply with quote

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
View user's profile Send private message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Thu Mar 15, 2007 12:09 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 12:22 pm
Reply with quote

Yeap this is for syncsort.
Would you please paste the error message?
Back to top
View user's profile Send private message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Thu Mar 15, 2007 3:43 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 3:47 pm
Reply with quote

Hi There,

Its correct.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top