sasinterviewsquestion

Just another WordPress.com site

Reading External Data in SAS System

For SAS Training In Delhi,  http://www.sastrainingdelhi.in mob: 91 9990835485
Question: The external file “text1.txt” contains the data in the format given below:

01APR90 68 02APR90 67 03APR90 70
04APR90 74 05APR90 72 06APR90 73
07APR90 71 08APR90 75 09APR90 76

SAS to read:

filename myfile “C:\Users\xxxnamexxx\Desktop\text1.txt”;
data mydat;
infile myfile ;
input date $ temp @@;
format date yymmdd10.;
run;

SAS LOG:
ERROR 48-59: The format $YYMMDD was not found or could not be loaded
WARNING: The data set WORK.MYDAT may be incomplete. When this step was stopped there were 0
observations and 2 variables.

Explain the error message

Answer: The code should be written as:
filename myfile “C:\Users\xxxnamexxx\Desktop\text1.txt”;
data mydat;
infile myfile ;
input date : date. temp @@;
format date yymmdd10.;
run;

SAS system was unable to read the date in correct format from external file. That is why there was error in SAS log.

2 responses to “Reading External Data in SAS System

  1. sunil kuamr July 7, 2013 at 7:01 pm

    good morning sir,
    i am sunil kumar,
    i hav a doubt
    is there any option or statement or programe, or shortcut key to restore the deleted data?
    plz send replay…

    • sunil kuamr July 7, 2013 at 7:02 pm

      Good morning sir,
      i am sunil kumar,
      i hav a doubt
      is there any option or statement or programe, or shortcut key to restore the deleted data?
      plz send replay…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: