Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Replacing a value @ position 55 with another value in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replacing a value @ position 55 with another value in sort
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: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 11:46 am    Post subject:
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    Post subject: Re: Replacing a value @ position 55 with another value in so
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 12:22 pm    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 3:47 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us