03-25-2024
Asbon
Obsidian | Level 7
Member since
07-13-2023
- 23 Posts
- 6 Likes Given
- 1 Solutions
- 0 Likes Received
-
Latest posts by Asbon
Subject Views Posted 760 01-09-2024 08:40 PM 988 01-05-2024 06:03 AM 472 10-03-2023 09:11 AM 1096 09-13-2023 09:08 PM 1104 09-13-2023 09:06 PM 1162 09-13-2023 06:59 AM 1243 08-25-2023 04:54 AM 1245 08-25-2023 04:54 AM 1298 08-24-2023 12:24 PM 1376 08-18-2023 07:45 AM -
Activity Feed for Asbon
- Posted while sas code running in batch/Scheduler can we submit same sas code again on Administration and Deployment. 01-09-2024 08:40 PM
- Liked Re: %sysrput and &syserr for Kurt_Bremser. 01-09-2024 12:58 AM
- Posted %sysrput and &syserr on SAS Programming. 01-05-2024 06:03 AM
- Posted In Rubmit parallel processing can call sas code by uisng %include and status on SAS Programming. 10-03-2023 09:11 AM
- Posted Re: proc sql prallel processing unsing rsubmit on SAS Programming. 09-13-2023 09:08 PM
- Posted Re: proc sql prallel processing unsing rsubmit on SAS Programming. 09-13-2023 09:06 PM
- Posted proc sql prallel processing unsing rsubmit on SAS Programming. 09-13-2023 06:59 AM
- Liked Re: SQL equivalent of Merge by if a and not b for Kurt_Bremser. 09-08-2023 11:02 AM
- Posted Re: how to Include or Insert "%include path/aaa.sas" into a "abc.sas" file dynam on SAS Programming. 08-25-2023 04:54 AM
- Posted Re: how to Include or Insert "%include path/aaa.sas" into a "abc.sas" file dynam on SAS Programming. 08-25-2023 04:54 AM
- Posted how to Include or Insert "%include path/aaa.sas" into a "abc.sas" file dynamically on SAS Programming. 08-24-2023 12:24 PM
- Posted Re: how to get log in Gsub commands in sas on Administration and Deployment. 08-18-2023 07:45 AM
- Posted sas -stdio in GRID on Administration and Deployment. 08-18-2023 07:42 AM
- Posted Re: how to get log in Gsub commands in sas on Administration and Deployment. 08-10-2023 01:05 AM
- Posted how to get log in Gsub commands in sas on Administration and Deployment. 08-09-2023 03:37 AM
- Posted Re: update stats in database on Administration and Deployment. 08-01-2023 11:56 PM
- Posted Re: A lock is not available for mm_mv.dataset Lock held by process process id The SAS System stopped on Administration and Deployment. 08-01-2023 08:07 AM
- Posted update stats in database on Administration and Deployment. 08-01-2023 08:04 AM
- Liked Re: A lock is not available for mm_mv.dataset Lock held by process process id The SAS System stopped for SASKiwi. 07-26-2023 03:08 AM
- Posted Re: A lock is not available for mm_mv.dataset Lock held by process process id The SAS System stopped on Administration and Deployment. 07-25-2023 09:29 PM
-
Posts I Liked
Subject Likes Author Latest Post 5 4 1 2 1
01-09-2024
08:40 PM
Hi,
Below is SAS code, which is scheduled in Tivoli. it is scheduled for every 5 minutes (1 hour actual time). based on time, below code will trigger another codes by rsubmit.
eg:-at 20:15 this code is triggered in Tivoli where 2 rsubmit code are running(still in progress, it'll take 20 minutes to finish job)
At 20:20 Tivoli will trigger same sas code again, based on condition given in code, it should trigger another set of sas code as below.
is this scenario possiable by using Rsubmit. because this functionality is hapenning by call execute.
we want to convert it into rsubmit due to compliances.
%let date=%sysfunc(today(), yymmdd6.);
%let time=%sysfunc(time(), hhmm); %put &time;
data _null_;
/*time=scan(strip("&time."),1,':');*/
time=strip("&time.");
call symput('tm',strip(time));
call symput('week',strip(weekday(today())));
run ;
%put x&tm.z a&week.b;
%global x y;
%let x=Default;
%let y=Default;
filename donef '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_done';
filename mylog1 '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_a.log';
filename mylog2 '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_b.log';
%macro test;
data _null_;
%if &tm. = 20:15 or &tm.= 20:15 or &tm. = '20:15' %then %do;
options sascmd="sas";
SIGNON tes_a ;
RSUBMIT wait=no log=mylog1 ;
%let x=Success1;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_a.sas";
endrsubmit;
SIGNON tes_b ;
RSUBMIT wait=no log=mylog2 ;
%let x=Success1;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_b.sas";
endrsubmit;
signoff _all_;
%end;
%else %if &tm. = 20:20 or &tm.= 20:20 or &tm. = '20:20' %then %do;
options sascmd="sas";
SIGNON tes_c ;
RSUBMIT wait=no log=mylog3 ;
%let x=Success2;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_c.sas";
endrsubmit;
signoff tes_c;
%end;
run;
%mend test;
%test; %put a&x.z;
data _null_; file donef; run;
Help is appreciable.
Thanks,
Kenneth.
... View more
01-05-2024
06:03 AM
data _null_;
RSUBMIT wait=no log=mylog1 cmacvar=auths new;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/test/tes1.sas";
%SYSRPUT auths1=&syserr.;
endrsubmit;
waitfor _all_; signoff _all_;
%put &auths1.;
data _null_;
if &auths1. >4 then do; putlog 'ERROR occured during the execution of tes1.sas'; abort cancel; end;
run;
In above code, i;m trying capture &syserr value through %sysrput so that i can debug and stop if error occurs.
but, values through %SYSRPUT auths1=&syserr.; is different where if i give %put &syserr in tes1.sas code is different.
eg:-%put &syserr in tes1.sas code is 1024
%put &auths1. is 3 can some please helpin this, Help is appreciable.
Thanks,
kenneth.
... View more
10-03-2023
09:11 AM
Hi,
I'm having below code, but getting error by using % include statment for calling sas code, where i'm using status to get status of process. Help is appreciated.
options sascmd="sas";
signon Ora1; rsubmit Ora1 wait=no; %include '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/BT_Fraud_Model_Driver1/Ora1.sas' status=auths; %put &auths.; endrsubmit;
signon Ora2; rsubmit Ora2 wait=no; %include '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/BT_Fraud_Model_Driver1/Ora2.sas' status=trgrs; %put &trgrs.;
endrsubmit; waitfor _all_; signoff _all_;
data _null_; if ((&auths > 4) or (&trgrs > 4)) then do; if &auths > 4 then do; putlog 'ERROR occured during the execution of Ora1.sas'; abort cancel; end; if &trgrs > 4 then do; putlog 'ERROR occured during the execution of Ora2.sas'; abort cancel; end; end; run;
Error:-
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.
Thanks,
Kenneth.
... View more
09-13-2023
09:08 PM
below is the error that i'm getting. macro variables are not getting resolved. with in sql passthrough. if it one rsubmit it's working fine. NOTE: Remote submit to TASK1 commencing. 1 proc sql; 2 connect to oracle (user="&id" orapw="&pw" path="@path" 2 ! preserve_comments); WARNING: Apparent symbolic reference id not resolved. WARNING: Apparent symbolic reference pw not resolved. WARNING: Apparent symbolic reference id not resolved. WARNING: Apparent symbolic reference pw not resolved. ERROR: ORACLE connection error: ORA-01017: invalid username/password; logon denied. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
... View more
09-13-2023
09:06 PM
below is the error that i'm getting. macro variables are not getting resolved. with in sql passthrough. if it one rsubmit it's working fine. NOTE: Remote submit to TASK1 commencing. 1 proc sql; 2 connect to oracle (user="&id" orapw="&pw" path="@path" 2 ! preserve_comments); WARNING: Apparent symbolic reference id not resolved. WARNING: Apparent symbolic reference pw not resolved. WARNING: Apparent symbolic reference id not resolved. WARNING: Apparent symbolic reference pw not resolved. ERROR: ORACLE connection error: ORA-01017: invalid username/password; logon denied. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
... View more
09-13-2023
06:59 AM
Hi,
Need help with below coding.
can we connect oracle server using rsubmit miltiple time for prallel processing. or is there any code enhancement required
* Parallel Processing *;
options sascmd="sas";
* Prosess 1 *;
signon task1;
rsubmit task1 wait=no;
proc sql;
connect to oracle (user="&id" orapw="&pw" path="@path" preserve_comments);
create table aaa as
select * from connection to oracle
(SELECT * from abc);
disconnect from oracle;
quit;
endrsubmit;
* Prosess 2 *;
signon task2;
rsubmit task2 wait=no;
proc sql;
connect to oracle (user="&id" orapw="&pw" path="@path" preserve_comments);
create table bbb as
select * from connection to oracle
(select * fro xyz);
disconnect from oracle;
quit;
endrsubmit;
* Prosess 3 *;
signon task3;
rsubmit task3 wait=no;
proc sql;
connect to oracle (user="&id" orapw="&pw" path="@path" preserve_comments);
create table ccc as
select * from connection to oracle
(select * from www );
disconnect from oracle;
quit;
endrsubmit;
waitfor _all_;
signoff _all_;
help is appreciated.
Thanks.
... View more
08-25-2023
04:54 AM
it worked fine, Apreciate it. need one more help in same way after adding '%include "path/aaa.sas";' can we change 'USER="&userid" ORAPW="&pswd"' to "abcd=xyz" in same code it makes job compete. Thanks.
... View more
08-25-2023
04:54 AM
it worked fine, Apreciate it.
need one more help in same way after adding '%include "path/aaa.sas";'
can we change 'USER="&userid" ORAPW="&pswd"' to "abcd=xyz" in same code
it makes job compete.
Thanks.
... View more
08-24-2023
12:24 PM
Hi,
I'm having arround 50 sas codes. in which %include (%include path/aaa.sas) statment should be added at the beginning of the sas code, for all 50 sas codes.
can I have a macro to Insert % include statment into the sas codes.
apprectite help!
Thanks.
... View more
08-18-2023
07:45 AM
HI, Below worked fine. systask command "/sas/SASGMCU/sasgsub -GRIDSUBMITPGM /sasdata/path/CODE/sas_code.sas -gridsasopts ""(-altlog /sasdata/path/CODE/sas_code.log)""" taskname=sas_code1A status=auths; Thanks, Kenneth.
... View more
08-18-2023
07:42 AM
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.
... View more
08-10-2023
01:05 AM
By using below code: data a; set b; run; systask command "/sas/abcd/sasgsub -GRIDWAITRESULTS -GRIDSUBMITPGM /sasdata/path/CODE/sas_code.sas -GRIDRESULTSDIR /sasdata/path/LOG" taskname=Oracle1A status=auths; data c; set b; run; exicuting good, RC=0 but getting below error: (it's trying to copy to "/sasgrid/SASBASEP/config/Lev2/SASBaseApp/sas_code.log." which i didn't specify anywhere. > Grid job complete. > 889562 (sas_code) is Finished: Submitted: 10Aug2023:00:53:26, Started: 10Aug2023:00:53:30 on Host dpds1222a, Ended: 10Aug2023:00:53:31, RC:0 > Moving job information to "/sasdata/path/LOG/SASGSUB-2023-08-10_00.53.26.852_sas_code" > > Copying log and output to current directory. > Grid job return code is 0 (0x0) > ERROR: Insufficient authorization to access /sasgrid/SASBASEP/config/Lev2/SASBaseApp/sas_code.log. NOTE: LOG/Output from task "Oracle1A" is there a way:- -GRIDWAITRESULTS is copying folder (SASGSUB-2023-08-10_00.53.26.852_sas_code) which has code, log, Job info. Is there a way where it can copy only log. Folder & other details in folder not required. Thanks.
... View more
08-09-2023
03:37 AM
Hi, from below how can i get systask command log separately in different path(sas_code.sas) data a; set b; run; systask command "/sas/abcd/sasgsub -GRIDSUBMITPGM /sasdata/path/CODE/sas_code.sas" taskname=Oracle1A status=auths; data c; set b; run; Thanks, Kenneth.
... View more
08-01-2023
11:56 PM
below is complete log, only remove header part (from 1 to 86) to keep it short. 87 %macro ststs; 88 89 proc sql; 90 create table stats as 91 select owner, 2 The SAS System 23:44 Tuesday, August 1, 2023 92 table_name, 93 partition_name, 94 subpartition_name, 95 stattype_locked, 96 stale_stats /* YES or NO */ 97 from pcds.dba_tab_statistics 98 where table_name = 'ADDR_TLNBR_MAINT_EVENT_C'; 99 quit; 100 101 data stats_upd_ned; 102 set stats; 103 where upcase(trim(stale_stats))="YES"; 104 run; 105 106 proc sql noprint; 107 select count(*) into :cnt from stats_upd_ned; 108 quit; 109 110 %if &cnt le 0 %then 111 %do; 112 %put "No RECORDS AVAILABLE"; 113 %end; 114 %else 115 %do; 116 117 proc sql noprint; 118 select trim(OWNER), trim(TABLE_NAME),trim(PARTITION_NAME) 119 into 120 :_OWNER SEPARATED BY " ", 121 :_TABLE_NAME SEPARATED BY " ", 122 :_PARTITION_NAME SEPARATED BY " " 123 from stats_upd_ned 124 where trim(OWNER)='FMT_TRAN_DBA' and trim(TABLE_NAME) = 'ADDR_TLNBR_MAINT_EVENT_C'; 125 quit; 126 127 %put &_OWNER.; 128 %put &_TABLE_NAME.; 129 %put &_PARTITION_NAME.; 130 /* options symbolgen;*/ 131 132 %DO I=1 %TO &cnt; 133 134 proc sql; 135 connect to oracle (user="&pcdsuser" orapw="&pcdspw" path="@pcds"); 136 execute( BEGIN 137 DBMS_STATS.GATHER_TABLE_STATS 138 (OWNNAME =>('FMT_TRAN_DBA'), 139 TABNAME =>('ADDR_TLNBR_MAINT_EVENT_C'), 140 PARTNAME =>%TSLIT(&_PARTITION_NAME.), 141 GRANULARITY =>('PARTITION'), 142 CASCADE => TRUE, 143 estimate_percent =>DBMS_STATS.AUTO_SAMPLE_SIZE, 144 method_opt=>('FOR ALL COLUMNS SIZE AUTO'), 145 FORCE=>TRUE); 146 END; 147 ) by oracle; 148 disconnect from oracle; 149 quit; 3 The SAS System 23:44 Tuesday, August 1, 2023 150 151 %end; 152 %end; 153 %mend ststs; 154 155 %ststs; NOTE: Compressing data set WORK.STATS increased size by 100.00 percent. Compressed is 2 pages; un-compressed would require 1 pages. NOTE: Table WORK.STATS created, with 632 rows and 6 columns. NOTE: PROCEDURE SQL used (Total process time): real time 0.07 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds memory 5299.87k OS Memory 24228.00k Timestamp 08/01/2023 11:51:40 PM Step Count 16 Switch Count 3 Page Faults 0 Page Reclaims 503 Page Swaps 0 Voluntary Context Switches 50 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 NOTE: There were 1 observations read from the data set WORK.STATS. WHERE UPCASE(TRIM(stale_stats))='YES'; NOTE: The data set WORK.STATS_UPD_NED has 1 observations and 6 variables. NOTE: Compressing data set WORK.STATS_UPD_NED increased size by 100.00 percent. Compressed is 2 pages; un-compressed would require 1 pages. NOTE: DATA statement used (Total process time): real time 0.01 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 2567.87k OS Memory 21928.00k Timestamp 08/01/2023 11:51:40 PM Step Count 17 Switch Count 2 Page Faults 0 Page Reclaims 512 Page Swaps 0 Voluntary Context Switches 24 Involuntary Context Switches 7 Block Input Operations 0 Block Output Operations 0 NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 6202.56k OS Memory 26024.00k 4 The SAS System 23:44 Tuesday, August 1, 2023 Timestamp 08/01/2023 11:51:40 PM Step Count 18 Switch Count 0 Page Faults 0 Page Reclaims 248 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable CNT resolves to 1 NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 6211.96k OS Memory 26024.00k Timestamp 08/01/2023 11:51:40 PM Step Count 19 Switch Count 0 Page Faults 0 Page Reclaims 252 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable _OWNER resolves to FMT_TRAN_DBA FMT_TRAN_DBA SYMBOLGEN: Macro variable _TABLE_NAME resolves to ADDR_TLNBR_MAINT_EVENT_C ADDR_TLNBR_MAINT_EVENT_C SYMBOLGEN: Macro variable _PARTITION_NAME resolves to PTN_W20230730 PTN_W20230730 SYMBOLGEN: Macro variable CNT resolves to 1 SYMBOLGEN: Macro variable PCDSUSER resolves to aaaaaaaa SYMBOLGEN: Macro variable PCDSPW resolves to xxxxxxxx SYMBOLGEN: Macro variable _PARTITION_NAME resolves to PTN_W20230730 SYMBOLGEN: Macro variable VALUE resolves to PTN_W20230730 SYMBOLGEN: Macro variable VALUE resolves to PTN_W20230730 SYMBOLGEN: Macro variable S1 resolves to '" SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable S2 resolves to "' SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable V1 resolves to PTN_W20230730 SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable V2 resolves to "PTN_W20230730" SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable S2 resolves to "' SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable S1 resolves to '" SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. SYMBOLGEN: Macro variable V3 resolves to 'PTN_W20230730' SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. ERROR: ORACLE execute error: ORA-20000: Unable to analyze TABLE "FMT_TRAN_DBA"."ADDR_TLNBR_MAINT_EVENT_C" PTN_W20230730, insufficient privileges or does not existORA-06512: at "SYS.DBMS_STATS", line 24270ORA-06512: at "SYS.DBMS_STATS", line 24332ORA-06512: at line 1. 5 The SAS System 23:44 Tuesday, August 1, 2023 NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. NOTE: Statement not executed due to NOEXEC option. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 3.92 seconds user cpu time 0.01 seconds system cpu time 0.09 seconds memory 249.18k OS Memory 19872.00k Timestamp 08/01/2023 11:51:43 PM Step Count 20 Switch Count 0 Page Faults 0 Page Reclaims 43 Page Swaps 0 Voluntary Context Switches 45 Involuntary Context Switches 60 Block Input Operations 0 Block Output Operations 0 156 157 %LET _CLIENTTASKLABEL=; 158 %LET _CLIENTPROCESSFLOWNAME=; 159 %LET _CLIENTPROJECTPATH=; 160 %LET _CLIENTPROJECTPATHHOST=; 161 %LET _CLIENTPROJECTNAME=; 162 %LET _SASPROGRAMFILE=; 163 %LET _SASPROGRAMFILEHOST=; 164 165 ;*';*";*/;quit;run; 166 ODS _ALL_ CLOSE; 167 168 169 QUIT; RUN; 170
... View more
08-01-2023
08:07 AM
libname abc path/aaaa/bbb filelocks=none; above is removing existing file lock if any.
... View more