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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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