BookmarkSubscribeRSS Feed
Asbon
Obsidian | Level 7

Hi, 

below is from .ksh which is working fine.
how to use it in sas grid Please.

 

function fn_check_batch_load
{
  /sas/SASGMCU/sasgsub -stdio << SASEND
        * this expects to be called with the '-stdio' flag to redirect the output;
        proc sql;
            connect to oracle(user=&pcdsuser orapw=&pcdspw path='@pcds');
            CREATE TABLE pcrs_recent AS
            SELECT
                COMPARE("${SCRIPT_DATE}", max_end) AS comp_dat
            FROM    connection to oracle (
                SELECT    prcs_id,
                    TO_CHAR(MAX(end_ts), 'YYYYMMDD') max_end
                FROM    prcs_run
                WHERE    prcs_run_status_ref_cd = 'FNSH'
                AND    prcs_id = 14001
                GROUP BY prcs_id
                )
            ;
                disconnect from oracle;
        quit;

        * dump just the data we care about;
        data _null_;
            set pcrs_recent;
            file stdout;
            put comp_dat;
        run;
SASEND
} # function fn_check_batch_load

 

Thanks.

2 REPLIES 2
gwootton
SAS Super FREQ
The SASGSUB option to run interactively in -GRIDRUNSASLM, have you tried using this?

SASGSUB Command: Starting SAS in Interactive Mode
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/gridref/n17o2lfqlayjqvn1bseb11m822p5.htm
--
Greg Wootton | Principal Systems Technical Support Engineer
doug_sas
SAS Employee

While you could do a great deal of work to make SASGSUB with GRIDRUNSASLM work with -stdio, why are you not putting the code you want to execute in a file (like my-program.sas) and using that as the program to run?

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 258 views
  • 0 likes
  • 3 in conversation