The data processed by this macro does not come from traditional SAS datasets (whether SASHELP, internal, or external to the script). It is extracted from the textual output of an external system command (`tabver`) executed via a UNIX pipe. The result is textual information (a version number) stored in a macro variable.
1 Code Block
MACRO DEFINITION
Explanation : This block defines the `AHGtabver` macro which encapsulates the version retrieval logic. It uses `%syslput` to transfer parameters from the local session to the remote session before `rsubmit`. The code between `rsubmit;` and `endrsubmit;` is executed on the remote server. After the `DATA _NULL_` execution on the remote server, `%%sysrput` returns the value of the `rtabver` macro variable (created on the remote) to the local session, assigning it to the macro variable whose name is provided by `&outver`.
Explanation : This `DATA _NULL_` is executed on the remote server (inside the `rsubmit` block). It does not create a permanent dataset. It is used to:
1. Define a `filename` called `pip` as a pipe (`pipe`) that will execute the shell command `cd &root3; tabver &rtabno`.
2. Use `infile pip` to read the output of this external command.
3. Read the first line of the output into the `line` variable.
4. Use `call symput('rtabver',line);` to create a macro variable named `rtabver` (on the remote server) and assign it the content of `line`. This macro variable will contain the version number returned by the `tabver` system command.
Copied!
data _null_;
filename pip pipe "cd &root3; tabver &rtabno";
infile pip;
length line $100;
input line;
call symput('rtabver',line);
run;
1
DATA _null_;
2
filename pip pipe "cd &root3; tabver &rtabno";
3
INFILE pip;
4
LENGTH line $100;
5
INPUT line;
6
call symput('rtabver',line);
7
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.