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

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!

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