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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1128 views
  • 0 likes
  • 2 in conversation