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
Diamond | Level 26

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
Diamond | Level 26

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

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