BookmarkSubscribeRSS Feed
Quentin
Super User

@ecofred Did you hear anything interesting from tech support?

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1815 views
  • 0 likes
  • 4 in conversation