BookmarkSubscribeRSS Feed
Siddhartha
Calcite | Level 5

Hi,

I am having the below program where COMP-3 fields are using PD formats.
I was trying to read the file having PD formats, using z8. for PD4. and z13.2 for PD6.2.
But getting invalid values when I use Zw.d formats for the PD's.

Could anyone suggest which format I need to use.

 

DATA
TEMP_01
;

INFILE
MRCUST
;

INPUT
@1 CUSTNUM $CHAR9.
@10 RNUM $CHAR9.
@19 RNUMCI $CHAR1.
@20 RCC $CHAR14.
@22 RCCSC $CHAR2.
@22 RCCPT $CHAR5.
@34 U_CR PD4.
@38 U_MTD PD4.
@42 U_QTD PD4.
@46 U_YTD PD4.
@50 U_L12 PD4.
@54 U_LY PD4.
@58 R_CR PD6.2
@64 R_MTD PD6.2
@70 R_QTD PD6.2
@76 R_YTD PD6.2
@82 R_L12 PD6.2
@88 R_LY PD6.2
;

Thanks & Regards,
Sid

1 REPLY 1
evp000
Quartz | Level 8

Hi,

 

Are you saying that you were able to read the value with PDx but wanted to display it afterwards with Zw.d?  You can't read the data with z8, since that's a format, not an informat, and you have to use informats to read data. Can you show an example of the data?  Seems unusual that your source values would be in IBM packed decimal format. 

Here's a list of informats:

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001239776.htm

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1171 views
  • 0 likes
  • 2 in conversation