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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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