How do I abort a job in data integration studio using the following rule:
- Check if exists a file on the sas server starting with /project/customer*
- Failing that, I need to abort the process
Tks
Depends on your global DI project requirements.
You clould make this part of the autoexec_usermods files or the script starting the associated app-server.
Is it only one job in your project you can do it with some user-coding in the transformation
To do it with user-coding transformation, does anyone have an example of how to do?
The logic is as follows:
c= count(files(/project/customer*))
if c=0 then
abort(job);
end
Check out the SAS external file functions to query directory contents.
Based on the result, use the data step statement ABORT ABEND/RETURN.
This, as Jaap mentioned, could be done in a User Written code transform, or in a Job Pre-code, which is best depends on what you intend to do if there exists files in the directory.
If you would do it with unix-scripting (usermods file in the appserver configuration) use the Unix manual,
for example a google-hit: http://kenfallon.com/finding-if-one-or-more-files-exist-in-a-directory-using-bash/
Would you do it in your own SAS code, see: SAS(R) 9.4 Companion for UNIX Environments, Third Edition (dinfo) orSAS(R) 9.4 Companion for UNIX Environments, Third EditionEnvironments, Third Edition (fileexist)
Contact your platform admin for what is the best thing to do in this.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.