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-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EVerwenden%20des%20aktuellen%20Datums%20(TODAY()%20als%20Makrovariableneintrag%20zum%20Benennen%20eines%20Datensatzes%20(Scripting)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20m%C3%B6chte%20TODAY()%20verwenden%2C%20um%20das%20aktuelle%20Datum%20abzuleiten%20und%20es%20als%20Zeitstempel%20bei%20der%20Benennung%20eines%20JMP-Datensatzes%20und%20auch%20als%20TIME_STAMP-Spalte%20zu%20verwenden.%20In%20SAS%20kann%20es%20so%20aussehen%20(ich%20gebe%20zu%2C%20ich%20habe%20die%20Formatierung%20etwas%20vernachl%C3%A4ssigt).%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%3EK%C3%B6nnen%20JSL-Makrovariablen%20die%20gleiche%20Aufgabe%20erf%C3%BCllen%3F%3C%2FP%3E%0A%3CP%3EJeder%20Input%20wird%20sehr%20gesch%C3%A4tzt.%3C%2FP%3E%0A%3CP%3EEin%20sch%C3%B6nes%20Wochenende%20w%C3%BCnsche%20ich%20ihnen!%3C%2FP%3E%0A%3CP%3ENeuling%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Verwendung%20des%20aktuellen%20Datums%20(TODAY()%20als%20Makrovariableneintrag%20zum%20Benennen%20eines%20Datensatzes%20(Scripting)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDas%20ist%20gro%C3%9Fartig%2C%20das%20ist!%3C%2FP%3E%3CP%3EVielen%20Dank%2C%20Kumpel!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Verwendung%20des%20aktuellen%20Datums%20(TODAY()%20als%20Makrovariableneintrag%20zum%20Benennen%20eines%20Datensatzes%20(Scripting)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIm%20Folgenden%20wird%20eine%20neue%20Tabelle%20mit%20dem%20von%20Ihnen%20angegebenen%20Namen%20erstellt.%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
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