Hello, I am trying to format the value of &str (which resolves to 21639) below. I have tried various inputc, putc, inputn, putn variations but can't seem to come up with a macro variable with the value of 12/31/2019.
code below ****************************
%let str=intnx('quarter',intnx('quarter', '01JAN2017'd, 5, "sameday"), 3, "end");
data _null_; call symputx('dt', &str,'G'); run;
%put dt=&dt;
* a couple attempts of formatting the value;
data _null_; call symputx('dt1', %sysfunc(inputn(&str, 6.), mmddyy10.),'G'); call symputx('dt2', %sysfunc(21639,mmddyy10.),'G'));
run;
%put dt1=&dt1; %put dt2=&dt2;
log **************************************************
17 %let str=intnx('quarter',intnx('quarter', '01JAN2017'd, 5, "sameday"), 3, "end"); 18 19 data _null_; 20 call symputx('dt', &str,'G'); 21 run;
NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
22 23 %put dt=&dt; dt=21639 24 25 data _null_; 26 call symputx('dt1', %sysfunc(inputn(&str, 6.), mmddyy10.),'G'); WARNING: Argument 1 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value. 27 call symputx('dt2', %sysfunc(21639,mmddyy10.),'G')); ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference. 27 call symputx('dt2', %sysfunc(21639,mmddyy10.),'G')); _ 159 ERROR 159-185: Null parameters for SYMPUTX are invalid.
27 call symputx('dt2', %sysfunc(21639,mmddyy10.),'G')); _________ 386 ERROR 386-185: Expecting an arithmetic expression.
27 call symputx('dt2', %sysfunc(21639,mmddyy10.),'G')); _________ 201 2 The SAS System 10:40 Wednesday, June 27, 2018
ERROR 201-322: The option is not recognized and will be ignored.
27 call symputx('dt2', %sysfunc(21639,mmddyy10.),'G')); _________ 76 ERROR 76-322: Syntax error, statement will be ignored.
28 29 run;
NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
30 31 %put dt1=&dt1; dt1=. 32 %put dt2=&dt2; dt2=0.0000479317 33 34
... View more