Menu

Invoke-SasCode

Andreas Menrath
NAME
    Invoke-SasCode

SYNOPSIS
    Executes the code in the specified SAS workspace 
    server session.

SYNTAX
    Invoke-SasCode [-Workspace] <PSObject> 
    [<CommonParameters>]

    Invoke-SasCode [-SasCode] <String> 
    [<CommonParameters>]

DESCRIPTION

PARAMETERS
    -Workspace <PSObject>
        SAS.Workspace object

        Required?                    true
        Position?                    0
        Default value                
        Accept pipeline input?       true (ByValue)
        Accept wildcard characters?  false

    -SasCode <String>
        SAS source code you want to execute

        Required?                    true
        Position?                    1
        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:\> Invoke-SasCode $ws "proc print 
    data=sashelp.class; run;"

    execute SAS code

    --------------  Example 2  --------------

    PS C:\> $code = @"
    data x;
      set sashelp.class;
    run;
    proc print data=x;
    run;
    "@

    Invoke-SasCode $ws $code

    Execute the sas code contained in string 
    variable $code

    --------------  Example 3  --------------

    PS C:\> $code = @"
    data x;
      set sashelp.class;
    run;
    proc print data=x;
    run;
    sysecho 'before long running step';
    data _null_;
      call sleep(3,1);
    run;
    sysecho 'long running step completed';
    "@

    $VerbosePreference = "SilentlyContinue"
    Invoke-SasCode $ws $code -Verbose

    Use -Verbose option to see details of the SAS 
    code execution

RELATED LINKS

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.