cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Newbie2Jumpie
Level IV

Using current date (TODAY() as macro variable entry for naming a dataset (scripting)

I would like to use TODAY() to derive the current date and use it as a timestamp in naming a  JMP dataset, and as a TIME_STAMP column as well. In SAS, it may look like this (I admit I neglected the formatting a bit).

 

%let TODAYDATE=today();
data WORK.CLASS_&TODAYDATE. ;
set SASHELP.CLASS;
TIME_STAMP = &TODAYDATE.  ;
run ;

After resolving, the result should look like this :
"WORK.CLASS_20190628"
and
"TIME_STAMP
20190628
20190628
20190628
20190628
..."

 

 

May JSL macro variables do the same job?

Any input greatly appreciated.

Have a nice weekend!

Newbie

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Using current date (TODAY() as macro variable entry for naming a dataset (scripting)

The following will create a new table with the name specified as you requested.

New Table("CLASS_" || format(today(),"yyyymmdd"));
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Using current date (TODAY() as macro variable entry for naming a dataset (scripting)

The following will create a new table with the name specified as you requested.

New Table("CLASS_" || format(today(),"yyyymmdd"));
Jim
Newbie2Jumpie
Level IV

Re: Using current date (TODAY() as macro variable entry for naming a dataset (scripting)

That's grand, that is!

Thanks a lot, mate!