|
Hi Paula
it's a bit late so I may have this wrong....
I think you should change the code on the input statement
from
@214 AMT PD8.
to
@214 AMT PD8.4
then you could format the value in AMT with comma12.2
The reason for the 4 on the informat PD8. is because PD. informat
has no other way to tell sas how many decimal places are in the
data being input.
That 4 is providing the equivalent of your
AMT=RAMT1/10000;
and perhaps answers your question
"WHY DID I HAVE TO DIVIDE IT?"
good luck
Datum: 14.02.2001 23:16
An: SAS-L@listserv.uga.edu
Antwort an: PAdkins@checkfree.com
Betreff: Packed Decimal 8 Informat PD8.
Nachrichtentext:
Beginner SAS MVS:
Please excuse my ignorance but this is really puzzling me so I thought I'd
take it to the SAS-List.
I have a flat file with a variable AMT that is decimal packed.
Infile statement:
@214 AMT PD8.
Here's the output without a format statement: 15221900
Here's my desired output: 1,522.19 (the real number)
I tried:
FORMAT AMT COMMA8.6;
It returned: 15221900
NOTE: At least one W.D format was too small for the number to be printed.
The decimal may be shifted by the "BEST" format.
I tried:
FORMAT AMT COMMA8.4;
It returned:
NOTE: At least one W.D format was too small for the number to be printed.
The decimal may be shifted by the "BEST" format.
I tried:
FORMAT AMT COMMA4.4;
It returned: NO OUTPUT RC08
ERROR: Format COMMA specified with a decimal width greater than or equal to
the format width, which is not permissible in this case.
I tried:
FORMAT AMT COMMA12.4;
It returned: 15221900.000
NOTE: At least one W.D format was too small for the number to be printed.
The decimal may be shifted by the "BEST" format.
I tried:
@214 RAMT1 PD8.
AMT=RAMT1/10000;
FORMAT AMT COMMA12.2;
IT FINALLY WORKED BUT WHY DID I HAVE TO DIVIDE IT? SHOULD I ASK OUR DB2
FOLKS ABOUT THIS? I'm confused.
Any help would be appreciated!
PS. SUGI26 has been approved!
Paula M. Adkins, Risk Analyst I
Payment Systems Department
CheckFree Corporation
6000 Perimeter Drive
Dublin, OH 43017
614-564-3117, 614-564-4308-fax
www.checkfree.com
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|