Restriction: Allowed in macro definition and open code
Syntax
%SYSMACDELETE macro_name </ option>;
Required Argument
macro_name
the name of a macro or a text expression that produces a macro variable name.
Optional Argument
NOWARN
specifies that no warning diagnostic message should be issued.
Details
The %SYSMACDELETE statement deletes the macro definition of the specified macro
from the Work.SASMacr catalog. If no definition for the macro exists in the
Work.SASMacr catalog, a WARNING diagnostic message is issued. If the macro is
currently being executed, an ERROR diagnostic message is issued.
%SYSMSTORECLEAR Statement
Closes the stored compiled macro catalog associated with the libref specified in the SASMSTORE= option
and clears the libref.
Type: Macro statement
Restriction: Allowed in macro definition and open code
See: SASMSTORE= system option
Syntax
%SYSMSTORECLEAR;
Details
Use the %SYSMSTORECLEAR statement to close the stored compiled macro catalog
and to clear the previous libref when switching between SASMSTORE= libraries.
Note: If any stored compiled macro from the library specified by the SASMSTORE=
system option is still executing, the following will occur:
an ERROR diagnostic message will be issued
the library will not be closed
the libref will not be cleared
%SYSRPUT Statement
Assigns the value of a macro variable on a remote host to a macro variable on the local host.
342 Chapter 19 Macro Statements
Type: Macro statement
Restriction: Allowed in macro definitions or open code
Requirement: SAS/CONNECT
See: “Use the Macro Facility with SAS/CONNECT” in SAS/CONNECT User’s Guide
“SYSERR Automatic Macro Variable” on page 208, “SYSINFO Automatic Macro
Variable” on page 214, and “%SYSLPUT Statement” on page 339
Syntax
%SYSRPUT local-macro-variable=remote-macro-variable;
%SYSRPUT _USER_ </LIKE=‘character-string’> ;
Required Arguments
Form 1
local-macro-variable
is the name of a macro variable with no leading ampersand or a text expression that
produces the name of a macro variable. This name must be a macro variable stored
on the local host.
remote-macro-variable
is the name of a macro variable with no leading ampersand or a text expression that
produces the name of a macro variable. This name must be a macro variable stored
on a remote host.
Optional Argument
Form 2
_USER_
to push all remote user-defined macro variables from the remote host to the local
host all at the same time.
/LIKE=‘character-string’
Specifies the sequence of characters, or pattern, to be used as the criteria for
determining which macro variables are to be copied to the server session.
Character patterns can consist of the following:
any sequence of characters, A-Z
any sequence of digits, 0-9
a single wildcard character in the form of an asterisk (*)
The wildcard character (*) cannot be embedded or used more than once in the
character string.
Restrictions
The wildcard character (*) cannot be embedded in the character
string.
The wildcard character (*) can be specified only once in the
character string.
Requirement
The wildcard character (*) must be used at either the beginning or
the end of the character string.
%SYSRPUT Statement 343
See
For more detailed information, see “/LIKE=‘character-string’ ” in
SAS/CONNECT Users Guide.
Details
The %SYSRPUT statement is submitted with SAS/CONNECT to a remote host to
retrieve the value of a macro variable stored on the remote host. %SYSRPUT assigns
that value to a macro variable on the local host. %SYSRPUT is similar to the %LET
macro statement because it assigns a value to a macro variable. However, %SYSRPUT
assigns a value to a variable on the local host, not on the remote host where the
statement is processed. The %SYSRPUT statement places the macro variable into the
global symbol table in the client session.
Note: The names of the macro variables on the remote and local hosts must not contain
a leading ampersand.
The %SYSRPUT statement is useful for capturing the value of the automatic macro
variable SYSINFO and passing that value to the local host. SYSINFO contains return-
code information provided by some SAS procedures. Both the UPLOAD and the
DOWNLOAD procedures of SAS/CONNECT can update the macro variable SYSINFO
and set it to a nonzero value when the procedure terminates due to errors. You can use
%SYSRPUT on the remote host to send the value of the SYSINFO macro variable back
to the local SAS session. Thus, you can submit a job to the remote host and test whether
a PROC UPLOAD or DOWNLOAD step has successfully completed before beginning
another step on either the remote host or the local host.
For more information about using %SYSRPUT, see the documentation for
SAS/CONNECT Software.
To create a new macro variable or modify the value of an existing macro variable on a
remote host or server, use the %SYSLPUT macro statement.
Example: Checking the Value of a Return Code on a
Remote Host
This example illustrates how to download a file and return information about the success
of the step from a noninteractive job. When remote processing is completed, the job then
checks the value of the return code stored in RETCODE. Processing continues on the
local host if the remote processing is successful.
The %SYSRPUT statement is useful for capturing the value returned in the SYSINFO
macro variable and passing that value to the local host. The SYSINFO macro variable
contains return-code information provided by SAS procedures. In the example, the
%SYSRPUT statement follows a PROC DOWNLOAD step, so the value returned by
SYSINFO indicates the success of the PROC DOWNLOAD step:
rsubmit;
%macro download;
proc download data=remote.mydata out=local.mydata;
run;
%sysrput retcode=&sysinfo;
%mend download;
%download
endrsubmit;
%macro checkit;
%if &retcode = 0 %then %do;
further processing on local host
344 Chapter 19 Macro Statements
%end;
%mend checkit;
%checkit
A
SAS/CONNECT batch (noninteractive) job always returns a system condition code of
0. To determine the success or failure of the SAS/CONNECT noninteractive job, use the
%SYSRPUT macro statement to check the value of the automatic macro variable
SYSERR. To determine what remote system the SAS/CONNECT conversation is
attached to, remote submit the following statement:
%sysrput rhost=&sysscp;
%WINDOW Statement
Defines customized windows.
Type: Macro statement
Restriction: Allowed in macro definitions or open code
See: “%DISPLAY Statement” on page 307 and “%INPUT Statement” on page 320
Syntax
%WINDOW window-name
<window-option(s)
group-definition(s)>
field-definition(s);
Required Arguments
window-name
names the window. Window-name
must be a SAS name.
window-option(s)
specifies the characteristics of the window as a whole. Specify all window options
before any field or group definitions. These window options are available:
COLOR=
color
specifies the color of the window background. The default color of the window
and the contents of its fields are both device-dependent. Color can be one of
these:
BLACK
BLUE
BROWN
CYAN
GRAY (or GREY)
GREEN
MAGENTA
ORANGE
PINK
RED
WHITE
YELLOW
%WINDOW Statement 345
The representation of colors might vary, depending on the display device that
you use. In addition, on some display devices the background color affects
the entire window; on other display devices, it affects only the window
border.
COLUMNS=columns
specifies the number of display columns in the window, including borders. A
window can contain any number of columns and can extend beyond the border of
the display. This feature is useful when you need to display a window on a device
larger than the one on which you developed it. By default, the window fills all
remaining columns in the display.
Operating Environment Information
The number of columns available depends on the type of display device that
you use. Also, the left and right borders each use from 0 to 3 columns on the
display depending on your display device. If you create windows for display
on different types of display devices, ensure that all fields can be displayed in
the narrowest window.
ICOLUMN=column
specifies the initial column within the display at which the window is displayed.
By default, the macro processor begins the window at column 1 of the display.
IROW=
row
specifies the initial row (line) within the display at which the window is
displayed. By default, the macro processor begins the window at row 1 of the
display.
KEYS=<<
libref.>catalog.>keys-entry
specifies the name of a Keys catalog entry that contains the function key
definitions for the window. If you omit libref and catalog, SAS uses
SASUser.Profile.keys-entry.
If you omit the KEYS= option, SAS uses the current function key settings
defined in the KEYS window.
MENU=<<libref.>catalog.>pmenu-entry
specifies the name of a menu that you have built with the PMENU procedure. If
you omit libref and catalog, SAS uses SASUser.Profile.pmenu-entry.
ROWS=rows
specifies the number of rows in the window, including borders. A window can
contain any number of rows and can extend beyond the border of the display
device. This feature is useful when you need to display a window on a device
larger than the one on which you developed it. If you omit a number, the window
fills all remaining rows in the display device.
Operating Environment Information
The number of rows available depends on the type of display device that you
use.
group-definition
names a group and defines all fields within a group. The form of group definition is
GROUP=group field-definition <. . . field-definition-n> where group names a group
of fields that you want to display in the window collectively. A window can contain
any number of groups of fields. If you omit the GROUP= option, the window
contains one unnamed group of fields. Group must be a SAS name.
Organizing fields into groups enables you to create a single window with several
possible contents. To refer to a particular group, use window.group.
346 Chapter 19 Macro Statements
Operating Environment Information
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset