BookmarkSubscribeRSS Feed
brichards920
Calcite | Level 5

Is it possible to run other SAS procedures, like PROC REG or PROC MEANS, from within a PROC DS2 step? 

 

In a data step, it's possible to reach outside of the step to use other SAS procedures with tools like:

 

  • PROC FCMP with the run_macro function
  • DOSUBL

I've been trying to look up similar tools in PROC DS2, but I've had a hard time finding them. I've tried to use the options above, as well as some attempts like running SQLEXEC that references an FCMP function that references a Macro with my PROC, but these have all failed.

 

My goal is to be able to run and store results from SAS PROCs on the packages I create. For example, if I created a package that included the name of a dataset and a field in my dataset, it would be useful to be able to connect to SAS PROCs that would allow me to write methods that would allow me to access my objects like:

 

  • myObj.proc_freq()
  • myObj.proc_means()
  • myObj.proc_logistic()

 

Where the methods would store the instructions for reading the data set I had named in the object, and would point to the variables I had defined in the object.

1 REPLY 1
ChrisBrooks
Ammonite | Level 13

I've given this some thought and I can't think of a way of doing it. If it were possible then a Proc FCMP function called via the FCMP package would be the most likely way but not everything you can do in FCMP works through DS2.

 

I'm not even sure the concept necessarily fits with DS2 since the data set would most likely be represented by the DS2 package which seems unnecessary. Of course data sets created with DS2 are compatible with Base SAS anyway so you can just call the Procedure outside DS2, reconfiguring your program as necessary.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 554 views
  • 0 likes
  • 2 in conversation