BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Alexxxxxxx
Pyrite | Level 9

Hello all,

 

I am using the below code to input the a ".csv" file into SAS.

DATA xxxx;
			infile "E:\yyyy\xxx.csv"
			DLM = ";"
			DSD
			missover
			lrecl=32767
			firstobs = 2;
			input
			9digit_CUSIP :$100.
			6digit_CUSIP :$100.
			6digit_CUSIP :$100.
			Ticker :$100.
			Deal_Date :ddmmyy10.
			Type :$100.
			Company_ID :$100.
			ISIN :$100.
			SEDOL :$100.
			;
			format
			Deal_Date :ddmmyy10.
			;
		run;

However, the result shows the Invalid data for Deal_Date.

NOTE: Invalid data for Deal_Date in line 2 14-23.
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
2         ;;000361;AIR;08/27/1991;DEBT;2001;;2001119 42
Issuer9digit_CUSIP=  Insurer6digit_CUSIP=  Isurer6digit_CUSIP=000361 IssuerTicker=AIR Deal_Date=. Security_Type=DEBT
IssuerCompany_ID=2001 ISIN=  Issuer_SEDOL=2001119 _ERROR_=1 _N_=1
NOTE: Invalid data for Deal_Date in line 3 11-20.
3         ;;00036P;;01/15/1993;SENIOR SECURED NOTES;267102001;; 53
Issuer9digit_CUSIP=  Insurer6digit_CUSIP=  Isurer6digit_CUSIP=00036P IssuerTicker=  Deal_Date=.
Security_Type=SENIOR SECURED NOTES IssuerCompany_ID=267102001 ISIN=  Issuer_SEDOL=  _ERROR_=1 _N_=2
NOTE: Invalid data for Deal_Date in line 4 11-20.
4         ;;00036W;;03/22/1991;FIXED OR STRAIGHT BOND;344507001;; 55
Issuer9digit_CUSIP=  Insurer6digit_CUSIP=  Isurer6digit_CUSIP=00036W IssuerTicker=  Deal_Date=.
Security_Type=FIXED OR STRAIGHT BOND IssuerCompany_ID=344507001 ISIN=  Issuer_SEDOL=  _ERROR_=1 _N_=3
NOTE: Invalid data for Deal_Date in line 5 11-20.
5         ;;00036W;;05/23/1991;FIXED OR STRAIGHT BOND;344507001;; 55
Issuer9digit_CUSIP=  Insurer6digit_CUSIP=  Isurer6digit_CUSIP=00036W IssuerTicker=  Deal_Date=.
Security_Type=FIXED OR STRAIGHT BOND IssuerCompany_ID=344507001 ISIN=  Issuer_SEDOL=  _ERROR_=1 _N_=4

it is strange, because I think I am using the correct informat for the Deal_Date data. Could you please give me some advice about this?

 

Many thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

There are no months above 12 🙂

You need to use the MMDDYY10. informat instead.

You see here a nice example why dates should always be written in YMD order, which is unambiguous.

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

There are no months above 12 🙂

You need to use the MMDDYY10. informat instead.

You see here a nice example why dates should always be written in YMD order, which is unambiguous.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 557 views
  • 1 like
  • 2 in conversation