BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pchappus
Obsidian | Level 7

I'm having issues with stating my informat on the input statment. If I just use an INFORMAT statement, it works and I get no errors/warnings. Does anybody know what the difference is in the following two statements?\

 

		DATA work.DATA1;
		INFILE "&Lnx_File"
			DELIMITER=','
			MISSOVER
			FIRSTOBS=2
			DSD
			LRECL=32767;

		INPUT
			Policy_Number	$
			Incurred_Date	
			Paid_Date	
			Amount_Paid_per_Claim
		;

		INFORMAT
			Incurred_Date	YYMMDD8.
			Paid_Date	YYMMDD8.
		;

		FORMAT
			Policy_Number	$9.
			Incurred_Date	MMDDYY10.
			Paid_Date	MMDDYY10.
			Amount_Paid_per_Claim	10.2
		;

The below code seems to be not reading in the data correctly and I get a ton of warnings and notes.

 

		DATA work.DATA1;
		INFILE "&Lnx_File"
			DELIMITER=','
			MISSOVER
			FIRSTOBS=2
			DSD
			LRECL=32767;

		INPUT
			Policy_Number	$
			Incurred_Date	YYMMDD8.
			Paid_Date	YYMMDD8.
			Amount_Paid_per_Claim
		;

		FORMAT
			Policy_Number	$9.
			Incurred_Date	MMDDYY10.
			Paid_Date	MMDDYY10.
			Amount_Paid_per_Claim	10.2
		;
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
Read about the colon format modifer for the INPUT statement. If you are going to specify an INFORMAT on your INPUT statement, you need the colon format modifier, such as:
input ID $ Date : mmddyy.;

Cynthia

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:
Read about the colon format modifer for the INPUT statement. If you are going to specify an INFORMAT on your INPUT statement, you need the colon format modifier, such as:
input ID $ Date : mmddyy.;

Cynthia

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

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