Help using Base SAS procedures

proc import date

Accepted Solution Solved
Reply
Valued Guide
Posts: 860
Accepted Solution

proc import date

Proc import is bringing in a weird date, from 2014 to 2074.  Is there anyway to correct it after it has been imported, or via proc import?  I don't know that I can informat using proc import.  I know I can datastep informat but if I can get around that (file changes monthly) I would much prefer too.

Thanks in advance.


Accepted Solutions
Solution
‎12-12-2014 01:25 PM
Valued Guide
Posts: 860

Re: proc import date

Posted in reply to Steelers_In_DC

date is formatted yyyy/mm/dd in excel,

View solution in original post


All Replies
Solution
‎12-12-2014 01:25 PM
Valued Guide
Posts: 860

Re: proc import date

Posted in reply to Steelers_In_DC

date is formatted yyyy/mm/dd in excel,

Super User
Posts: 19,878

Re: proc import date

Posted in reply to Steelers_In_DC

Is your variable name consistent between files?

Can you post sample excel file and import code that generates the issue?

Valued Guide
Posts: 860

Re: proc import date

the name is consistant:

Excel:

Process_date
2014/07/28

sas:

Process_date
2014/07/28
1
Valued Guide
Posts: 860

Re: proc import date

Posted in reply to Steelers_In_DC

oops

sas:

107/29/2074
Valued Guide
Posts: 860

Re: proc import date

Posted in reply to Steelers_In_DC

for the current month I used intck to come up with good_date = process_date - 21916; but that isn't anything that I would hand over to the business owner as a 'solution'.

Super User
Posts: 19,878

Re: proc import date

Posted in reply to Steelers_In_DC

Your proc import code? Did you use scandate option?

Valued Guide
Posts: 860

Re: proc import date

PROC IMPORT FILE="C:\Users\pp78499\Desktop\SOP_IMPAIRED_TREND.xls"

    OUT=Quarterly_Trend_Report

    DBMS=xls

    REPLACE;  

    SHEET="Change >5%"; scandate=no; scantime=no;

    namerow=6;

    startrow=7;

    GETNAMES=YES;

    RUN;

Super User
Posts: 19,878

Re: proc import date

Posted in reply to Steelers_In_DC

And with scandate=yes what do you get?

🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 439 views
  • 0 likes
  • 2 in conversation