DATA Step, Macro, Functions and more

Reading PD format data in the input satment

Reply
Contributor
Posts: 69

Reading PD format data in the input satment

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

Contributor
Posts: 74

Re: Reading PD format data in the input satment

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

 

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 202 views
  • 0 likes
  • 2 in conversation