Peetrius
Peetrius

Reputation: 203

Informats for dates in SAS

I am importing a dataset with dates that are in the form MM/DD/YYYY. This is my [edit updated] code

DATA AlbumData;
    INFILE '/folders/myfolders/sasuser.v94/NBA60.txt' DLM=','  DSD MISSOVER 
FIRSTOBS=2;
    LENGTH Player $30 Points Date 8
            Team $30 Opponent $30 Results $30;
        INFORMAT Data ANYDTDTE.;
    INPUT Player -- Results;
    FORMAT ReleaseDate MMDDYY10.
RUN;

My issue is no matter what I try the date will be blank in the output. How do I go about fixing this?

A few lines of the code

Player,Points,Date,Team,Opponent,Results
Wilt Chamberlain,100,3/2/1962,Philadelphia Warriors,New York Knicks,win
Kobe Bryant,81,1/22/2006,Los Angeles Lakers,Toronto Raptors,win

This note is under every line in the log

 NOTE: Invalid data for Date in line 16 21-28.

Upvotes: 0

Views: 37

Answers (1)

Tom
Tom

Reputation: 51566

The informat was not getting assigned because of a typo in the name of the variable.

Upvotes: 1

Related Questions