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

Replace using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Wed Aug 20, 2008 12:47 pm
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: 2481
Location: @my desk

PostPosted: Wed Aug 20, 2008 12:49 pm
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
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 Developer


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

PostPosted: Wed Aug 20, 2008 9:07 pm
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:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top