I am writing an automated SAS process where
It checks teradata first and if the data is available in the table then only run the code in program otherwise it jump on a given location like in VBA.
if <condition>=true then do: process: else goto gg: statement,,, statement,,, statement,,, statement,,,statement,,, gg: code resume from here
do we have same thing in SAS...
Since 9.4M5 we can use %if in open code (outside a macro):
%let flag=0;
%if &flag %then %do;
proc print data=sashelp.class;
run;
%end;
Since 9.4M5 we can use %if in open code (outside a macro):
%let flag=0;
%if &flag %then %do;
proc print data=sashelp.class;
run;
%end;
My Current version: 9.04.01M3P062415.
Will it work here or do we have any other alternative
If %if %then %do does not work in open code, you need to pack all code you want to run conditionally into a macro, so you can use %if there.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.