In some cases, you might
want to modify the list of variables in the data set. The example
below shows how to
-
eliminate the default SERVICE variable
-
make the PROGRAM variable larger
in size
-
and add two new variables, EMPNO
and EMPDEPT (input values used by applications that run in this service).
First, create a default
data set using the following code:
proc appsrv port=0;
statistics create=work.stdstat;
run;
This command creates
the data set called STDSTAT in the WORK library, and writes the default
list of variables to it. Next, use a DATA step to create a modified
data set, as follows:
libname statlib 'path-to-library';
data statlib.stats;
/* change program length to 40 - you must change var defns before
anything else */
length program $40;
/* start with the default data set */
set work.stdstat;
/* set up EMPNO and EMPDEPT variables */
attrib empno length=$8 label='Employee Number';
attrib empdept length=$32 label='Employee Department';
/* drop service */
drop service;
/* do not select any observations (there are none) from the previous
data set */
stop;
run;
The STATLIB.STATS data
set now contains the desired variables. Modify your appstart.sas file
to save statistics to this data set, as follows:
proc appsrv ...;
...
allocate library statlib 'path-to-library';
statistics data=statlib.stats;
run;