BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Here is the code fragment I used in IBM Mainframe to read Zoned decimal data in the format S9(13)V99

OPTIONS NOCENTRE;
DATA FILE1;
INFILE INPUT1;
INPUT @51 REW_AMT ZD15.2;
PROC PRINT DATA=FILE1;

The REW_AMT in the input file looks
5----+----6----+
****************
00000000001630{
00000000009630{
00000000006630{
00000000005630{
00000000003630{

The SASLIST has correct output but surprisingly for some of the observations, the REW_AMT field is in floating point format (observation 5). We are using SAS 8.2 version.

Obs REW_AMT

1 163
2 963
3 663
4 563
5 363.00

Please help me in fixing the error.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Define a SAS FORMAT statement, either in the DATA step or with PROC PRINT execution. Using the SEARCH facility at the SAS support http://support.sas.com/ website, I found the link below:

Working with Packed Decimal and Zoned Decimal Data
http://v8doc.sas.com/sashtml/lrcon/z1265705.htm

Also, you really should consider upgrading SAS to a more current (and fully supported) version in the near future.

Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 3069 views
  • 0 likes
  • 2 in conversation