BookmarkSubscribeRSS Feed
Soulbroda
Obsidian | Level 7

I am presently working on a load job that requires a conditional start to only run when the file received at the start point has records in it. Kindly see below diagram and advice if this is the best way to go about it. What condition will I also use to configure the conditional start. When I tried NOBS>0, it didn't work as I expected.

 

 

Conditional Start / EndConditional Start / End

1 REPLY 1
MichaelLarsen
SAS Employee

Use the transformations Conditional Start and Conditional Start, you can find them in the Transformations under Control.

 

The condition specified in Conditional Start is a macro expression, so either in a step before or in the precode of Conditional Start, enter the code that will create the macro variable. Example:

%let Rows=0;

proc sql noprint;

  select count(*) into : Rows trimmed

 from &_INPUT1 ;

quit;

 

the above example will only work with a User Written Transformation using the output table from Step 3 as input.

 

In your Conditional Start the condition would then be: &Rows > 0

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 483 views
  • 1 like
  • 2 in conversation