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%EF%BC%9A%E4%BD%BF%E7%94%A8%E5%BD%93%E5%89%8D%E6%97%A5%E6%9C%9F%EF%BC%88TODAY%EF%BC%88%EF%BC%89%E4%BD%9C%E4%B8%BA%E5%AE%8F%E5%8F%98%E9%87%8F%E6%9D%A1%E7%9B%AE%E6%9D%A5%E5%91%BD%E5%90%8D%E6%95%B0%E6%8D%AE%E9%9B%86%EF%BC%88%E8%84%9A%E6%9C%AC%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215264%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BB%A5%E4%B8%8B%E5%B0%86%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E6%96%B0%E8%A1%A8%EF%BC%8C%E5%85%B6%E5%90%8D%E7%A7%B0%E6%8C%89%E6%82%A8%E7%9A%84%E8%A6%81%E6%B1%82%E6%8C%87%E5%AE%9A%E3%80%82%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%EF%BC%9A%E4%BD%BF%E7%94%A8%E5%BD%93%E5%89%8D%E6%97%A5%E6%9C%9F%EF%BC%88TODAY%EF%BC%88%EF%BC%89%E4%BD%9C%E4%B8%BA%E5%AE%8F%E5%8F%98%E9%87%8F%E6%9D%A1%E7%9B%AE%E6%9D%A5%E5%91%BD%E5%90%8D%E6%95%B0%E6%8D%AE%E9%9B%86%EF%BC%88%E8%84%9A%E6%9C%AC%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215268%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E9%82%A3%E5%A4%AA%E6%A3%92%E4%BA%86%EF%BC%8C%E5%B0%B1%E6%98%AF%E8%BF%99%E6%A0%B7%EF%BC%81%3C%2FP%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%EF%BC%8C%E4%BC%99%E4%BC%B4%E4%BB%AC%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E4%BD%BF%E7%94%A8%E5%BD%93%E5%89%8D%E6%97%A5%E6%9C%9F%EF%BC%88TODAY%EF%BC%88%EF%BC%89%E4%BD%9C%E4%B8%BA%E5%AE%8F%E5%8F%98%E9%87%8F%E6%9D%A1%E7%9B%AE%E6%9D%A5%E5%91%BD%E5%90%8D%E6%95%B0%E6%8D%AE%E9%9B%86%EF%BC%88%E8%84%9A%E6%9C%AC%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-215252%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E6%83%B3%E4%BD%BF%E7%94%A8TODAY%EF%BC%88%EF%BC%89%E6%9D%A5%E6%B4%BE%E7%94%9F%E5%BD%93%E5%89%8D%E6%97%A5%E6%9C%9F%EF%BC%8C%E5%B9%B6%E5%B0%86%E5%85%B6%E7%94%A8%E4%BD%9C%E5%91%BD%E5%90%8DJMP%E6%95%B0%E6%8D%AE%E9%9B%86%E7%9A%84%E6%97%B6%E9%97%B4%E6%88%B3%EF%BC%8C%E4%BB%A5%E5%8F%8A%E4%BD%9C%E4%B8%BATIME_STAMP%E5%88%97%E3%80%82%E5%9C%A8SAS%E4%B8%AD%EF%BC%8C%E5%AE%83%E5%8F%AF%E8%83%BD%E7%9C%8B%E8%B5%B7%E6%9D%A5%E5%83%8F%E8%BF%99%E6%A0%B7%EF%BC%88%E6%88%91%E6%89%BF%E8%AE%A4%E6%88%91%E7%A8%8D%E5%BE%AE%E5%BF%BD%E7%95%A5%E4%BA%86%E6%A0%BC%E5%BC%8F%E5%8C%96%EF%BC%89%E3%80%82%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%E5%8F%AF%E8%83%BDJSL%E5%AE%8F%E5%8F%98%E9%87%8F%E5%81%9A%E5%90%8C%E6%A0%B7%E7%9A%84%E5%B7%A5%E4%BD%9C%E5%90%97%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%E4%BB%BB%E4%BD%95%E8%BE%93%E5%85%A5%E9%83%BD%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E3%80%82%3C%2FP%3E%0A%3CP%3E%E5%91%A8%E6%9C%AB%E6%84%89%E5%BF%AB%EF%BC%81%3C%2FP%3E%0A%3CP%3E%E6%96%B0%E6%89%8B%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