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%3ERe%3A%20Utilisation%20de%20la%20date%20actuelle%20(TODAY%20()%20comme%20entr%C3%A9e%20de%20variable%20macro%20pour%20nommer%20un%20jeu%20de%20donn%C3%A9es%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%3ECe%20qui%20suit%20va%20cr%C3%A9er%20une%20nouvelle%20table%20avec%20le%20nom%20sp%C3%A9cifi%C3%A9%20comme%20vous%20l'avez%20demand%C3%A9.%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%3ERe%3A%20Utilisation%20de%20la%20date%20actuelle%20(TODAY%20()%20comme%20entr%C3%A9e%20de%20variable%20macro%20pour%20nommer%20un%20jeu%20de%20donn%C3%A9es%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%3EC'est%20grandiose!%3C%2FP%3E%3CP%3EMerci%20beaucoup%2C%20mon%20pote!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EUtilisation%20de%20la%20date%20actuelle%20(TODAY%20()%20comme%20entr%C3%A9e%20de%20variable%20macro%20pour%20nommer%20un%20jeu%20de%20donn%C3%A9es%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%3EJ'aimerais%20utiliser%20TODAY%20()%20pour%20d%C3%A9river%20la%20date%20actuelle%20et%20l'utiliser%20comme%20horodatage%20pour%20nommer%20un%20jeu%20de%20donn%C3%A9es%20JMP%2C%20ainsi%20que%20comme%20colonne%20TIME_STAMP.%20Dans%20SAS%2C%20cela%20peut%20ressembler%20%C3%A0%20ceci%20(j'avoue%20avoir%20un%20peu%20n%C3%A9glig%C3%A9%20le%20formatage).%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%3ELes%20variables%20macro%20JSL%20peuvent-elles%20faire%20le%20m%C3%AAme%20travail%3F%3C%2FP%3E%0A%3CP%3EToute%20entr%C3%A9e%20grandement%20appr%C3%A9ci%C3%A9e.%3C%2FP%3E%0A%3CP%3EBon%20week-end!%3C%2FP%3E%0A%3CP%3ED%C3%A9butant%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