Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us