BookmarkSubscribeRSS Feed
mlcross
Calcite | Level 5

 

Hi there,

 

Apologies if this question feels a bit pedantic - it is my first real experience with SAS Macro and I just want to make sure i'm not falling for any 'rookie errors'

 

I have the following piece of code which has been written in a User written Transformation in SAS D.I studio. This code dictates that the SSRS presence macro should only run between the certain data paremeters specified.

 

Capture.JPG

 

Please can someone explain if I am making an obvious mistake with the first %SYSEVALF statement. The way it has been formatted within SAS D.I it appears that SAS is interpreting it as a new macro call, rather than the function I am trying to implement.

 

I have tried the same statment elsewhere on my job canvas and the formatting seems to change any time there is a preceeding %IF statement.

 

Thanks alot!

 

 

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

Don't pay too much attention the the color parser, it is not the smartest sometimes. If your code works then all good.

 

Regarding the test you posted, I am puzzled: Function %sysevalf() is used for floating number calculations, and you use it for a boolean value.

It is not required nor useful as you used it.

data_null__
Jade | Level 19

Consider this example where SYSEVALF get it right.

 

%let current = %sysfunc(today());
%let execution = '02OCT2015'd;

%put NOTE: &=current &=execution;
%put NOTE: %eval(&current = &execution);
%put NOTE: %sysevalF(&current = &execution);


27         %put NOTE: &=current &=execution;
NOTE: CURRENT=20363 EXECUTION='02OCT2015'd
28         %put NOTE: %eval(&current = &execution);
NOTE: 0
29         %put NOTE: %sysevalF(&current = &execution);
NOTE: 1
ChrisNZ
Tourmaline | Level 20

Hmm, fair point! I never thought of this case.

 

Thank you!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1119 views
  • 1 like
  • 3 in conversation