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
 
How to match ZD15.3 to ZD15.2 in SAS?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Thu Apr 26, 2012 7:54 am    Post subject: How to match ZD15.3 to ZD15.2 in SAS?
Reply with quote

Dears,

These dasy I am confused on SAS decimal postion match problem. For example, I read a file in,

Code:
DATA MDQLCBIT;                                   
     INFILE MDQLCBIT;                           
     INPUT  @011  PROD_TYPE     $CHAR04.         
            @040  CCY_CODE      $CHAR03.         
            @072  AMOUNT        ZD15.3           
            @155  ACTION_TYPE   $CHAR06.         
            ;                       


and wanna to change this AMOUNT to ZD15.2 thru below ways:

FORMAT AMOUNT ZD15.2 or FORMAT 15.2

all are failed. like 678.569 will be rounded to 678.57 which is error. I wanna it to be 678.56. just cut 2 decimal bytes.
Back to top
View user's profile Send private message

lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Thu Apr 26, 2012 8:54 am    Post subject:
Reply with quote

anybody knows that?pls!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Thu Apr 26, 2012 10:03 am    Post subject: Reply to: How to match ZD15.3 to ZD15.2 in SAS?
Reply with quote

do not solicit for answers!

replying is ...
on voluntary base
on our own time
free of charge

from Your profile...
Quote:
referer: my+manager
icon_evil.gif

if You and Your manager have time issues
a forum is not the best place to seek for help
wiser to hire a paid consultant who, for the proper fee, will be glad to
satisfy Your time constraints

( a manager with a normal IQ would have had You trained, not referred to a forum )
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Thu Apr 26, 2012 11:20 am    Post subject:
Reply with quote

Will this statement suffice?
Code:
AMOUNT = INT(AMOUNT*100)/100;

Code:
input    output
               
11.2345  11.23
12.5678  12.56
15.9699  15.96
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Thu Apr 26, 2012 11:36 am    Post subject:
Reply with quote

or
Code:
AMOUNT=FLOOR(AMOUNT*100)/100;
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 26, 2012 2:31 pm    Post subject:
Reply with quote

Or the ROUND function, perhaps? If not ROUND, then CEIL or FLOOR will surely do what you want.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Match records - scdinesh DFSORT/ICETOOL 6 Wed Feb 22, 2017 5:02 am
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm

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