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
 

 

Replace using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Aug 20, 2008 12:39 pm    Post subject: Replace using sort
Reply with quote

Hi,

i have a 4 byte character field in a flat file
that contains data '0040'.
I need to use sort and make it '40 '.

One solution i have is use inrec pass to place 40
in the first and second bytes and then outrec pass
to move spaces into 3rd and 4th bytes.

Please suggest easier method.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Aug 20, 2008 12:47 pm    Post subject: Reply to: Replace using sort
Reply with quote

Sasi,

Quote:
Please suggest easier method.


You will have to answer few questions.

- How does your input file look like? How many records? only one record or wat?

Explain your requirement clearly.

Quote:
One solution i have is use inrec pass to place 40
in the first and second bytes and then outrec pass
to move spaces into 3rd and 4th bytes.


You can do it in many ways using BUILD etc.

Explain your requirement clearly and we are here to suggest you a better solution.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Wed Aug 20, 2008 12:49 pm    Post subject:
Reply with quote

Sasi Kiran Patha,

You can use ALTSEQ to achieve this. Search the forum and you will find lot of examples. Here's one

http://ibmmainframes.com/viewtopic.php?t=32662&highlight=altseq

Thanks,
Arun
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Aug 20, 2008 1:02 pm    Post subject: Reply to: Replace using sort
Reply with quote

hi aaru,

The flat file is DB2 download file. Number of records currently is more than 1.
Input file is VB.

im thought if there can be any simpler and efficient code that will be appreciated.

PLease let me know for any further details.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 20, 2008 9:07 pm    Post subject:
Reply with quote

Sasi,

If I understand correctly you want to replace '0040' (X'F0F0F4F0') with '40 ' (X'F4F04040').

You cannot do this with ALTSEQ as Arun claims. TRAN=ALTSEQ can only deal with changing one character to another character - it cannot change a string of more than one character to another string.

But you can do this quite easily with DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC FINDREP=(IN=C'0040',OUT=C'40  ')
/*


Be sure to code the two blanks at the end of C'40 '.

If you don't have PTF UK90013 installed, ask your System Programmer to install it (it's free).

For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 -> DFSORT/ICETOOL 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