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

I am trying to import the column in the attached file into SAS; I have been using the following code and I am getting an error in the input line. I am using SAS 9.2; could someone provide some insight as to why this doesn't work?

data WORK.NCDebt;

     infile '/SourcePath/Example.csv';

informat Maturity yymmdd8.;

format Maturity yymmdd8.;

input Maturity :yymmdd8.;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Your dates should be read with a mmddyy informat. The while 5 might pass as a year 15 is not a month (the MM part) and 2014 is right out for the day of the month.

and why make an attachment instead of posting:

5/15/2041

5/15/2039

5/15/2038

5/15/2021

5/15/2020

7/2/2015

1/20/2015

11/20/2014

9/16/2014

9/15/2016

View solution in original post

2 REPLIES 2
ballardw
Super User

Your dates should be read with a mmddyy informat. The while 5 might pass as a year 15 is not a month (the MM part) and 2014 is right out for the day of the month.

and why make an attachment instead of posting:

5/15/2041

5/15/2039

5/15/2038

5/15/2021

5/15/2020

7/2/2015

1/20/2015

11/20/2014

9/16/2014

9/15/2016

Hima
Obsidian | Level 7

DATA WORK.Example1;

    LENGTH

        F1                 8 ;

    FORMAT

        F1               YYMMDD8. ;  /** CHANGE THE FORMAT AS YOU NEED TO DISPLAY OUTPUT */

    INFORMAT

        F1               YYMMDD10. ;

    INFILE 'xxxxx/Example.csv'

        LRECL=10

        ENCODING="LATIN1"

        TERMSTR=CRLF

        DLM='7F'x

        MISSOVER

        DSD ;

    INPUT

        F1               : ?? MMDDYY10. ;

RUN;

Capture.JPG

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
  • 2 replies
  • 1219 views
  • 3 likes
  • 3 in conversation