BookmarkSubscribeRSS Feed
Quentin
Super User

@ecofred Did you hear anything interesting from tech support?

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
ecofred
Fluorite | Level 6

Dear Tom, 

 

Yes I do have a practical need, but i'm also curious because it does not fit in my current model of how DOSUBL (and RUN_FILE) works.

 

I have a list of output names in a dataset, each output is associated to a file. Each files produce 3 things: a dataset, a ods document object, a pdf (replay).

 

With a DATA STEP, I visit the dataset, infer the path to each output files, give it to dosubl/%include, check that the files where produce and create new variable to report the success/failure for the production of each outputs.

 

An other step is to let run a QC program. this gives 'only' a dataset for each output. I can then dosubl or run_macro to capture the &SYSINFO. value of the proc compare.

 

Compared to the call execute, I get better encapsulation/local properties for my processes and can streamline the success/failure directly to the PDV (did I mentionned how gorgious i find the DOSUBL/RUN_* function?). all in one path.

 

With call execute I have to insert the progresses to another dataset, open it many times and take the risk of having some concurrency issues.

From experience I find DOSUBL more reliable than CALL EXECUTE,

Title 'DOSUBL = reliable';
data zz;
	rc=dosubl("proc contents data=sashelp.cars short; run';");
	output;
	rc=dosubl("proc contents data=sashelp.airline short; run;");
	output;
run;

Title 'CALL EXECUTE leak: AIRLINE missing!';
data zz;
	call execute("proc contents data=sashelp.cars short; run';");
	call execute("proc contents data=sashelp.airline short; run;");
run;

Please let this code illustrate my point:. a typo is placed in the form of *run';* in the 2 datasteps. luckily for CALL EXECUTE, the 2nd instruction is not mission critical... (did I mentionned that I can not trust the output programs).

 

So technically, this dosubl/proc document issue is the last challenge in an attempt of abstracting the full processes line (output generation + Quality check) in what I would define as a reliable and metadata-driven and BASE SAS only solution.

 

Now, in a sane world, I would refactor more than one part and make it work, but I'm not living in a sane world, and I can not touch programs generating the outputs.(lack of time and QC issue are the 2 main reasons).

 

I currently have a call execute as a 2d pass to correct the outputs, (following the 'first make it work' principle 🙂 ). But it seems so close,..

 

Regards,

Frederic

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 16 replies
  • 2601 views
  • 0 likes
  • 4 in conversation