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.
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.