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
 

 

to remove trailing zeroes after decimal point in VB file

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

New User


Joined: 30 Aug 2011
Posts: 3
Location: India

PostPosted: Tue Aug 30, 2011 9:50 pm    Post subject: to remove trailing zeroes after decimal point in VB file
Reply with quote

Hi,

I am using sort card to produce edited numeric decimal in VB format. I have to eliminate leading zeroes before decimal and trailing zeroes after decimal. I was able to eliminate leading zeroes by edited masks. How can I remove trailing zeroes after decimal ?

e.g.
a|1234|00456.000|cd|456.000
b|455|0001.230|ut|002.400

output
a|1234|456.|cd|456.
b|455|1.23|ut|2.4

Please note I need only to remove trailing zeroes after decimal
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 30, 2011 11:00 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Why does someone believe this is needed?

What business requirement might this support?

As the values are equal, any computer system can work with them as-is with no problem. . . icon_confused.gif
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: Tue Aug 30, 2011 11:42 pm    Post subject:
Reply with quote

Based on your small example, if the trailing zeros are the last bytes in the VB records (that is the RDW length is equal to the position of the last 0), you can use these DFSORT statements:

Code:

   OPTION COPY
   OUTFIL VLTRIM=C'0'


Of course, whether that works or not will depend on exactly what the records in your input file look like for all cases.
Back to top
View user's profile Send private message
avdhoot kubal

New User


Joined: 30 Aug 2011
Posts: 3
Location: India

PostPosted: Wed Aug 31, 2011 8:14 am    Post subject:
Reply with quote

D.Sch. -> Actually we have to FTP this file to other system hence requirement is to minimize the space by squeezing data as much so as to minimize the transfer time.

Frank -> Thanks. Actually in single record there are multiple position from where we have to remove trailing zero after decimal point.
SORT card I am using is below. I need to remove trailing zeroes after decimals for all fields which are edited as SIIIIIIIIIIIIIIIIIIIT.TTT

SORT FIELDS=COPY
OUTFIL FILES=01,
IFTHEN=(WHEN=INIT,
BUILD=(001,04,
005,08,BI,M10,X'4F',
013,08,BI,M10,X'4F',
021,08,BI,M10,X'4F',
029,02,BI,M10,X'4F',
.
.
.
046,01,X'4F',
047,01,X'4F',
048,02,BI,M10,X'4F',
050,02,BI,M10,X'4F',
052,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
064,02,BI,M10,X'4F',
066,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
078,02,BI,M10,X'4F',
080,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
092,02,BI,M10,X'4F',
094,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
106,02,BI,M10,X'4F',
108,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
120,02,BI,M10,X'4F',
122,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,),X'4F',
134,02,BI,M10,X'4F',
136,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
.
.
.
.
.
470,02,BI,M10,X'4F',
472,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
SIGNS=(,-,,))),
IFTHEN=(WHEN=INIT,
OVERLAY=(5:5,1253,SQZ=(SHIFT=LEFT)))
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 31, 2011 8:25 am    Post subject:
Reply with quote

Hello,

I believe the focus is on something that (from the data shown) is not an issue.

If you really want to reduce the ftp file size, compress the data before transmitting and de-compress the data on the target system.
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: Thu Sep 01, 2011 2:04 am    Post subject:
Reply with quote

aVDHOOT,

Now that you've shown what you are really trying to do, I can help you.
You can use these DFSORT control statements. Note that I used C'$' after every EDITed field and X'4F' (C'|') after every unedited field. That let's us change 000$ etc to | and we squeeze out the blanks using FINDREP as well.

Code:

  SORT FIELDS=COPY
  OUTFIL FILES=01,VLTRIM=X'4F',
       IFTHEN=(WHEN=INIT,
         BUILD=(001,04,
                005,08,BI,M10,X'4F',
                013,08,BI,M10,X'4F',
                021,08,BI,M10,X'4F',
                029,02,BI,M10,X'4F',
.
.
.
                046,01,X'4F',
                047,01,X'4F',
                048,02,BI,M10,X'4F',
                050,02,BI,M10,X'4F',
                052,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
                064,02,BI,M10,X'4F',
                066,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),X'4F',
                078,02,BI,M10,X'4F',
                080,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
                092,02,BI,M10,X'4F',
                094,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
                106,02,BI,M10,X'4F',
                108,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
                120,02,BI,M10,X'4F',
                122,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
                134,02,BI,M10,X'4F',
                136,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$',
.
.
.
                470,02,BI,M10,X'4F',
                472,12,PD,EDIT=(SIIIIIIIIIIIIIIIIIIIT.TTT),
                SIGNS=(,-,,),C'$')),
  IFTHEN=(WHEN=INIT,
    FINDREP=(IN=(C'000$',C'00$',C'0$',C'$'),OUT=X'4F')),
  IFTHEN=(WHEN=INIT,
       FINDREP=(INOUT=(C' ',C'')))
/*
Back to top
View user's profile Send private message
avdhoot kubal

New User


Joined: 30 Aug 2011
Posts: 3
Location: India

PostPosted: Thu Sep 01, 2011 1:05 pm    Post subject: Reply to: to remove trailing zeroes after decimal point in V
Reply with quote

Thanks Frank,

Its working great ! Just curious - have u replaced SQZ with FINDREP to remove spaces for any specific purpose ?
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: Thu Sep 01, 2011 11:01 pm    Post subject:
Reply with quote

The way my job is set up, SQZ wouldn't work correctly because it would pad the VB records on the right with blanks. FINDREP will not pad the records on the right with blanks, and it's easier to use because you don't have to give the position and length - it uses the length in the RDW automatically.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us