Help using Base SAS procedures

Dates from excel

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

Dates from excel

Please see below:

data XYZ;

  infile file1 dlm='09'x notab dsd missover;

  informat Date1 DATE.;

input Name $ Num1 Name2 $ Num2 Date1 Var1 Var2 Var3;

Date1=IDate;

format Date1 IDate date10.;

keep Name Num1 Name2 Num2 Date1 IDate;

run;

When I do this, I get "." for both Date1 and IDate and the error that IDate is uninitialized.. When I remove the Date1=IDate statement the Date format works out fine. I have a feeling it has something to do with the input statement. Any ideas?


Accepted Solutions
Solution
‎01-27-2015 09:22 PM
Contributor
Posts: 24

Re: Dates from excel

I figured it out! Date1=IDate should be IDate=Date1;

View solution in original post


All Replies
Solution
‎01-27-2015 09:22 PM
Contributor
Posts: 24

Re: Dates from excel

I figured it out! Date1=IDate should be IDate=Date1;

Trusted Advisor
Posts: 1,131

Re: Dates from excel

i dont think it is necessary to keep the variable IDate in the keep statement, it is this reason you got the uninitialized note.

From the input statement you are reading the date as date1 variable. so there is no need to use date1=ldate.


Thanks,

jag

Thanks,
Jag
Super User
Posts: 17,842

Re: Dates from excel

Why is the title of the question dates from Excel? This looks to be reading a tab delimited file.

MISSOVER is considered deprecated and TRUNCOVER should be used instead.

Contributor
Posts: 24

Re: Dates from excel

because the file is from excel - I just didn't show the dde.

PROC Star
Posts: 7,363

Re: Dates from excel

: Where have you heard/read that missover has been deprecated?

Super User
Posts: 17,842

Re: Dates from excel

I think the term came up in a discussion either here or on SAS-L this month, the question was what is the difference between TRUNCOVER/MISSOVER.

I don't think it's actually deprecated, just no longer useful in the majority of situations.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 250 views
  • 0 likes
  • 4 in conversation