BookmarkSubscribeRSS Feed
KannanBaskar
Calcite | Level 5

Hi All,

I am in need of your help to resolve below mentioned issue with respect to SAS dates.

DATA SET EMP:

EMP NO   DOJ

123456     03/06/2000

345678     09/06/2008

123678     21/06/2010

346678     10/07/2013

%LET LAP_DAT_IND = &ASATDATE;

PROC SQL;

CREATE TABLE ABC AS

SELECT * FROM EMP

WHERE DOJ < &LAP_DAT_IND.

QUIT;

ASATDATE variable comes as input from application (format is 03-06-2013) and this value needs to be passed as '03JUN2013'd. Could you please let me know how to change this.

Thanks.

1 REPLY 1
data_null__
Jade | Level 19

You don't need a date constant using the interger value will work as well in your code.

18         %let ASATDATE=03-06-2013;
19         %LET LAP_DAT_IND = %sysfunc(inputN(&ASATDATE,mmddyy,10));
20         %put NOTE: &=asatdate &=lap_dat_ind;
NOTE: ASATDATE=03-06-2013 LAP_DAT_IND=19423

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1109 views
  • 0 likes
  • 2 in conversation