View previous topic :: View next topic
|
Author |
Message |
Sasi Kiran Patha Warnings : 2 New User
Joined: 19 Nov 2006 Posts: 73 Location: Hyederabad
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
Back to top |
|
|
Sasi Kiran Patha Warnings : 2 New User
Joined: 19 Nov 2006 Posts: 73 Location: Hyederabad
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|