NAME
Read-SasMacroVariable
SYNOPSIS
Gets the content of a SAS macro variable.
SYNTAX
Read-SasMacroVariable [-Workspace] <PSObject>
[<CommonParameters>]
Read-SasMacroVariable [-Variable] <String>
[<CommonParameters>]
Read-SasMacroVariable [[-Resolve]
[<SwitchParameter>]] [<CommonParameters>]
DESCRIPTION
PARAMETERS
-Workspace <PSObject>
SAS.Workspace object
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Variable <String>
name of the macro variable
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Resolve [<SwitchParameter>]
Switch if the content of the macro variable
should be resolved.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters:
Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction,
WarningVariable,
OutBuffer and OutVariable. For more
information, see
about_CommonParameters
(http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
-------------- Example 1 --------------
PS C:\> Read-SasMacroVariable $ws "SYSUSERID"
reads the content of the &sysuserid. macro
variable
-------------- Example 2 --------------
PS C:\> $code = @"
%let x = 1;
%let x1 = 999;
data _null_;
call symput("mymacvar", '&&x&x');
run;
"@
Invoke-SasCode $ws $code
Read-SasMacroVariable $ws "mymacvar" -Resolve
submits sas code to create a macrovariable with
indirect content and resolve the marcovariable
content
-------------- Example 3 --------------
PS C:\> $code = @"
%let x = 1;
%let x1 = 999;
data _null_;
call symput("mymacvar", '&&x&x');
run;
"@
Invoke-SasCode $ws $code
Read-SasMacroVariable $ws "mymacvar"
submits sas code to create a macrovariable with
indirect content and get the unresolved
marcovariable content
RELATED LINKS