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
 
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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