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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 944 views
  • 1 like
  • 2 in conversation