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.
date is formatted yyyy/mm/dd in excel,
date is formatted yyyy/mm/dd in excel,
Is your variable name consistent between files?
Can you post sample excel file and import code that generates the issue?
the name is consistant:
Excel:
| Process_date |
| 2014/07/28 |
sas:
| Process_date | |||||||
| 2014/07/28 | |||||||
| 1 |
|---|
oops
sas:
| 1 | 07/29/2074 |
|---|
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'.
Your proc import code? Did you use scandate option?
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;
And with scandate=yes what do you get?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.