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%20Usar%20la%20fecha%20actual%20(HOY%20()%20como%20entrada%20de%20variable%20de%20macro%20para%20nombrar%20un%20conjunto%20de%20datos%20(secuencias%20de%20comandos)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ELo%20siguiente%20crear%C3%A1%20una%20nueva%20tabla%20con%20el%20nombre%20especificado%20como%20usted%20solicit%C3%B3.%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%20Usar%20la%20fecha%20actual%20(HOY%20()%20como%20entrada%20de%20variable%20de%20macro%20para%20nombrar%20un%20conjunto%20de%20datos%20(secuencias%20de%20comandos)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEso%20es%20grandioso%2C%20eso%20es!%3C%2FP%3E%3CP%3EMuchas%20gracias%2C%20amigo!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EUsar%20la%20fecha%20actual%20(HOY%20()%20como%20entrada%20de%20variable%20de%20macro%20para%20nombrar%20un%20conjunto%20de%20datos%20(secuencias%20de%20comandos)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMe%20gustar%C3%ADa%20usar%20HOY%20()%20para%20derivar%20la%20fecha%20actual%20y%20usarla%20como%20marca%20de%20tiempo%20al%20nombrar%20un%20conjunto%20de%20datos%20JMP%2C%20y%20tambi%C3%A9n%20como%20una%20columna%20TIME_STAMP.%20En%20SAS%2C%20puede%20verse%20as%C3%AD%20(admito%20que%20descuid%C3%A9%20un%20poco%20el%20formato).%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%3E%C2%BFLas%20variables%20macro%20de%20JSL%20pueden%20hacer%20el%20mismo%20trabajo%3F%3C%2FP%3E%0A%3CP%3ECualquier%20entrada%20muy%20apreciada.%3C%2FP%3E%0A%3CP%3E%C2%A1Ten%20un%20buen%20fin%20de%20semana!%3C%2FP%3E%0A%3CP%3ENovato%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