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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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