BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MiteUseSAS
Fluorite | Level 6

I was doing an environmental scan of mathematical programming languages that support a "modeler's form".  This seems like a well recognized term coined by creators of AMPL, meaning that the data structures/objects are organized and named in a way that recognizably reflects the context of the problem domain.  For SAS, I started in what I now think is in a tangential area, CASL, and found my way to SAS/OR, specifically OPTMODEL.  However, I'm having trouble with the terminology used.  OPTMODEL is referred to as a "procedure", with one way of designating it is "PROC OPTMODEL" [1,2].  But it is described as a modelling language plus solvers. Procedures are normally a component of languages rather than the other way around.

 

I found my way to the example code at pages [3,4].  If these are in fact examples of the modelling language associated with OPTMODEL, then it overlaps a lot with AMPL, which would make sense since they both model mathematical programming.

 

Why is OPTMODEL referred to as a "procedure"?  It seems like an model interpreter.  By "procedure", does SAS mean "workflow" or "process"?

 

P.S. I also found this explanation of SAS procedures: https://support.sas.com/learn/le/proc/index.html.  It refers to "procedure statements" as a "PROC step".  It doesn't really clea things up.

 

[1] https://support.sas.com/rnd/app/or/MP.html

[2] https://support.sas.com/rnd/app/or/procedures/optmodel.html

[3] http://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=ormpex&docsetTarget=ormpex...

[4] http://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=ormpex&docsetTarget=ormpex...

 

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

One of the first things to remember about SAS - it is NOT a programming language (although I suspect there are those in this community that would disagree).  SAS is a useful set of tools that often look like a programming language - in particular the DATA step, which is effectively the only component of the SAS "language" that is not referred to as a procedure.

 

Procedures may be simple:

proc contents data=mylib.mydata;
run;

which reports on the metadata of a sas data set.

 

Probably the most frequently used non-simple procedure is PROC SQL, which facilitates most sql statements in managing data sets.  I suppose in many programming contexts, SQL is not a procedure, but a language.

 

You've just run into PROC OPTMODEL which has a rich variety of components that look like a sub(?)-language.

 

SAS, if it is a language, is a procedural language - it does its work in a series of modules called by the programmer to ultimately facilitate data analysis.  A step (either a data step or a proc step) is run, followed by another step, etc. until the multi-step program has come to an end.    As a generality these procedures cannot call each other.

 

I leave it to the computer scientists among us to clarify my answer.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

5 REPLIES 5
Reeza
Super User
I won't be able to answer your questions but I'll add some info that may be helpful.

PROC is short for PROCEDURE.
SAS typically has PROCS and DATA steps as the main components, the PROCS usually do a very specific task, ie PROC MEANS does summary statistics and PROG LOGISTIC does logistic regression. A data step is primarily for data wrangling.

PROCs are organized into modules based on their functions, so SAS/STAT is the statistical procedures, SAS/OR is the operations research procedures.

You can sign up for a free account on SAS Academics on Demand (as an indepedent learner) and you'll have access to SAS which also includes SAS/OR module. You may also want to look into IML which has a more mathematical programming structure. SAS data steps are significantly different but they have their advantages as well. If you're looking at Viya, that also allows for R/Python usage as well.
MiteUseSAS
Fluorite | Level 6

Thanks, Reeza.  I'm just trying to interpret the language that describes OPTMODEL at this point.

At the moment, I suspect that an OPTMODEL procedure is actually the source code that describes a model using the modeling language, i.e., rather than the intepreter itself.

mkeintz
PROC Star

One of the first things to remember about SAS - it is NOT a programming language (although I suspect there are those in this community that would disagree).  SAS is a useful set of tools that often look like a programming language - in particular the DATA step, which is effectively the only component of the SAS "language" that is not referred to as a procedure.

 

Procedures may be simple:

proc contents data=mylib.mydata;
run;

which reports on the metadata of a sas data set.

 

Probably the most frequently used non-simple procedure is PROC SQL, which facilitates most sql statements in managing data sets.  I suppose in many programming contexts, SQL is not a procedure, but a language.

 

You've just run into PROC OPTMODEL which has a rich variety of components that look like a sub(?)-language.

 

SAS, if it is a language, is a procedural language - it does its work in a series of modules called by the programmer to ultimately facilitate data analysis.  A step (either a data step or a proc step) is run, followed by another step, etc. until the multi-step program has come to an end.    As a generality these procedures cannot call each other.

 

I leave it to the computer scientists among us to clarify my answer.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
ballardw
Super User

Look into Proc IML for even more similar confusion.

MiteUseSAS
Fluorite | Level 6

Thanks.  It actually clears things up.  Basically, very sophisticated tools are invoked as procedures from a higher level language.  A bit like being in Bash and invoking LaTeX.  But much more sophisticated.

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!

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
  • 5 replies
  • 600 views
  • 8 likes
  • 4 in conversation