- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-09-2017 09:00 PM
(1143 views)
hi one of my senior had designed a code and in every program of eg he has passed %let dd=10.
ie.is first two digits of todays date. as we have to open each and every program change the digit to todays date manually and run,
so in need help for code to pass the todays dates first two digits automatically.
And i dont want to open every program and dont have to pass it manually.
please help
eg. if todays date is 10th nov 2017 so i have to manually enter it as %let dd=10 and this into every program.
so how can i automate it where i can check fo todays date and pass only two digits of system date.
thankyou
ie.is first two digits of todays date. as we have to open each and every program change the digit to todays date manually and run,
so in need help for code to pass the todays dates first two digits automatically.
And i dont want to open every program and dont have to pass it manually.
please help
eg. if todays date is 10th nov 2017 so i have to manually enter it as %let dd=10 and this into every program.
so how can i automate it where i can check fo todays date and pass only two digits of system date.
thankyou
- Tags:
- macro code
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Global macro variables work throughout a session. If you declare it once, you don't need to keep redeclaring it.
It helps to have it at the top of the program because it allows you to manually test things, but it's not necessary.
%let dd = %sysfunc(day(%sysfunc(today())), z2.);
%put DD = ⅆ
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
y have to use %put DD = &dd referencing and where.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Reeza inserted the %put just so you can see in the log which value was derived from the initial %let, and that it works as expected. That way values are also kept in the log for future reference. Aside from showing values in the log, the %put does nothing.