The SAS Output Delivery System and reporting techniques

Need help on Macros

Reply
Occasional Contributor
Posts: 19

Need help on Macros

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.

Respected Advisor
Posts: 3,799

Re: Need help on Macros

Posted in reply to KannanBaskar

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
Ask a Question
Discussion stats
  • 1 reply
  • 300 views
  • 0 likes
  • 2 in conversation