Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
editting the file by inserting zeros in between

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 5:58 pm    Post subject: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1048
Location: Oostende, Belgium

PostPosted: Mon Aug 21, 2017 6:36 pm    Post subject: Re: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 6:53 pm    Post subject: Re: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1868
Location: UK

PostPosted: Mon Aug 21, 2017 7:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 7:16 pm    Post subject:
Reply with quote

Thanks for correcting Nic. I will take care going onwards..
Back to top
View user's profile Send private message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 8:26 pm    Post subject: Re: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1868
Location: UK

PostPosted: Mon Aug 21, 2017 8:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 202
Location: Chennai

PostPosted: Mon Aug 21, 2017 8:45 pm    Post subject: Reply to: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 9:26 pm    Post subject: Re: Reply to: editting the file by inserting zeros in between
Reply with quote

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
View user's profile Send private message
pramodrsingh

New User


Joined: 20 Dec 2013
Posts: 6
Location: India

PostPosted: Mon Aug 21, 2017 9:28 pm    Post subject:
Reply with quote

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
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us