View previous topic :: View next topic
|
Author |
Message |
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
Hi friend,
I got a file whose records are like below,
Code: |
0000298249_998|2415|1.00|1.11|20170521
0200416290_001|2415|1.00|0.99|20170521
0000630382_002|2413|1.00|131.69|20170521
|
With the use of DFSORT , I have to edit the file so that records look like
Code: |
0000298249_998|002415|01|0001.11|20170521
0200416290_001|002415|01|0000.99|20170521
0000630382_002|002413|01|0131.69|20170521 |
Tried different ways but not helpful. Need your help on this. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
pramodrsingh wrote: |
Tried different ways but not helpful. Need your help on this. |
Maybe when you share the different ways with us? Anyone can say they tried! |
|
Back to top |
|
|
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
prino wrote: |
pramodrsingh wrote: |
Tried different ways but not helpful. Need your help on this. |
Maybe when you share the different ways with us? Anyone can say they tried! |
First,I was able to make them look like as follows, just by simply using some ISPF commands
so they are as follows->
Code: |
0000298249_998|002415|01|1.11|20170521
0200416290_001|002415|01|0.99|20170521
0000630382_002|002413|01|131.69|20170521 |
Then I tried to use M11 with uff to insert zeros before "1.11|20170521"
Code: |
OPTION COPY
INREC BUILD=(1,25,26,6,UFF,M11,LENGTH=6,32,41) |
but output is as follows-
Code: |
0000298249_998|002415|01|0011120170521
0200416290_001|002415|01|0009920170521
0000630382_002|002413|01|013169|20170521 |
Can we move 20170521 and insert zeros simultaneously? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Nothing to do with either JCL or VSAM. Moved to DFsort.
After 4 years you should know to use the code tags when posting code and data or anything else that appears on the screen. Coded for you (this time). |
|
Back to top |
|
|
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
Thanks for correcting Nic. I will take care going onwards.. |
|
Back to top |
|
|
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
pramodrsingh wrote: |
prino wrote: |
pramodrsingh wrote: |
Tried different ways but not helpful. Need your help on this. |
Maybe when you share the different ways with us? Anyone can say they tried! |
First,I was able to make them look like as follows, just by simply using some ISPF commands
so they are as follows->
Code: |
0000298249_998|002415|01|1.11|20170521
0200416290_001|002415|01|0.99|20170521
0000630382_002|002413|01|131.69|20170521 |
Then I tried to use M11 with uff to insert zeros before "1.11|20170521"
Code: |
OPTION COPY
INREC BUILD=(1,25,26,6,UFF,M11,LENGTH=6,32,41) |
but output is as follows-
Code: |
0000298249_998|002415|01|0011120170521
0200416290_001|002415|01|0009920170521
0000630382_002|002413|01|013169|20170521 |
Can we move 20170521 and insert zeros simultaneously? |
Hi Prino,
Can you please help me here? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I would suggest PARSEing the fields into separate variables and then when you rebuild them apply the formatting as required.
There may be better ways. |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Here is the snippest code..
Code: |
OPTION COPY
INREC PARSE=(%00=(ENDBEFR=C'|',FIXLEN=14),
%01=(ENDBEFR=C'|',FIXLEN=06),
%02=(ENDBEFR=C'|',FIXLEN=02),
%03=(ENDBEFR=C'|',FIXLEN=07),
%04=(FIXLEN=8)),
BUILD=(%00,C'|',
%01,UFF,ZD,LENGTH=6,C'|',
%02,UFF,EDIT=(TT),C'|',
%03,UFF,EDIT=(TTTT.TT),C'|',
%04)
|
I am truncating two bytes here, assuming that position always has 1.00.
Code: |
%02=(ENDBEFR=C'|',FIXLEN=02),
|
You may need need to change this according to your requirement and adjust following code accordingly.
Code: |
%02,UFF,EDIT=(TT),C'|',
|
|
|
Back to top |
|
|
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
magesh23586 wrote: |
Here is the snippest code..
Code: |
OPTION COPY
INREC PARSE=(%00=(ENDBEFR=C'|',FIXLEN=14),
%01=(ENDBEFR=C'|',FIXLEN=06),
%02=(ENDBEFR=C'|',FIXLEN=02),
%03=(ENDBEFR=C'|',FIXLEN=07),
%04=(FIXLEN=8)),
BUILD=(%00,C'|',
%01,UFF,ZD,LENGTH=6,C'|',
%02,UFF,EDIT=(TT),C'|',
%03,UFF,EDIT=(TTTT.TT),C'|',
%04)
|
I am truncating two bytes here, assuming that position always has 1.00.
Code: |
%02=(ENDBEFR=C'|',FIXLEN=02),
|
You may need need to change this according to your requirement and adjust following code accordingly.
Code: |
%02,UFF,EDIT=(TT),C'|',
|
|
Hi Magesh,
That works well for me and serve the purpose. Really Thankful to you, provided great help in short span of time. |
|
Back to top |
|
|
pramodrsingh
New User
Joined: 20 Dec 2013 Posts: 6 Location: India
|
|
|
|
Nic Clouston wrote: |
I would suggest PARSEing the fields into separate variables and then when you rebuild them apply the formatting as required.
There may be better ways. |
Thanks Nic, |
|
Back to top |
|
|
|
|