I have attached a sample dataset.
I can get the date format in date9. in data step.
DATA SAMPLE1;
FORMAT SAMPLE_DT1 DATE9.;
SET SAMPLE;
SAMPLE_DT1 = DATEPART(SAMPLE_DT);
RUN;
May i know how to get similar answer in PROC SQL? I used datepart in SQL but could not get it. Any idea? Thanks.
Try this one:
PROC SQL;
SELECT * , DATEPART(SAMPLE_DT) AS SAMPLE_DT1 FORMAT=date9.
FROM sample;
quit;
Try this one:
PROC SQL;
SELECT * , DATEPART(SAMPLE_DT) AS SAMPLE_DT1 FORMAT=date9.
FROM sample;
quit;
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.