cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
%3CLINGO-SUB%20id%3D%22lingo-sub-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Utilizzare%20la%20data%20corrente%20(TODAY%20()%20come%20voce%20della%20variabile%20macro%20per%20nominare%20un%20set%20di%20dati%20(script)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EQuanto%20segue%20creer%C3%A0%20una%20nuova%20tabella%20con%20il%20nome%20specificato%20come%20richiesto.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENew%20Table(%22CLASS_%22%20%7C%7C%20format(today()%2C%22yyyymmdd%22))%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Utilizzare%20la%20data%20corrente%20(TODAY%20()%20come%20voce%20della%20variabile%20macro%20per%20nominare%20un%20set%20di%20dati%20(script)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%C3%88%20grandioso%2C%20cio%C3%A8!%3C%2FP%3E%3CP%3EGrazie%20mille%2C%20amico!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EUtilizzo%20della%20data%20corrente%20(TODAY%20()%20come%20voce%20della%20variabile%20macro%20per%20denominare%20un%20set%20di%20dati%20(script)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVorrei%20usare%20TODAY%20()%20per%20ricavare%20la%20data%20corrente%20e%20usarla%20come%20timestamp%20nel%20nominare%20un%20dataset%20JMP%20e%20anche%20come%20una%20colonna%20TIME_STAMP.%20In%20SAS%2C%20pu%C3%B2%20assomigliare%20a%20questo%20(ammetto%20che%20ho%20trascurato%20la%20formattazione%20un%20po%20').%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%25let%20TODAYDATE%3Dtoday()%3B%0Adata%20WORK.CLASS_%26amp%3BTODAYDATE.%20%3B%0Aset%20SASHELP.CLASS%3B%0ATIME_STAMP%20%3D%20%26amp%3BTODAYDATE.%26nbsp%3B%20%3B%0Arun%20%3B%0A%0AAfter%20resolving%2C%20the%20result%20should%20look%20like%20this%20%3A%0A%22WORK.CLASS_20190628%22%0Aand%0A%22TIME_STAMP%0A20190628%0A20190628%0A20190628%0A20190628%0A...%22%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELe%20variabili%20macro%20JSL%20possono%20fare%20lo%20stesso%20lavoro%3F%3C%2FP%3E%0A%3CP%3EOgni%20input%20%C3%A8%20molto%20apprezzato.%3C%2FP%3E%0A%3CP%3EPassa%20un%20bel%20weekend!%3C%2FP%3E%0A%3CP%3ENovizio%3C%2FP%3E%3C%2FLINGO-BODY%3E
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!

Recommended Articles