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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.