CORE
mm_createstp.sas File Reference

Create a type 1 Stored Process (9.2 compatible) More...

Go to the source code of this file.

Detailed Description

Create a type 1 Stored Process (9.2 compatible)

This macro creates a Type 1 stored process, and also the necessary PromptGroup / File / TextStore objects. It requires the location (or uri) for the App Server / Directory / Folder (Tree) objects. To upgrade this macro to work with type 2 (which can embed SAS code and is compabitible with SAS from 9.3 onwards) then the UsageVersion should change to 2000000 and the TextStore object updated. The ComputeServer reference will also be to ServerContext rather than LogicalServer.

This macro is idempotent - if you run it twice, it will only create an STP once.

usage:

%mm_createstp(stpname=MyNewSTP
  ,filename=mySpecialProgram.sas
  ,directory=SASEnvironment/SASCode/STPs
  ,tree=/User Folders/sasdemo
  ,outds=work.uris)

If you wish to remove the new STP you can do so by running:

data _null_;
  set work.uris;
  rc1 = METADATA_DELOBJ(texturi);
  rc2 = METADATA_DELOBJ(prompturi);
  rc3 = METADATA_DELOBJ(fileuri);
  rc4 = METADATA_DELOBJ(stpuri);
  putlog (_all_)(=);
run;
Parameters
stpname=Stored Process name. Avoid spaces - testing has shown that the check to avoid creating multiple STPs in the same folder with the same name does not work when the name contains spaces.
stpdesc=Stored Process description (optional)
filename=the name of the .sas program to run
directory=The directory uri, or the actual path to the sas program (no trailing slash). If more than uri is found with that path, then the first one will be used.
tree=The metadata folder uri, or the metadata path, in which to create the STP.
server=The server which will run the STP. Server name or uri is fine.
outds=The two level name of the output dataset. Will contain all the meta uris. Defaults to work.mm_createstp.
mDebug=set to 1 to show debug messages in the log
Returns
outds dataset containing the following columns:
  • stpuri
  • prompturi
  • fileuri
  • texturi
Version
9.2
Author
Allan Bowe

Definition in file mm_createstp.sas.