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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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