BookmarkSubscribeRSS Feed
sampsas
Fluorite | Level 6

Hi Friends, i developed below process and just want to make sure have correct logic in place. 

Goal here is to make sure empty touch file got out ONLY WHEN previous process gets completed and "full/complete" file is available 

 

step1:

/*different sas process runs and end of the process one large .dat file out there on sas server */

 

step2:

/*logic which create touch file only once large .dat file is done writing and fully available*/

 

%let datfile="/dir-where-dat-file-is/test.dat

 

%if %sysfunc(fileexist(&datfile))  %then
%do;

 

data _null_;
infile "cd /dir-where-touch-file-needs-to-go; touch MarketingDataFileReady.txt;" pipe;
run;

 

 

 

 

2 REPLIES 2
noling
SAS Employee

Seems correct. Other questions:

 

1. Do you remove the .dat file after your touch file is created? It's possible that you may look at the same .dat file multiple times if you don't check timestamps or move the file out.

 

2. Do you have another process that deletes the touch file later? Same potential issues as question #1.


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

sampsas
Fluorite | Level 6

Thanks. 

 

1. Do you remove the .dat file after your touch file is created? No. this will be replaced/overwritten by my same process next day (process runs on daily bases) It's possible that you may look at the same .dat file multiple times if you don't check timestamps or move the file out. 

 

2. Do you have another process that deletes the touch file later? No, this will be replaced/overwritten as well. i am assuming Same potential issues as question #1.

- another technology (non-sas) will pickup touch file 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 861 views
  • 0 likes
  • 2 in conversation