Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
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!

Article Labels

    There are no labels assigned to this post.