Data Invocacao Script: 2016/01/12 12:24:52 Data Processamento: 20151130 Nome do Component: CTBBESA Nome do Workflow: ETLDDMRCTB04_Teste_Parallel.sh Nome do Job: RPODSMENSAL Erro: a execução do job RPODSMENSAL abortou. 1 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.07 seconds cpu time 0.07 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 2 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_work2AD2000000F0_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.13 seconds user cpu time 0.05 seconds system cpu time 0.03 seconds Memory 362k Page Faults 0 Page Reclaims 446 Page Swaps 0 Voluntary Context Switches 100 Involuntary Context Switches 2 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_work2AD2000000F0_sxbasasd NOTE: AUTOEXEC processing completed. 1 /****************************************************************************** 2 * Job: RPODSMENSAL A50D7W6R.AQ0000UT * 3 * Description: * 4 * * 5 * Repository: me_besa A0000001.A50D7W6R * 6 * Server: besa A5NJAD6Z.AT000001 * 7 * * 8 * Source Tables: D_GLB_CARREGAMENTO - A5NJAD6Z.BJ00006K * 9 * GLBBESA.D_GLB_CARREGAMENTO * 10 * VPERIODOTEMPO - ODSBESA.VPERIODOTEMPO A5NJAD6Z.BJ0000AS * 11 * * 12 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 13 * Generated by: s-bametasasd1\dvbesa * 3 The SAS System 12:24 Tuesday, January 12, 2016 14 * Version: 9.1.20060626.51875 * 15 ******************************************************************************/ 16 17 /* Create metadata macro variables */ 18 %let IOMServer = %nrquote(besa); 19 %let metaPort = %nrquote(8561); 20 %let metaServer = %nrquote(s-bametasasd1); 21 %let metaRepository = %nrquote(me_besa); 22 23 /* Set metadata options */ 24 options metaport = &metaPort SYMBOLGEN: Macro variable METAPORT resolves to 8561 SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. 25 metaserver = "&metaServer" SYMBOLGEN: Macro variable METASERVER resolves to s-bametasasd1 SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. 26 metarepository = "&metaRepository"; SYMBOLGEN: Macro variable METAREPOSITORY resolves to me_besa SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. 27 28 %let jobID = %quote(A50D7W6R.AQ0000UT); 29 30 /* Setup to capture return codes */ 31 %global job_rc trans_rc sqlrc; 32 %let job_rc = 0; 33 %let trans_rc = 0; 34 %let sqlrc = 0; 35 %global syserr; 36 37 %macro rcSet(error); 38 %if (&error gt &trans_rc) %then 39 %let trans_rc = &error; 40 %if (&error gt &job_rc) %then 41 %let job_rc = &error; 42 %mend rcSet; 43 44 %macro rcSetDS(error); 45 if &error gt input(symget('trans_rc'),12.) then 46 call symput('trans_rc',trim(left(put(&error,12.)))); 47 if &error gt input(symget('job_rc'),12.) then 48 call symput('job_rc',trim(left(put(&error,12.)))); 49 %mend rcSetDS; 50 51 %global etls_debug; 52 %macro etls_setDebug; 53 %if %str(&etls_debug) ne 0 %then 54 OPTIONS MPRINT%str(;); 55 %mend; 56 %etls_setDebug; SYMBOLGEN: Macro variable ETLS_DEBUG resolves to 57 58 /*============================================================================* 59 * Step: SAS Extract A50D7W6R.AR00301U * 60 * Transform: Extract * 61 * Description: * 62 * * 63 * Source Table: VPERIODOTEMPO - ODSBESA.VPERIODOTEMPO A5NJAD6Z.BJ0000AS * 64 * Target Table: Extract Target - work.W5OVA7MB A50D7W6R.AY0032D5 * 4 The SAS System 12:24 Tuesday, January 12, 2016 65 *============================================================================*/ 66 67 /* Access the data for ODSBESA */ 68 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXX ; NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 69 %rcSet(&syslibrc); SYMBOLGEN: Macro variable SYSLIBRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 70 71 %let SYSLAST = %nrquote(ODSBESA.VPERIODOTEMPO); 72 73 %let transformID = %quote(A50D7W6R.AR00301U); 74 75 %let trans_rc = 0; 76 77 proc datasets lib = work nolist nowarn memtype = (data view); 78 delete W5OVA7MB; 79 quit; NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds Memory 46k Page Faults 0 Page Reclaims 36 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 80 81 proc sql; 82 create table work.W5OVA7MB as 83 select DTFIM length = 8 label = 'DTFIM' 84 from &SYSLAST SYMBOLGEN: Macro variable SYSLAST resolves to ODSBESA.VPERIODOTEMPO 85 where TPPER = "M" & DTFIM = &MT_DATACARREG; SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: Compression was disabled for data set WORK.W5OVA7MB because compression overhead would increase the size of the data set. NOTE: Table WORK.W5OVA7MB created, with 1 rows and 1 columns. 86 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.05 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 376k Page Faults 0 Page Reclaims 55 Page Swaps 0 5 The SAS System 12:24 Tuesday, January 12, 2016 Voluntary Context Switches 7 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 87 88 %let SYSLAST = work.W5OVA7MB; 89 90 %rcSet(&sqlrc); SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 91 92 /*============================================================================* 93 * Step: Apenas serve para alocar libname GLBBESA A50D7W6R.AR00301T * 94 * Transform: Extract * 95 * Description: * 96 * * 97 * Source Table: D_GLB_CARREGAMENTO - A5NJAD6Z.BJ00006K * 98 * GLBBESA.D_GLB_CARREGAMENTO * 99 * Target Table: Extract Target - work.W5OVA7IM A50D7W6R.AY0032D4 * 100 *============================================================================*/ 101 102 /* Access the data for GLBBESA */ 103 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXX ; NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 104 %rcSet(&syslibrc); SYMBOLGEN: Macro variable SYSLIBRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 105 106 %let SYSLAST = %nrquote(GLBBESA.D_GLB_CARREGAMENTO); 107 108 %let transformID = %quote(A50D7W6R.AR00301T); 109 110 %let trans_rc = 0; 111 112 proc datasets lib = work nolist nowarn memtype = (data view); 113 delete W5OVA7IM; 114 quit; NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 45k Page Faults 0 Page Reclaims 2 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 6 The SAS System 12:24 Tuesday, January 12, 2016 Block Input Operations 0 Block Output Operations 0 115 116 proc sql; 117 create table work.W5OVA7IM as 118 select IDENT length = 4 label = 'IDENT', 119 DTCARREG length = 8 label = 'DTCARREG', 120 DTCARREGANT length = 8 label = 'DTCARREGANT', 121 CDMESCARREGACT length = 6 label = 'CDMESCARREGACT', 122 CDMESCARREGANT length = 6 label = 'CDMESCARREGANT', 123 DTCARREGMAX length = 8 label = 'DTCARREGMAX' 124 from &SYSLAST; SYMBOLGEN: Macro variable SYSLAST resolves to GLBBESA.D_GLB_CARREGAMENTO NOTE: Table WORK.W5OVA7IM created, with 0 rows and 6 columns. 125 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 381k Page Faults 0 Page Reclaims 8 Page Swaps 0 Voluntary Context Switches 5 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 126 127 %let SYSLAST = work.W5OVA7IM; 128 129 %rcSet(&sqlrc); SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 130 131 /*============================================================================* 132 * Step: Apenas para alocar libname GLBBESA A50D7W6R.AR00301W * 133 * Transform: SQL Join (Version 2) * 134 * Description: * 135 * * 136 * Source Tables: Extract Target - work.W5OVA7IM A50D7W6R.AY0032D4 * 137 * Extract Target - work.W5OVA7MB A50D7W6R.AY0032D5 * 138 * Target Table: SQL Target - work.W5OVA3EJ A50D7W6R.AY0032D8 * 139 *============================================================================*/ 140 141 %let transformID = %quote(A50D7W6R.AR00301W); 142 143 %let trans_rc = 0; 144 145 proc datasets lib = work nolist nowarn memtype = (data view); 146 delete W5OVA3EJ; 7 The SAS System 12:24 Tuesday, January 12, 2016 147 quit; NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 45k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 148 149 proc sql; 150 create table work.W5OVA3EJ as 151 select 152 W5OVA7MB.DTFIM length = 8 153 format = DATETIME20. 154 informat = DATETIME20. 155 label = 'DTFIM' 156 from 157 work.W5OVA7MB left join 158 work.W5OVA7IM 159 on 160 ( 161 1 = 2 162 ) 163 ; NOTE: The execution of this query involves performing one or more Cartesian product joins that can not be optimized. NOTE: Compression was disabled for data set WORK.W5OVA3EJ because compression overhead would increase the size of the data set. NOTE: Table WORK.W5OVA3EJ created, with 1 rows and 1 columns. 164 quit; 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 469k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 165 SYMBOLGEN: Macro variable ERROR resolves to 0 166 %rcSet(&sqlrc); SYMBOLGEN: Macro variable JOB_RC resolves to 0 8 The SAS System 12:24 Tuesday, January 12, 2016 167 168 %macro etls_completeTarget(); 169 %mend etls_completeTarget; 170 %etls_completeTarget; 171 172 /*============================================================================* 173 * Step: SAS Splitter A50D7W6R.AR003020 * 174 * Transform: SAS Splitter * 175 * Description: * 176 * * 177 * Source Table: SQL Target - work.W5OVA3EJ A50D7W6R.AY0032D8 * 178 * Target Tables: Splitter Target 2 - work.W5PBC8BC A50D7W6R.AY0032DF * 179 * SAS Splitter - work.W68XKUHP A50D7W6R.AY0032D6 * 180 * SAS Splitter - work.W6A47T2D A50D7W6R.AY0032D9 * 181 * SAS Splitter - work.W6LMU3GK A50D7W6R.AY0032DB * 182 * SAS Splitter - work.W6M2B9BO A50D7W6R.AY0032DD * 183 * SAS Splitter - work.W6MR01OE A50D7W6R.AY0032DG * 184 * SAS Splitter - work.W6O48PLY A50D7W6R.AY0032NG * 185 *============================================================================*/ 186 187 %let SYSLAST = %nrquote(work.W5OVA3EJ); 188 189 %let transformID = %quote(A50D7W6R.AR003020); 190 191 %let trans_rc = 0; 192 193 proc datasets lib=work nolist nowarn memtype = (data view); 194 delete W5PBC8BC; 195 delete W68XKUHP; 196 delete W6A47T2D; 197 delete W6LMU3GK; 198 delete W6M2B9BO; 199 delete W6MR01OE; 200 delete W6O48PLY; 201 quit; NOTE: PROCEDURE DATASETS used (Total process time): real time 0.01 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 53k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 202 203 data work.W5PBC8BC 204 work.W68XKUHP 205 work.W6A47T2D 206 work.W6LMU3GK 207 work.W6M2B9BO 208 work.W6MR01OE 209 work.W6O48PLY; 9 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable SYSLAST resolves to WORK.W5OVA3EJ 210 set &SYSLAST; 211 output work.W5PBC8BC; 212 output work.W68XKUHP; 213 output work.W6A47T2D; 214 output work.W6LMU3GK; 215 output work.W6M2B9BO; 216 output work.W6MR01OE; 217 output work.W6O48PLY; 218 run; NOTE: Compression was disabled for data set WORK.W5PBC8BC because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W68XKUHP because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W6A47T2D because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W6LMU3GK because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W6M2B9BO because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W6MR01OE because compression overhead would increase the size of the data set. NOTE: Compression was disabled for data set WORK.W6O48PLY because compression overhead would increase the size of the data set. NOTE: There were 1 observations read from the data set WORK.W5OVA3EJ. NOTE: The data set WORK.W5PBC8BC has 1 observations and 1 variables. NOTE: The data set WORK.W68XKUHP has 1 observations and 1 variables. NOTE: The data set WORK.W6A47T2D has 1 observations and 1 variables. NOTE: The data set WORK.W6LMU3GK has 1 observations and 1 variables. NOTE: The data set WORK.W6M2B9BO has 1 observations and 1 variables. NOTE: The data set WORK.W6MR01OE has 1 observations and 1 variables. NOTE: The data set WORK.W6O48PLY has 1 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 679k Page Faults 0 Page Reclaims 119 Page Swaps 0 Voluntary Context Switches 14 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 10 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 219 SYMBOLGEN: Macro variable ERROR resolves to 0 220 %rcSet(&syserr); SYMBOLGEN: Macro variable JOB_RC resolves to 0 221 222 /*============================================================================* 223 * Step: Loop A50D7W6R.B6001AAW * 224 * Transform: Loop * 225 * Description: * 226 * * 227 * Source Table: SAS Splitter - work.W6LMU3GK A50D7W6R.AY0032DB * 228 * Target Table: Status Table - work.W6LMU3KG A50D7W6R.AY0032DC * 229 *============================================================================*/ 230 231 %let SYSLAST = %nrquote(work.W6LMU3GK); 10 The SAS System 12:24 Tuesday, January 12, 2016 232 233 %let transformID = %quote(A50D7W6R.B6001AAW); 234 235 %let trans_rc = 0; 236 237 %macro genSASCommand; 238 %local noobjserver; 239 %if "&sysscp"="OS" %then %let noobjserver=; 240 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 241 %else %let noobjserver=%quote(-noobjectserver); 242 options sascmd = "!sascmd &noobjserver"; 243 %mend genSASCommand; 244 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 245 246 %macro etls_tsLevel(macroName=, featureName=); 247 data _null_; 248 call symput("¯oName",tslvl("&featureName")); 249 run; 250 %mend etls_tsLevel; 251 252 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 253 gridRC=rc, useGrid=1, 254 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 255 log=, output=, additionalSignonOptions=, signonRetries=3); 256 257 %let etls_gridInstalled =; 258 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 259 260 %if (&useGrid = 1) %then 261 %do; 262 %if ("&etls_gridInstalled" ne "") %then 263 %do; 264 %if (&gridRC eq ) %then 265 %let gridRC = &handleName.RC ; 266 267 %global &gridRC; 268 %let workload = ; 269 %if (&workloadMacroVariable ne ) %then 270 %do; 271 data _null_; 272 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 273 run; 274 %end; 275 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 276 %end; 277 %else 278 %put %str(NOTE: Grid service functions are not installed.); 279 %end; 280 281 %local sleeptime sleepIncreaseAmount tryCount; 282 %let sleepIncreaseAmount=5; 283 %let sleeptime=5; 284 %let tryCount=1; 11 The SAS System 12:24 Tuesday, January 12, 2016 285 %let &cmacvar=1; 286 287 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 288 data _null_; 289 signon &handleName cmacvar=&cmacvar 290 %if ("&log" ne "") %then 291 log=&log; 292 %if ("&output" ne "") %then 293 output=&output; 294 %if ("&additionalSignonOptions" ne "") %then 295 &additionalSignonOptions; 296 ;run; 297 298 %if ("&machineIdMacroVariable" ne "") %then 299 %do; 300 %if ("&etls_gridInstalled" ne "") %then 301 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 302 %else 303 %put %str(NOTE: Grid service functions are not installed.); 304 %end; 305 306 %if "&&&cmacvar" eq "1" %then 307 %do; 308 %if &tryCount lt %eval(&signonRetries+1) %then 309 %do; 310 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 311 %let rc=%sysfunc(sleep(&sleeptime,1)); 312 %end; 313 %else %if &signonRetries gt 0 %then 314 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 315 316 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 317 %let tryCount=%eval(&tryCount+1); 318 %end; 319 %end; 320 %rcSet(&syserr); 321 322 %mend etls_signon; 323 324 %macro etls_serverConnected(serverId=,macvarname=isConnected); 325 %let &macvarname=0; 326 %local search_str none_str savenotes; 327 328 /* setup information for listtask output */ 329 /* listtask output on OS/390 differs */ 330 %if %bquote(&sysscp) eq OS %then 331 %do; 332 %let search_str=Remote submit for; 333 %let token=5; 334 %end; 335 %else 336 %do; 337 %let search_str=--------------; 338 %let token=1; 339 %end; 340 341 /* Issue listtask within PROC PRINTTO - send output to file */ 342 filename __tmptxt TEMP; 12 The SAS System 12:24 Tuesday, January 12, 2016 343 %let savenotes=%sysfunc(getoption(notes)); 344 options nonotes; 345 346 proc printto log=__tmptxt new; 347 run; 348 349 options notes; 350 listtask; 351 proc printto; 352 run; 353 354 options nonotes; 355 356 /* read in the output from listtask */ 357 %let dsname=_null_; 358 data _null_(keep=Session); 359 length line $256 sessionId $60; 360 infile __tmptxt length=len; 361 input @1 line $varying. len; 362 363 if line=:'There are no' then 364 stop; 365 /* look for the search string and scan for server name */ 366 if index(line,"&search_str") then 367 do; 368 sessionId=scan(line,&token," "); 369 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 370 if sessionId=upcase(symget("serverId")) then 371 do; 372 call symput("&macvarname","1"); 373 stop; 374 end; 375 end; 376 run; 377 filename __tmptxt clear; 378 options &savenotes; 379 %mend etls_serverConnected; 380 381 %macro etls_signoff(handleName=rmt); 382 %local savemprint; 383 %let savemprint=%sysfunc(getoption(mprint)); 384 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 385 options nomprint; 386 %local isConnected; 387 %etls_serverConnected(serverId=&handleName); 388 options &savemprint; 389 %if &isConnected %then 390 signoff &handleName ;; 391 %mend etls_signoff; 392 393 %macro etls_getHandle(statusTable=, handleVariable=, row=); 394 %let etls_dsid = %sysfunc(open(&statusTable)); 395 %if (&etls_dsid = 0) %then 396 %put %sysfunc(sysmsg()); 397 %else 398 %do; 399 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 400 %if (&rc ne 0) %then 13 The SAS System 12:24 Tuesday, January 12, 2016 401 %put %sysfunc(sysmsg()); 402 %else 403 %do; 404 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 405 %if (&etls_varnum > 0) %then 406 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 407 %else 408 %put %sysfunc(sysmsg()); 409 %end; 410 %let rc = %sysfunc(close(&etls_dsid)); 411 %end; 412 %mend etls_getHandle; 413 414 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 415 handleName=, statusSetting="Finished", 416 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 417 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 418 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 419 420 %if ("&statusTable" ne "") %then 421 %do; 422 %local etls_rcMacroVarExisted; 423 %let etls_rcMacroVarExisted = 0; 424 %if ("&returnCodeMacroVariable" ne "") %then 425 %do; 426 proc sql noprint; 427 select '1' into: etls_rcMacroVarExisted from dictionary.macros 428 where name=upcase("&returnCodeMacroVariable"); 429 quit; 430 431 %rcSet(&sqlrc); 432 %if (&etls_rcMacroVarExisted = 0) %then 433 %do; 434 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 435 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 436 %end; 437 %if (&setMainJobRC eq 1) %then 438 %rcSet(&&&returnCodeMacroVariable); 439 %end; 440 %else 441 %do; 442 %let returnCodeMacroVariable=etls_rcmacvar; 443 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 444 %end; 445 446 %local etls_startTimeMacroVarExisted; 447 %let etls_startTimeMacroVarExisted = 0; 448 %if ("&startTimeMacroVariable" ne "") %then 449 %do; 450 proc sql noprint; 451 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 452 where name=upcase("&startTimeMacroVariable"); 453 quit; 454 455 %rcSet(&sqlrc); 456 %if (&etls_startTimeMacroVarExisted = 0) %then 457 %do; 458 %put WARNING: Start time from inner job not found. No value will be set.; 14 The SAS System 12:24 Tuesday, January 12, 2016 459 %let &startTimeMacroVariable=; 460 %end; 461 %end; 462 463 %local etls_endTimeMacroVarExisted; 464 %let etls_endTimeMacroVarExisted = 0; 465 %if ("&endTimeMacroVariable" ne "") %then 466 %do; 467 proc sql noprint; 468 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 469 where name=upcase("&endTimeMacroVariable"); 470 quit; 471 472 %rcSet(&sqlrc); 473 %if (&etls_endTimeMacroVarExisted = 0) %then 474 %do; 475 %put WARNING: End time from inner job not found. Setting end time to current time.; 476 %let &endTimeMacroVariable=%sysfunc(datetime()); 477 %end; 478 %end; 479 480 data &statusTable; 481 modify &statusTable(where=(&handleVariable = &handleName)); 482 %if ("&startTimeMacroVariable" ne "") %then 483 %do; 484 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 485 %end; 486 %if ("&endTimeVariable" ne "") %then 487 %do; 488 %if ("&endTimeMacroVariable" ne "") %then 489 %do; 490 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 491 %end; 492 %else 493 &endTimeVariable = datetime();; 494 %end; 495 %if ("&returnCodeVariable" ne "") %then 496 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 497 %if ("&statusVariable" ne "") %then 498 %do; 499 if (symget("etls_rcMacroVarExisted") eq "0") then 500 &statusVariable = "Unknown Status"; 501 else 502 &statusVariable = &statusSetting; 503 %end; 504 call symput('handle',&handleVariable); 505 replace; 506 stop; 507 run; 508 509 %rcSet(&syserr); 510 511 %if (&signoff eq 1) %then 512 %etls_signoff(handleName=&handle); 513 %end; 514 %mend etls_freeHandle; 515 516 %macro etls_createHandle(statusTable=, statusVariable=, 15 The SAS System 12:24 Tuesday, January 12, 2016 517 handleVariable=, handlePrefix=rmt, 518 workloadMacroVariable=, row=, machineVariable=, 519 statusSetting="Running", startTimeVariable=startTime, 520 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 521 additionalSignonOptions=, signonRetries= ); 522 523 %local remoteSessionId; 524 %let remoteSessionId = &handlePrefix.&row; 525 %let &cmacvar = 1; 526 %local etls_machineId; 527 %if (&signon eq 1) %then 528 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 529 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 530 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 531 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 532 %else %let &cmacvar=0; 533 534 data &statusTable; 535 retain ptr &row; 536 modify &statusTable point = ptr; 537 &handleVariable = "&remoteSessionId"; 538 %if (&signon eq 1) %then 539 &machineVariable = "&etls_machineId";; 540 %if (&&&cmacvar ne 0) %then 541 %do; 542 &statusVariable = "Failed Signon"; 543 %end; 544 %else 545 &statusVariable = &statusSetting;; 546 %if (&startTimeVariable ne ) %then 547 &startTimeVariable = datetime();; 548 replace; 549 stop; 550 run; 551 552 %rcSet(&syserr); 553 %mend etls_createHandle; 554 555 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 556 completeStatusSetting="Finished", endTimeVariable=endTime, 557 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 558 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 559 560 proc sql noprint; 561 select count(*) into :etls_rows 562 from &statusTable where &statusVariable = &runningStatusSetting; 563 %let etls_rows = &etls_rows; 564 %if (&etls_rows gt 0) %then 565 %do; 566 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 567 from &statusTable where &statusVariable = &runningStatusSetting; 568 %end; 569 quit; 570 571 %rcSet(&sqlrc); 572 573 %if (&etls_rows gt 0) %then 574 %do; 16 The SAS System 12:24 Tuesday, January 12, 2016 575 waitfor &waitType 576 %do i=1 %to &etls_rows; 577 &&etlsHandles&i 578 %end; 579 ; 580 %end; 581 582 %local useDefaultRCMacVar; 583 %if ("&returnCodeMacroVariable" eq "") %then 584 %let useDefaultRCMacVar=Y; 585 586 %do i=1 %to &etls_rows; 587 588 %if ("&useDefaultRCMacVar"="Y") %then 589 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 590 591 waitfor &&etlsHandles&i timeout=1; 592 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 593 %do; 594 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 595 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 596 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 597 startTimeVariable=&startTimeVariable, signoff=&signoff, 598 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 599 statusUnknownReturnCode=&statusUnknownReturnCode, 600 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 601 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 602 %put NOTE: Process &&etlsHandles&i. has completed.; 603 %end; 604 %else %if (&SYSRC ne -1) %then /* process status unknown */ 605 %do; 606 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 607 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 608 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 609 startTimeVariable=&startTimeVariable, signoff=&signoff, 610 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 611 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 612 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 613 %end; 614 %end; 615 %mend etls_waitfor; 616 617 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 618 statusSetting="Running"); 619 620 proc sql noprint; 621 select count(*) into: &processCountMacro 622 from &statusTable where &statusVariable = &statusSetting; 623 quit; 624 625 %rcSet(&sqlrc); 626 %mend etls_getProcessesRunning; 627 628 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 629 %let ¶meterVariableMacro = ; 630 %let dsid = %sysfunc(open(¶meterTable)); 631 %if (&dsid gt 0) %then 632 %do; 17 The SAS System 12:24 Tuesday, January 12, 2016 633 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 634 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 635 %end; 636 %let dsid = %sysfunc(close(&dsid)); 637 %end; 638 %else 639 %put %sysfunc(sysmsg()); 640 %rcSet(&syserr); 641 %mend etls_getParameterNames; 642 643 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 644 data _null_; 645 length vname $256 vtype $1 value $3200; 646 dsid = open("¶meterTable"); 647 if (dsid > 0) then 648 do; 649 do _i = 1 to &row; 650 fetchrc = fetch(dsid); 651 end; 652 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 653 vname = varname(dsid,_i); 654 vtype = vartype(dsid,_i); 655 if (fetchrc = 0) then 656 do; 657 if (vtype = 'C') then 658 do; 659 value = getvarc(dsid,_i); 660 value = tranwrd(value,"%","%%"); 661 value = tranwrd(value,"(","%("); 662 value = tranwrd(value,")","%)"); 663 value = tranwrd(value,'"','%"'); 664 end; 665 else 666 value = left(put(getvarn(dsid,_i),best32.)); 667 end; /* fetchrc = 0 */ 668 669 put ; 670 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 671 do; 672 value='%str('||trim(value)||')'; 673 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 674 end; 675 %if %str(&handlename) ne %str() %then 676 %do; 677 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 678 %end; 679 %else 680 %do; 681 value = '%let '||trim(vname)||'= '||trim(value)||';'; 682 %end; 683 684 put "NOTE: Setting macro variable " vname "with statement:" value ; 685 call execute(value); 686 end; /* do i= */ 687 dsid = close(dsid); 688 end; /* dsid > 0 */ 689 else 690 do; 18 The SAS System 12:24 Tuesday, January 12, 2016 691 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 692 abort; 693 end; 694 stop; 695 run; 696 697 %rcSet(&syserr); 698 %mend etls_getParameters; 699 700 %macro etls_loopW6O7ZEQL; 701 %local etls_filePrefix; 702 %let etls_filePrefix = ; 703 704 %macro etls_processToLoopW6O7ZEQV(parameterTable=, row=, handleName=rmt); 705 %etls_getParameters(parameterTable=¶meterTable, row=&row, 706 startingColumnNumber=1, handleName=&handleName); 707 %let etls_previousFilePrefix = &etls_filePrefix; 708 %local etls_filePrefix; 709 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 710 %syslput &etls_controlName = &row / remote = &handleName; 711 %syslput handleName = &handleName / remote = &handleName; 712 713 /* Setup to pass macros to remote session */ 714 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 715 716 rsubmit &handleName wait = no sysrputsync = yes persist = no 717 log = "&etls_logOutputPath./&etls_filePrefix..log" 718 output = "&etls_logOutputPath./&etls_filePrefix..lst" 719 ; 720 721 %macro etls_jobW6O7ZER5; 722 723 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 724 725 /****************************************************************************** 726 * Job: RPODSDW143 A50D7W6R.AQ00109N * 727 * Description: * 728 * * 729 * Repository: me_besa A0000001.A50D7W6R * 730 * Server: besa A5NJAD6Z.AT000001 * 731 * * 732 * Source Tables: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 733 * TDIA - ODSBESA.TDIA A5NJAD6Z.BJ00008X * 734 * TCARTAO_MOVIMENTO - A5NJAD6Z.BJ000NXC * 735 * ODSBESA.TCARTAO_MOVIMENTO * 736 * TCARTAO - ODSBESA.TCARTAO A5NJAD6Z.BJ00008L * 737 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 738 * TBALCAO - ODSBESA.TBALCAO A5NJAD6Z.BJ00008G * 739 * Target Table: M_ODS_DW143 - GLBBESA.M_ODS_DW143 A5NJAD6Z.BJ000ZHT * 740 * * 741 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 742 * Generated by: s-bametasasd1\dvbesa * 743 * Version: 9.1.20060626.51875 * 744 ******************************************************************************/ 745 746 /* Create metadata macro variables */ 747 %let IOMServer = %nrquote(besa); 748 %let metaPort = %nrquote(8561); 19 The SAS System 12:24 Tuesday, January 12, 2016 749 %let metaServer = %nrquote(s-bametasasd1); 750 %let metaRepository = %nrquote(me_besa); 751 752 /* Set metadata options */ 753 options metaport = &metaPort 754 metaserver = "&metaServer" 755 metarepository = "&metaRepository"; 756 757 %let jobID = %quote(A50D7W6R.AQ00109N); 758 759 /* Setup to capture return codes */ 760 %global job_rc trans_rc sqlrc; 761 %let job_rc = 0; 762 %let trans_rc = 0; 763 %let sqlrc = 0; 764 %global syserr; 765 766 %macro rcSet(error); 767 %if (&error gt &trans_rc) %then 768 %let trans_rc = &error; 769 %if (&error gt &job_rc) %then 770 %let job_rc = &error; 771 %mend rcSet; 772 773 %macro rcSetDS(error); 774 if &error gt input(symget('trans_rc'),12.) then 775 call symput('trans_rc',trim(left(put(&error,12.)))); 776 if &error gt input(symget('job_rc'),12.) then 777 call symput('job_rc',trim(left(put(&error,12.)))); 778 %mend rcSetDS; 779 780 %global etls_debug; 781 %macro etls_setDebug; 782 %if %str(&etls_debug) ne 0 %then 783 OPTIONS MPRINT%str(;); 784 %mend; 785 %etls_setDebug; 786 787 %macro genSASCommand; 788 %local noobjserver; 789 %if "&sysscp"="OS" %then %let noobjserver=; 790 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 791 %else %let noobjserver=%quote(-noobjectserver); 792 options sascmd = "!sascmd &noobjserver"; 793 %mend genSASCommand; 794 %genSASCommand; 795 796 /****************************************************************************** 797 * Macro: * 798 * etls_tsLevel- Executes a data step using the tslvl function to * 799 * determine if a feature is installed. * 800 * * 801 * Parameters: * 802 * macroName- Name of macro to hold the value returned from the * 803 * function call, a blank value indicates the feature is not * 804 * installed. * 805 * featureName - Name of feature to test for installation status. * 806 ******************************************************************************/ 20 The SAS System 12:24 Tuesday, January 12, 2016 807 %macro etls_tsLevel(macroName=, featureName=); 808 data _null_; 809 call symput("¯oName",tslvl("&featureName")); 810 run; 811 %mend etls_tsLevel; 812 813 /****************************************************************************** 814 * Macro: * 815 * etls_signon - Executes a signon to a remote machine. * 816 * * 817 * Parameters: * 818 * handleName - Name of handle to access the remote connection. * 819 * cmacvar - Macro variable to capture the status of the signon. * 820 * gridRC- Macro variable to capture the return code of the grid * 821 * signon. * 822 * useGrid- A value of 1 will attempt to use a grid for the signon. * 823 * If the grid functions are not installed then a local signon * 824 * is performed. * 825 * machineIdMacroVariable- Name of macro variable to capture the name * 826 * of the machine used for a grid signon. * 827 * workloadMacroVariable- Name of macro variable that specifies the * 828 * workload to use for a grid signon. * 829 * log - Path to a log file for the signon. * 830 * output - Path to an output file for the signon. * 831 * additionalSignonOptions- Any additional options for the signon * 832 * statement. * 833 * signonRetries- Integer value of signons to try before quiting. * 834 * The wait between tries starts at 5 seconds, * 835 * increments by 5 seconds. * 836 ******************************************************************************/ 837 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 838 gridRC=rc, useGrid=1, 839 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 840 log=, output=, additionalSignonOptions=, signonRetries=3); 841 842 %let etls_gridInstalled =; 843 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 844 845 %if (&useGrid = 1) %then 846 %do; 847 %if ("&etls_gridInstalled" ne "") %then 848 %do; 849 %if (&gridRC eq ) %then 850 %let gridRC = &handleName.RC ; 851 852 %global &gridRC; 853 %let workload = ; 854 %if (&workloadMacroVariable ne ) %then 855 %do; 856 data _null_; 857 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 858 run; 859 %end; 860 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 861 %end; 862 %else 863 %put %str(NOTE: Grid service functions are not installed.); 864 %end; 21 The SAS System 12:24 Tuesday, January 12, 2016 865 866 %local sleeptime sleepIncreaseAmount tryCount; 867 %let sleepIncreaseAmount=5; 868 %let sleeptime=5; 869 %let tryCount=1; 870 %let &cmacvar=1; 871 872 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 873 data _null_; 874 signon &handleName cmacvar=&cmacvar 875 %if ("&log" ne "") %then 876 log=&log; 877 %if ("&output" ne "") %then 878 output=&output; 879 %if ("&additionalSignonOptions" ne "") %then 880 &additionalSignonOptions; 881 ;run; 882 883 %if ("&machineIdMacroVariable" ne "") %then 884 %do; 885 %if ("&etls_gridInstalled" ne "") %then 886 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 887 %else 888 %put %str(NOTE: Grid service functions are not installed.); 889 %end; 890 891 %if "&&&cmacvar" eq "1" %then 892 %do; 893 %if &tryCount lt %eval(&signonRetries+1) %then 894 %do; 895 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 896 %let rc=%sysfunc(sleep(&sleeptime,1)); 897 %end; 898 %else %if &signonRetries gt 0 %then 899 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 900 901 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 902 %let tryCount=%eval(&tryCount+1); 903 %end; 904 %end; 905 %rcSet(&syserr); 906 907 %mend etls_signon; 908 909 /****************************************************************************** 910 * Macro: * 911 * etls_serverConnected- Tests to see if a connection to a remote * 912 * exists. * 913 * * 914 * Parameters: * 915 * serverId - Handle to the remote to test. * 916 * macvarname- Name of macro variable to hold the return value of the * 917 * status. Will equal 1 if the connection exists, 0 * 918 * otherwise. Macro variable must be localized before * 919 * calling this macro. * 920 ******************************************************************************/ 921 %macro etls_serverConnected(serverId=,macvarname=isConnected); 922 %let &macvarname=0; 22 The SAS System 12:24 Tuesday, January 12, 2016 923 %local search_str none_str savenotes; 924 925 /* setup information for listtask output */ 926 /* listtask output on OS/390 differs */ 927 %if %bquote(&sysscp) eq OS %then 928 %do; 929 %let search_str=Remote submit for; 930 %let token=5; 931 %end; 932 %else 933 %do; 934 %let search_str=--------------; 935 %let token=1; 936 %end; 937 938 /* Issue listtask within PROC PRINTTO - send output to file */ 939 filename __tmptxt TEMP; 940 %let savenotes=%sysfunc(getoption(notes)); 941 options nonotes; 942 943 proc printto log=__tmptxt new; 944 run; 945 946 options notes; 947 listtask; 948 proc printto; 949 run; 950 951 options nonotes; 952 953 /* read in the output from listtask */ 954 %let dsname=_null_; 955 data _null_(keep=Session); 956 length line $256 sessionId $60; 957 infile __tmptxt length=len; 958 input @1 line $varying. len; 959 960 if line=:'There are no' then 961 stop; 962 /* look for the search string and scan for server name */ 963 if index(line,"&search_str") then 964 do; 965 sessionId=scan(line,&token," "); 966 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 967 if sessionId=upcase(symget("serverId")) then 968 do; 969 call symput("&macvarname","1"); 970 stop; 971 end; 972 end; 973 run; 974 filename __tmptxt clear; 975 options &savenotes; 976 %mend etls_serverConnected; 977 978 /****************************************************************************** 979 * Macro: * 980 * etls_signoff- Executes a signoff for a remote session, if a * 23 The SAS System 12:24 Tuesday, January 12, 2016 981 * connection still exists. * 982 * * 983 * Parameters: * 984 * handleName - Handle to remote session. * 985 ******************************************************************************/ 986 %macro etls_signoff(handleName=rmt); 987 %local savemprint; 988 %let savemprint=%sysfunc(getoption(mprint)); 989 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 990 options nomprint; 991 %local isConnected; 992 %etls_serverConnected(serverId=&handleName); 993 options &savemprint; 994 %if &isConnected %then 995 signoff &handleName ;; 996 %mend etls_signoff; 997 998 /****************************************************************************** 999 * Macro: * 1000 * etls_getHandle- Retrieves the handle for a remote connection from the * 1001 * status table. * 1002 * * 1003 * Parameters: * 1004 * statusTable - Table containing status information. * 1005 * handleVariable- Name of variable holding the handles to the remote * 1006 * connections. * 1007 * row - Row to retrieve the information from. * 1008 ******************************************************************************/ 1009 %macro etls_getHandle(statusTable=, handleVariable=, row=); 1010 %let etls_dsid = %sysfunc(open(&statusTable)); 1011 %if (&etls_dsid = 0) %then 1012 %put %sysfunc(sysmsg()); 1013 %else 1014 %do; 1015 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 1016 %if (&rc ne 0) %then 1017 %put %sysfunc(sysmsg()); 1018 %else 1019 %do; 1020 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 1021 %if (&etls_varnum > 0) %then 1022 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 1023 %else 1024 %put %sysfunc(sysmsg()); 1025 %end; 1026 %let rc = %sysfunc(close(&etls_dsid)); 1027 %end; 1028 %mend etls_getHandle; 1029 1030 /****************************************************************************** 1031 * Macro: * 1032 * etls_freeHandle- Update the status of a remote connection in the * 1033 * status table and optionally signoff the connection. * 1034 * Can update the ending time of the task if an end time * 1035 * is desired. * 1036 * * 1037 * Parameters: * 1038 * statusTable - Table containing status information. * 24 The SAS System 12:24 Tuesday, January 12, 2016 1039 * statusVariable- Variable in status table that holds the status of * 1040 * the connection. * 1041 * handleVariable- Variable in status table that holds the names of * 1042 * the connection handles. * 1043 * handleName - Name of handle to access the remote connection. * 1044 * statusSetting- Value to set the status variable to once the * 1045 * process is complete, value must be quoted if this is * 1046 * character variable. * 1047 * endTimeVariable- Variable that contains the end time for the * 1048 * processes in the status table. * 1049 * startTimeVariable- Variable that contains the start time for the * 1050 * processes in the status table. * 1051 * signoff- Indicates whether this macro should signoff the * 1052 * connection to a remote, a value of 1 indicates a signoff * 1053 * should be made. * 1054 * returnCodeVariable- Variable in the status table that contains the * 1055 * return code for the individual processes. * 1056 * returnCodeMacroVariable- Macro variable holding the value for the * 1057 * processes return code. * 1058 * setMainJobRC- Indicates whether this macro should update the main * 1059 * job_rc for the outer process. * 1060 * statusUnknownReturnCode- Numeric value to set the status to if the * 1061 * status of the process cannot be determined. * 1062 ******************************************************************************/ 1063 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 1064 handleName=, statusSetting="Finished", 1065 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 1066 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 1067 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 1068 1069 %if ("&statusTable" ne "") %then 1070 %do; 1071 %local etls_rcMacroVarExisted; 1072 %let etls_rcMacroVarExisted = 0; 1073 %if ("&returnCodeMacroVariable" ne "") %then 1074 %do; 1075 proc sql noprint; 1076 select '1' into: etls_rcMacroVarExisted from dictionary.macros 1077 where name=upcase("&returnCodeMacroVariable"); 1078 quit; 1079 1080 %rcSet(&sqlrc); 1081 %if (&etls_rcMacroVarExisted = 0) %then 1082 %do; 1083 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 1084 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 1085 %end; 1086 %if (&setMainJobRC eq 1) %then 1087 %rcSet(&&&returnCodeMacroVariable); 1088 %end; 1089 %else 1090 %do; 1091 %let returnCodeMacroVariable=etls_rcmacvar; 1092 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 1093 %end; 1094 1095 %local etls_startTimeMacroVarExisted; 1096 %let etls_startTimeMacroVarExisted = 0; 25 The SAS System 12:24 Tuesday, January 12, 2016 1097 %if ("&startTimeMacroVariable" ne "") %then 1098 %do; 1099 proc sql noprint; 1100 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 1101 where name=upcase("&startTimeMacroVariable"); 1102 quit; 1103 1104 %rcSet(&sqlrc); 1105 %if (&etls_startTimeMacroVarExisted = 0) %then 1106 %do; 1107 %put WARNING: Start time from inner job not found. No value will be set.; 1108 %let &startTimeMacroVariable=; 1109 %end; 1110 %end; 1111 1112 %local etls_endTimeMacroVarExisted; 1113 %let etls_endTimeMacroVarExisted = 0; 1114 %if ("&endTimeMacroVariable" ne "") %then 1115 %do; 1116 proc sql noprint; 1117 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 1118 where name=upcase("&endTimeMacroVariable"); 1119 quit; 1120 1121 %rcSet(&sqlrc); 1122 %if (&etls_endTimeMacroVarExisted = 0) %then 1123 %do; 1124 %put WARNING: End time from inner job not found. Setting end time to current time.; 1125 %let &endTimeMacroVariable=%sysfunc(datetime()); 1126 %end; 1127 %end; 1128 1129 data &statusTable; 1130 modify &statusTable(where=(&handleVariable = &handleName)); 1131 %if ("&startTimeMacroVariable" ne "") %then 1132 %do; 1133 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 1134 %end; 1135 %if ("&endTimeVariable" ne "") %then 1136 %do; 1137 %if ("&endTimeMacroVariable" ne "") %then 1138 %do; 1139 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 1140 %end; 1141 %else 1142 &endTimeVariable = datetime();; 1143 %end; 1144 %if ("&returnCodeVariable" ne "") %then 1145 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 1146 %if ("&statusVariable" ne "") %then 1147 %do; 1148 if (symget("etls_rcMacroVarExisted") eq "0") then 1149 &statusVariable = "Unknown Status"; 1150 else 1151 &statusVariable = &statusSetting; 1152 %end; 1153 call symput('handle',&handleVariable); 1154 replace; 26 The SAS System 12:24 Tuesday, January 12, 2016 1155 stop; 1156 run; 1157 1158 %rcSet(&syserr); 1159 1160 %if (&signoff eq 1) %then 1161 %etls_signoff(handleName=&handle); 1162 %end; 1163 %mend etls_freeHandle; 1164 1165 /****************************************************************************** 1166 * Macro: * 1167 * etls_createHandle- Creates a handle name for a connect session and * 1168 * optionally signon to the session. * 1169 * * 1170 * Parameters: * 1171 * statusTable - Table that holds status of connections. * 1172 * statusVariable- Variable in status table that holds the status of * 1173 * the connection. * 1174 * handleVariable- Variable in status table that holds the names of * 1175 * the connection handles. * 1176 * handlePrefix- Prefix for the names of the handles, a number will * 1177 * be appended representing the row number in the table. * 1178 * workloadMacroVariable - Specification for the grid workload option. * 1179 * row - Row number in the status table to update. * 1180 * machineVariable- Variable in status table holding the name of * 1181 * machine running the task. * 1182 * statusSetting- Value to set the status variable to once the handle * 1183 * connection is made, value must be quoted if this is * 1184 * character variable. * 1185 * signon - A value of 1 will execute the signon statement. * 1186 * useGrid - A value of 1 will attempt to use a grid for the signon. * 1187 * log - Path to a log file for the signon. * 1188 * output - Path to an output file for the signon. * 1189 * gridRC- Macro variable to capture the return code of the grid * 1190 * signon. * 1191 * cmacvar - Macro variable to capture the status of the signon. * 1192 * additionalSignonOptions- Any additional options for the signon * 1193 * statement. * 1194 * signonRetries- Integer value of signons to try before quiting. * 1195 * The wait between tries starts at 5 seconds, * 1196 * increments by 5 seconds. * 1197 ******************************************************************************/ 1198 %macro etls_createHandle(statusTable=, statusVariable=, 1199 handleVariable=, handlePrefix=rmt, 1200 workloadMacroVariable=, row=, machineVariable=, 1201 statusSetting="Running", startTimeVariable=startTime, 1202 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 1203 additionalSignonOptions=, signonRetries= ); 1204 1205 %local remoteSessionId; 1206 %let remoteSessionId = &handlePrefix.&row; 1207 %let &cmacvar = 1; 1208 %local etls_machineId; 1209 %if (&signon eq 1) %then 1210 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 1211 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 1212 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 27 The SAS System 12:24 Tuesday, January 12, 2016 1213 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 1214 %else %let &cmacvar=0; 1215 1216 data &statusTable; 1217 retain ptr &row; 1218 modify &statusTable point = ptr; 1219 &handleVariable = "&remoteSessionId"; 1220 %if (&signon eq 1) %then 1221 &machineVariable = "&etls_machineId";; 1222 %if (&&&cmacvar ne 0) %then 1223 %do; 1224 &statusVariable = "Failed Signon"; 1225 %end; 1226 %else 1227 &statusVariable = &statusSetting;; 1228 %if (&startTimeVariable ne ) %then 1229 &startTimeVariable = datetime();; 1230 replace; 1231 stop; 1232 run; 1233 1234 %rcSet(&syserr); 1235 %mend etls_createHandle; 1236 1237 /****************************************************************************** 1238 * Macro: * 1239 * etls_waitfor- Executes a waitfor statement based on the status * 1240 * setting of processes in the status table. Will * 1241 * optionally perform a etls_freeHandle call if the process * 1242 * has completed. * 1243 * * 1244 * Parameters: * 1245 * statusTable - Table containing status information. * 1246 * statusVariable- Variable in status table that holds the status of * 1247 * the connection. * 1248 * runningStatusSetting- Value that indicates that the process is * 1249 * running, value must be quoted if this is * 1250 * character variable. * 1251 * handleVariable- Variable in status table that holds the names of * 1252 * the connection handles. * 1253 * completeStatusSetting- Value to set the status variable to once * 1254 * the process is complete, value must be quoted * 1255 * if this is character variable. * 1256 * endTimeVariable- Variable that contains the end time for the * 1257 * processes in the status table. * 1258 * startTimeVariable- Variable that contains the start time for the * 1259 * processes in the status table. * 1260 * waitType- Type of waitfor to perform; valid values are , * 1261 * _ANY_, or _ALL_. * 1262 * signoff- Indicates whether this macro should signoff the * 1263 * connection to a remote, a value of 1 indicates a signoff * 1264 * should be made. * 1265 * returnCodeVariable- Variable in the status table that contains the * 1266 * return code for the individual processes. * 1267 * returnCodeMacroVariable- Macro variable holding the value for the * 1268 * processes return code. * 1269 * statusUnknownReturnCode- Numeric value to set the status to if the * 1270 * status of the process cannot be determined. * 28 The SAS System 12:24 Tuesday, January 12, 2016 1271 ******************************************************************************/ 1272 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 1273 completeStatusSetting="Finished", endTimeVariable=endTime, 1274 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 1275 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 1276 1277 proc sql noprint; 1278 select count(*) into :etls_rows 1279 from &statusTable where &statusVariable = &runningStatusSetting; 1280 %let etls_rows = &etls_rows; 1281 %if (&etls_rows gt 0) %then 1282 %do; 1283 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 1284 from &statusTable where &statusVariable = &runningStatusSetting; 1285 %end; 1286 quit; 1287 1288 %rcSet(&sqlrc); 1289 1290 %if (&etls_rows gt 0) %then 1291 %do; 1292 waitfor &waitType 1293 %do i=1 %to &etls_rows; 1294 &&etlsHandles&i 1295 %end; 1296 ; 1297 %end; 1298 1299 %local useDefaultRCMacVar; 1300 %if ("&returnCodeMacroVariable" eq "") %then 1301 %let useDefaultRCMacVar=Y; 1302 1303 %do i=1 %to &etls_rows; 1304 1305 %if ("&useDefaultRCMacVar"="Y") %then 1306 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 1307 1308 waitfor &&etlsHandles&i timeout=1; 1309 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 1310 %do; 1311 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 1312 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 1313 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 1314 startTimeVariable=&startTimeVariable, signoff=&signoff, 1315 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 1316 statusUnknownReturnCode=&statusUnknownReturnCode, 1317 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 1318 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 1319 %put NOTE: Process &&etlsHandles&i. has completed.; 1320 %end; 1321 %else %if (&SYSRC ne -1) %then /* process status unknown */ 1322 %do; 1323 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 1324 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 1325 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 1326 startTimeVariable=&startTimeVariable, signoff=&signoff, 1327 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 1328 statusUnknownReturnCode=&statusUnknownReturnCode, 29 The SAS System 12:24 Tuesday, January 12, 2016 1328 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 1329 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 1330 %end; 1331 %end; 1332 %mend etls_waitfor; 1333 1334 /****************************************************************************** 1335 * Macro: * 1336 * etls_getProcessesRunning- Gets the number of processes running by * 1337 * querying the status table. * 1338 * * 1339 * Parameters: * 1340 * statusTable - Table containing status information. * 1341 * statusVariable- Variable in status table that holds the status of * 1342 * the connection. * 1343 * processCountMacro- Macro variable to contain the value of the * 1344 * number of processes running. Macro variable must * 1345 * be localized before calling this macro. * 1346 * statusSetting- Value that indicates that the process is running, * 1347 * value must be quoted if this is character variable. * 1348 ******************************************************************************/ 1349 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 1350 statusSetting="Running"); 1351 1352 proc sql noprint; 1353 select count(*) into: &processCountMacro 1354 from &statusTable where &statusVariable = &statusSetting; 1355 quit; 1356 1357 %rcSet(&sqlrc); 1358 %mend etls_getProcessesRunning; 1359 1360 /*============================================================================* 1361 * Step: SAS Extract A50D7W6R.AR0030G7 * 1362 * Transform: Extract * 1363 * Description: * 1364 * * 1365 * Source Table: TDIA - ODSBESA.TDIA A5NJAD6Z.BJ00008X * 1366 * Target Table: Extract Target - work.W6EY42VT A50D7W6R.AY0032NL * 1367 *============================================================================*/ 1368 1369 /* Access the data for ODSBESA */ 1370 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 1370 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 1371 %rcSet(&syslibrc); 1372 1373 %let SYSLAST = %nrquote(ODSBESA.TDIA); 1374 1375 %let transformID = %quote(A50D7W6R.AR0030G7); 1376 1377 %let trans_rc = 0; 1378 1379 proc datasets lib = work nolist nowarn memtype = (data view); 1380 delete W6EY42VT; 1381 quit; 1382 1383 proc sql; 1384 create table work.W6EY42VT as 30 The SAS System 12:24 Tuesday, January 12, 2016 1385 select (DHMS(MDY(1,1,INPUT(CDANO,4.)),0,0,0)) as DTDIA length = 8 format = DATETIME20. informat = 1385 ! DATETIME20. 1386 from &SYSLAST 1387 where DTDIA = &Dataparam & INUTIL = 'Y'; 1388 quit; 1389 1390 %let SYSLAST = work.W6EY42VT; 1391 1392 %rcSet(&sqlrc); 1393 1394 /*============================================================================* 1395 * Step: SQL Join A50D7W6R.AR0030G8 * 1396 * Transform: SQL Join (Version 2) * 1397 * Description: * 1398 * * 1399 * Source Tables: Extract Target - work.W6EY42VT A50D7W6R.AY0032NL * 1400 * TCARTAO_MOVIMENTO - A5NJAD6Z.BJ000NXC * 1401 * ODSBESA.TCARTAO_MOVIMENTO * 1402 * Target Table: SQL Target - work.W6LMQ7O2 A50D7W6R.AY0032NM * 1403 *============================================================================*/ 1404 1405 %let transformID = %quote(A50D7W6R.AR0030G8); 1406 1407 %let trans_rc = 0; 1408 1409 proc datasets lib = work nolist nowarn memtype = (data view); 1410 delete W6LMQ7O2; 1411 quit; 1412 1413 proc sql; 1414 create view work.W6LMQ7O2 as 1415 select 1416 TCARTAO_MOVIMENTO.CDMOEDANUM_ORI length = 3 1417 format = $3. 1418 informat = $3. 1419 label = 'CDMOEDANUM_ORI', 1420 TCARTAO_MOVIMENTO.MTTRANS_AOA length = 8 1421 label = 'MTTRANS_AOA', 1422 TCARTAO_MOVIMENTO.NUCARTAO length = 16 1423 format = $16. 1424 informat = $16. 1425 label = 'NUCARTAO', 1426 TCARTAO_MOVIMENTO.CDPAISCOMERCIANTE length = 2 1427 format = $2. 1428 informat = $2. 1429 label = 'CDPAISCOMERCIANTE', 1430 TCARTAO_MOVIMENTO.CDMOVIMENTO length = 8 1431 label = 'CDMOVIMENTO' 1432 from 1433 ODSBESA.TCARTAO_MOVIMENTO, 1434 work.W6EY42VT 1435 where 1436 TCARTAO_MOVIMENTO.DTVALOR >= W6EY42VT.DTDIA 1437 and SUBSTR(TCARTAO_MOVIMENTO.NUCARTAO,1,6) IN ( '417981' , '417983' , '417984' , '417985') 1438 and TCARTAO_MOVIMENTO.NUCARTAO NOT LIKE '403209%' 1439 and TCARTAO_MOVIMENTO.CDPAISCOMERCIANTE NOT IS NULL 1440 and TCARTAO_MOVIMENTO.CDPAISCOMERCIANTE <> 'AO' 1441 ; 31 The SAS System 12:24 Tuesday, January 12, 2016 1442 quit; 1443 1444 %rcSet(&sqlrc); 1445 1446 /*============================================================================* 1447 * Step: SQL Join A50D7W6R.AR0030G9 * 1448 * Transform: SQL Join (Version 2) * 1449 * Description: * 1450 * * 1451 * Source Tables: SQL Target - work.W6LMQ7O2 A50D7W6R.AY0032NM * 1452 * TCARTAO - ODSBESA.TCARTAO A5NJAD6Z.BJ00008L * 1453 * Target Table: SQL Target - work.W6LMQG6D A50D7W6R.AY0032NN * 1454 *============================================================================*/ 1455 1456 %let transformID = %quote(A50D7W6R.AR0030G9); 1457 1458 %let trans_rc = 0; 1459 1460 proc datasets lib = work nolist nowarn memtype = (data view); 1461 delete W6LMQG6D; 1462 quit; 1463 1464 proc sql; 1465 create view work.W6LMQG6D as 1466 select 1467 W6LMQ7O2.NUCARTAO length = 16 1468 format = $16. 1469 informat = $16. 1470 label = 'NUCARTAO', 1471 W6LMQ7O2.CDPAISCOMERCIANTE length = 2 1472 format = $2. 1473 informat = $2. 1474 label = 'CDPAISCOMERCIANTE', 1475 W6LMQ7O2.CDMOVIMENTO length = 8 1476 label = 'CDMOVIMENTO', 1477 W6LMQ7O2.MTTRANS_AOA length = 8 1478 label = 'MTTRANS_AOA', 1479 W6LMQ7O2.CDMOEDANUM_ORI length = 3 1480 format = $3. 1481 informat = $3. 1482 label = 'CDMOEDANUM_ORI', 1483 TCARTAO.CDCONTRATO length = 16 1484 format = $16. 1485 informat = $16. 1486 label = 'CDCONTRATO', 1487 TCARTAO.CDCLIENTE length = 9 1488 format = $9. 1489 informat = $9. 1490 label = 'CDCLIENTE', 1491 COALESCE(TCARTAO.MTLCRED, 0) - COALESCE(TCARTAO.MTDIVIDA, 0) as MTDISPONIVEL length = 8 1492 label = 'MTLCRED' 1493 from 1494 work.W6LMQ7O2 left join 1495 ODSBESA.TCARTAO 1496 on 1497 ( 1498 W6LMQ7O2.NUCARTAO = TCARTAO.CDCARTAO 1499 and TCARTAO.DTCREATE = &Dataparam 32 The SAS System 12:24 Tuesday, January 12, 2016 1500 ) 1501 ; 1502 quit; 1503 1504 %rcSet(&sqlrc); 1505 1506 /*============================================================================* 1507 * Step: SQL Join A50D7W6R.AR0030GA * 1508 * Transform: SQL Join (Version 2) * 1509 * Description: * 1510 * * 1511 * Source Tables: SQL Target - work.W6LMQG6D A50D7W6R.AY0032NN * 1512 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 1513 * Target Table: SQL Target - work.W6LMQGFJ A50D7W6R.AY0032NO * 1514 *============================================================================*/ 1515 1516 %let transformID = %quote(A50D7W6R.AR0030GA); 1517 1518 %let trans_rc = 0; 1519 1520 proc datasets lib = work nolist nowarn memtype = (data view); 1521 delete W6LMQGFJ; 1522 quit; 1523 1524 proc sql; 1525 create view work.W6LMQGFJ as 1526 select 1527 W6LMQG6D.NUCARTAO length = 16 1528 format = $16. 1529 informat = $16. 1530 label = 'NUCARTAO', 1531 W6LMQG6D.CDPAISCOMERCIANTE length = 2 1532 format = $2. 1533 informat = $2. 1534 label = 'CDPAISCOMERCIANTE', 1535 W6LMQG6D.CDMOVIMENTO length = 8 1536 label = 'CDMOVIMENTO', 1537 W6LMQG6D.MTTRANS_AOA length = 8 1538 label = 'MTTRANS_AOA', 1539 W6LMQG6D.CDMOEDANUM_ORI length = 3 1540 format = $3. 1541 informat = $3. 1542 label = 'CDMOEDANUM_ORI', 1543 W6LMQG6D.CDCONTRATO length = 16 1544 format = $16. 1545 informat = $16. 1546 label = 'CDCONTRATO', 1547 W6LMQG6D.CDCLIENTE as CDCLIENTECARTAO length = 9 1548 format = $9. 1549 informat = $9. 1550 label = 'CDCLIENTECARTAO', 1551 W6LMQG6D.MTDISPONIVEL length = 8 1552 label = 'MTLCRED', 1553 TCONTRATO.CDBALCAO length = 3 1554 format = $3. 1555 informat = $3. 1556 label = 'CDBALCAO', 1557 TCONTRATO.CDCLIENTE length = 9 33 The SAS System 12:24 Tuesday, January 12, 2016 1558 format = $9. 1559 informat = $9. 1560 label = 'CDCLIENTE' 1561 from 1562 work.W6LMQG6D left join 1563 ODSBESA.TCONTRATO 1564 on 1565 ( 1566 TRIM(W6LMQG6D.CDCONTRATO) = TRIM(TCONTRATO.CDCONTRATO) 1567 and TCONTRATO.DTCHANGE <= &Dataparam 1568 and TCONTRATO.DTENDCHANGE >= &Dataparam 1569 ) 1570 ; 1571 quit; 1572 1573 %rcSet(&sqlrc); 1574 1575 /*============================================================================* 1576 * Step: SQL Join A50D7W6R.AR0030GB * 1577 * Transform: SQL Join (Version 2) * 1578 * Description: * 1579 * * 1580 * Source Tables: SQL Target - work.W6LMQGFJ A50D7W6R.AY0032NO * 1581 * TBALCAO - ODSBESA.TBALCAO A5NJAD6Z.BJ00008G * 1582 * Target Table: SQL Target - work.W6LMQGJO A50D7W6R.AY0032NP * 1583 *============================================================================*/ 1584 1585 %let transformID = %quote(A50D7W6R.AR0030GB); 1586 1587 %let trans_rc = 0; 1588 1589 proc datasets lib = work nolist nowarn memtype = (data view); 1590 delete W6LMQGJO; 1591 quit; 1592 1593 proc sql; 1594 create view work.W6LMQGJO as 1595 select 1596 W6LMQGFJ.NUCARTAO length = 16 1597 format = $16. 1598 informat = $16. 1599 label = 'NUCARTAO', 1600 W6LMQGFJ.CDPAISCOMERCIANTE length = 2 1601 format = $2. 1602 informat = $2. 1603 label = 'CDPAISCOMERCIANTE', 1604 W6LMQGFJ.CDMOVIMENTO length = 8 1605 label = 'CDMOVIMENTO', 1606 W6LMQGFJ.MTTRANS_AOA length = 8 1607 label = 'MTTRANS_AOA', 1608 W6LMQGFJ.CDMOEDANUM_ORI length = 3 1609 format = $3. 1610 informat = $3. 1611 label = 'CDMOEDANUM_ORI', 1612 W6LMQGFJ.CDCONTRATO length = 16 1613 format = $16. 1614 informat = $16. 1615 label = 'CDCONTRATO', 34 The SAS System 12:24 Tuesday, January 12, 2016 1616 W6LMQGFJ.CDCLIENTECARTAO length = 9 1617 format = $9. 1618 informat = $9. 1619 label = 'CDCLIENTECARTAO', 1620 W6LMQGFJ.MTDISPONIVEL length = 8 1621 label = 'MTLCRED', 1622 W6LMQGFJ.CDCLIENTE length = 9 1623 format = $9. 1624 informat = $9. 1625 label = 'CDCLIENTE', 1626 W6LMQGFJ.CDBALCAO length = 3 1627 format = $3. 1628 informat = $3. 1629 label = 'CDBALCAO', 1630 TBALCAO.LIBALCAO length = 80 1631 format = $80. 1632 informat = $80. 1633 label = 'LIBALCAO' 1634 from 1635 work.W6LMQGFJ left join 1636 ODSBESA.TBALCAO 1637 on 1638 ( 1639 TBALCAO.CDBALCAO = W6LMQGFJ.CDBALCAO 1640 ) 1641 ; 1642 quit; 1643 1644 %rcSet(&sqlrc); 1645 1646 /*============================================================================* 1647 * Step: SAS Extract A50D7W6R.AR0030G5 * 1648 * Transform: Extract * 1649 * Description: * 1650 * * 1651 * Source Table: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 1652 * Target Table: Extract Target - work.W6LMQ5IG A50D7W6R.AY0032NI * 1653 *============================================================================*/ 1654 1655 %let SYSLAST = %nrquote(ODSBESA.TCLIENTE); 1656 1657 %let transformID = %quote(A50D7W6R.AR0030G5); 1658 1659 %let trans_rc = 0; 1660 1661 proc datasets lib = work nolist nowarn memtype = (data view); 1662 delete W6LMQ5IG; 1663 quit; 1664 1665 proc sql; 1666 create table work.W6LMQ5IG as 1667 select IDENT length = 4 label = 'IDENT', 1668 CDCLIENTE length = 9 label = 'CDCLIENTE', 1669 LNCLIENTE length = 80 label = 'LNCLIENTE', 1670 DTCHANGE length = 8 label = 'DTCHANGE', 1671 DTENDCHANGE length = 8 label = 'DTENDCHANGE', 1672 DTABERTURA length = 8 label = 'DTABERTURA', 1673 CDTPCLIENTE length = 1 label = 'CDTPCLIENTE', 35 The SAS System 12:24 Tuesday, January 12, 2016 1674 CDNACIONALIDADE length = 3 label = 'CDNACIONALIDADE', 1675 CDPAISRESIDENCIA length = 3 label = 'CDPAISRESIDENCIA', 1676 CDTPDOCIDENT length = 2 label = 'CDTPDOCIDENT', 1677 NUDOCIDENT length = 20 label = 'NUDOCIDENT', 1678 CDSWIFT length = 12 label = 'CDSWIFT', 1679 CDSITCLIENTE length = 1 label = 'CDSITCLIENTE', 1680 CDCATEGCLIENTE length = 10 label = 'CDCATEGCLIENTE', 1681 CDCATEGRISCO length = 4 label = 'CDCATEGRISCO', 1682 CDCATEGDEVEDOR length = 10 label = 'CDCATEGDEVEDOR', 1683 CDCATEGEXPOS length = 20 label = 'CDCATEGEXPOS', 1684 CDPAISEXPOS length = 3 label = 'CDPAISEXPOS', 1685 CDPERFILRISCO length = 20 label = 'CDPERFILRISCO', 1686 CDCLASSIFCLIENTE length = 20 label = 'CDCLASSIFCLIENTE', 1687 CDGRUPOCLIENTE length = 10 label = 'CDGRUPOCLIENTE', 1688 CDGRUPOTAX length = 10 label = 'CDGRUPOTAX', 1689 CDGRUPOCOB length = 10 label = 'CDGRUPOCOB', 1690 CDGRUPOCLEAR length = 10 label = 'CDGRUPOCLEAR', 1691 FEMPREGADO length = 1 label = 'FEMPREGADO', 1692 CDFISCAL length = 40 label = 'CDFISCAL', 1693 CDNATJUR length = 2 label = 'CDNATJUR', 1694 INEMIGRANTE length = 1 label = 'INEMIGRANTE', 1695 INRESIDENTE length = 1 label = 'INRESIDENTE', 1696 CDSEGMENTOCLI length = 9 label = 'CDSEGMENTOCLI', 1697 CDSUBSEGCLI length = 9 label = 'CDSUBSEGCLI', 1698 CDCAE length = 6 label = 'CDCAE', 1699 CDSECTORINST length = 9 label = 'CDSECTORINST', 1700 CDSECTORNEG length = 9 label = 'CDSECTORNEG', 1701 CDGESTORCONTA length = 9 label = 'CDGESTORCONTA', 1702 CDBALCAO length = 3 label = 'CDBALCAO', 1703 CDBALCAOABERT length = 3 label = 'CDBALCAOABERT', 1704 LNMORADA length = 420 label = 'LNMORADA', 1705 INSEXO length = 1 label = 'INSEXO', 1706 DTNASCIMENTO length = 8 label = 'DTNASCIMENTO', 1707 LITELEFONE length = 10 label = 'LITELEFONE', 1708 CDTITACADEMICO length = 1 label = 'CDTITACADEMICO', 1709 CDESTADOCIVIL length = 1 label = 'CDESTADOCIVIL', 1710 QTFILHOS length = 8 label = 'QTFILHOS', 1711 DTCONSTITUICAO length = 8 label = 'DTCONSTITUICAO', 1712 CDSITFALENC length = 2 label = 'CDSITFALENC', 1713 DTFALENC length = 8 label = 'DTFALENC', 1714 FULTVERSAO length = 1 label = 'FULTVERSAO', 1715 DTUPDATE length = 8 label = 'DTUPDATE', 1716 CDGRUPOECO length = 10 label = 'CDGRUPOECO', 1717 CDPROVIN length = 3 label = 'CDPROVIN', 1718 CDENTGBES length = 10 label = 'CDENTGBES', 1719 CDRATING length = 10 label = 'CDRATING', 1720 CDCLASSERISCO length = 1 label = 'CDCLASSERISCO', 1721 CDGRUPOECONOMICO length = 8 label = 'CDGRUPOECONOMICO', 1722 LITELEFONE2 length = 20 label = 'LITELEFONE2', 1723 LITELEMOVEL length = 20 label = 'LITELEMOVEL', 1724 TEXTO_ADICIONAL length = 200 label = 'TEXTO_ADICIONAL' 1725 from &SYSLAST 1726 where &Dataparam between DTCHANGE and DTENDCHANGE; 1727 quit; 1728 1729 %let SYSLAST = work.W6LMQ5IG; 1730 1731 %rcSet(&sqlrc); 36 The SAS System 12:24 Tuesday, January 12, 2016 1732 1733 /*============================================================================* 1734 * Step: SAS Splitter A50D7W6R.AR0030G6 * 1735 * Transform: SAS Splitter * 1736 * Description: * 1737 * * 1738 * Source Table: Extract Target - work.W6LMQ5IG A50D7W6R.AY0032NI * 1739 * Target Tables: Splitter Target 1 - work.W6LMQ6BX A50D7W6R.AY0032NJ * 1740 * Splitter Target 2 - work.W6LMQ6C7 A50D7W6R.AY0032NK * 1741 *============================================================================*/ 1742 1743 %let SYSLAST = %nrquote(work.W6LMQ5IG); 1744 1745 %let transformID = %quote(A50D7W6R.AR0030G6); 1746 1747 %let trans_rc = 0; 1748 1749 proc datasets lib=work nolist nowarn memtype = (data view); 1750 delete W6LMQ6BX; 1751 delete W6LMQ6C7; 1752 quit; 1753 1754 data work.W6LMQ6BX 1755 work.W6LMQ6C7; 1756 set &SYSLAST; 1757 output work.W6LMQ6BX; 1758 output work.W6LMQ6C7; 1759 run; 1760 1761 %rcSet(&syserr); 1762 1763 /*============================================================================* 1764 * Step: SQL Join A50D7W6R.AR0030GC * 1765 * Transform: SQL Join (Version 2) * 1766 * Description: * 1767 * * 1768 * Source Tables: SQL Target - work.W6LMQGJO A50D7W6R.AY0032NP * 1769 * Splitter Target 1 - work.W6LMQ6BX A50D7W6R.AY0032NJ * 1770 * Target Table: SQL Target - work.W6LMQGMV A50D7W6R.AY0032NQ * 1771 *============================================================================*/ 1772 1773 %let transformID = %quote(A50D7W6R.AR0030GC); 1774 1775 %let trans_rc = 0; 1776 1777 proc datasets lib = work nolist nowarn memtype = (data view); 1778 delete W6LMQGMV; 1779 quit; 1780 1781 proc sql; 1782 create view work.W6LMQGMV as 1783 select 1784 W6LMQGJO.CDCLIENTE length = 9 1785 format = $9. 1786 informat = $9. 1787 label = 'CDCLIENTE', 1788 W6LMQGJO.NUCARTAO length = 16 1789 format = $16. 37 The SAS System 12:24 Tuesday, January 12, 2016 1790 informat = $16. 1791 label = 'NUCARTAO', 1792 W6LMQ6BX.LNCLIENTE as NOMETITULAR length = 80 1793 format = $80. 1794 informat = $80. 1795 label = 'LNCLIENTE', 1796 W6LMQGJO.CDMOVIMENTO length = 8 1797 label = 'CDMOVIMENTO', 1798 W6LMQGJO.MTTRANS_AOA length = 8 1799 label = 'MTTRANS_AOA', 1800 W6LMQGJO.CDBALCAO length = 3 1801 format = $3. 1802 informat = $3. 1803 label = 'CDBALCAO', 1804 W6LMQGJO.LIBALCAO length = 80 1805 format = $80. 1806 informat = $80. 1807 label = 'LIBALCAO', 1808 W6LMQGJO.MTDISPONIVEL length = 8 1809 label = 'MTLCRED', 1810 W6LMQGJO.CDPAISCOMERCIANTE length = 2 1811 format = $2. 1812 informat = $2. 1813 label = 'CDPAISCOMERCIANTE', 1814 W6LMQGJO.CDMOEDANUM_ORI length = 3 1815 format = $3. 1816 informat = $3. 1817 label = 'CDMOEDANUM_ORI' 1818 from 1819 work.W6LMQGJO left join 1820 work.W6LMQ6BX 1821 on 1822 ( 1823 TRIM(W6LMQGJO.CDCLIENTECARTAO) = TRIM(W6LMQ6BX.CDCLIENTE) 1824 ) 1825 ; 1826 quit; 1827 1828 %rcSet(&sqlrc); 1829 1830 /*============================================================================* 1831 * Step: SQL Join A50D7W6R.AR0030GD * 1832 * Transform: SQL Join (Version 2) * 1833 * Description: * 1834 * * 1835 * Source Tables: SQL Target - work.W6LMQGMV A50D7W6R.AY0032NQ * 1836 * Splitter Target 2 - work.W6LMQ6C7 A50D7W6R.AY0032NK * 1837 * Target Table: SQL Target - work.W6LMQGUO A50D7W6R.AY0032NR * 1838 *============================================================================*/ 1839 1840 %let transformID = %quote(A50D7W6R.AR0030GD); 1841 1842 %let trans_rc = 0; 1843 1844 proc datasets lib = work nolist nowarn memtype = (data view); 1845 delete W6LMQGUO; 1846 quit; 1847 38 The SAS System 12:24 Tuesday, January 12, 2016 1848 proc sql; 1849 create table work.W6LMQGUO as 1850 select 1851 W6LMQGMV.CDCLIENTE length = 9 1852 format = $9. 1853 informat = $9. 1854 label = 'CDCLIENTE', 1855 W6LMQ6C7.LNCLIENTE as NOMECLIENTE length = 80 1856 format = $80. 1857 informat = $80. 1858 label = 'LNCLIENTE', 1859 W6LMQGMV.NUCARTAO length = 16 1860 format = $16. 1861 informat = $16. 1862 label = 'NUCARTAO', 1863 W6LMQGMV.NOMETITULAR length = 80 1864 format = $80. 1865 informat = $80. 1866 label = 'LNCLIENTE', 1867 (SUM ( CASE WHEN W6LMQGMV.CDMOVIMENTO IN ( 30 , 32 ) THEN 1 WHEN W6LMQGMV.CDMOVIMENTO = 31 THEN -1 1867 ! ELSE 0 END * W6LMQGMV.MTTRANS_AOA )) as MTLEVANTAMENTOS length = 8 1868 label = 'MTTRANS_AOA', 1869 (SUM ( CASE WHEN W6LMQGMV.CDMOVIMENTO IN ( 40 , 42 , 80 ) THEN 1 WHEN W6LMQGMV.CDMOVIMENTO IN ( 41 , 1869 ! 43 ) THEN -1 ELSE 0 END * W6LMQGMV.MTTRANS_AOA )) as MTCOMPRAS length = 8, 1870 W6LMQGMV.CDBALCAO length = 3 1871 format = $3. 1872 informat = $3. 1873 label = 'CDBALCAO', 1874 W6LMQGMV.LIBALCAO length = 80 1875 format = $80. 1876 informat = $80. 1877 label = 'LIBALCAO', 1878 W6LMQGMV.MTDISPONIVEL length = 8 1879 label = 'MTLCRED', 1880 W6LMQGMV.CDPAISCOMERCIANTE length = 2 1881 format = $2. 1882 informat = $2. 1883 label = 'CDPAISCOMERCIANTE', 1884 W6LMQGMV.CDMOEDANUM_ORI length = 3 1885 format = $3. 1886 informat = $3. 1887 label = 'CDMOEDANUM_ORI' 1888 from 1889 work.W6LMQGMV left join 1890 work.W6LMQ6C7 1891 on 1892 ( 1893 TRIM(W6LMQ6C7.CDCLIENTE) = TRIM(W6LMQGMV.CDCLIENTE) 1894 ) 1895 group by 1896 W6LMQGMV.CDCLIENTE, 1897 W6LMQ6C7.LNCLIENTE, 1898 W6LMQGMV.NUCARTAO, 1899 W6LMQGMV.NOMETITULAR, 1900 W6LMQGMV.CDBALCAO, 1901 W6LMQGMV.LIBALCAO, 1902 W6LMQGMV.MTDISPONIVEL, 1903 W6LMQGMV.CDPAISCOMERCIANTE, 39 The SAS System 12:24 Tuesday, January 12, 2016 1904 W6LMQGMV.CDMOEDANUM_ORI 1905 ; 1906 quit; 1907 1908 %rcSet(&sqlrc); 1909 1910 %macro etls_completeTarget(); 1911 %mend etls_completeTarget; 1912 %etls_completeTarget; 1913 1914 /*============================================================================* 1915 * Step: SAS Extract A50D7W6R.AR0030GE * 1916 * Transform: Extract * 1917 * Description: * 1918 * * 1919 * Source Table: SQL Target - work.W6LMQGUO A50D7W6R.AY0032NR * 1920 * Target Table: Extract Target - work.W6LMSSS4 A50D7W6R.AY0032NS * 1921 *============================================================================*/ 1922 1923 %let SYSLAST = %nrquote(work.W6LMQGUO); 1924 1925 %let transformID = %quote(A50D7W6R.AR0030GE); 1926 1927 %let trans_rc = 0; 1928 1929 proc datasets lib = work nolist nowarn memtype = (data view); 1930 delete W6LMSSS4; 1931 quit; 1932 1933 proc sql; 1934 create view work.W6LMSSS4 as 1935 select CDCLIENTE length = 9 label = 'CDCLIENTE', 1936 NOMECLIENTE length = 80 label = 'LNCLIENTE', 1937 NUCARTAO length = 16 label = 'NUCARTAO', 1938 NOMETITULAR length = 80 label = 'LNCLIENTE', 1939 (SUM(MTLEVANTAMENTOS + MTCOMPRAS)) as MFACTURACAO length = 8, 1940 CDBALCAO length = 3 label = 'CDBALCAO', 1941 LIBALCAO length = 80 label = 'LIBALCAO', 1942 MTDISPONIVEL length = 8 label = 'MTLCRED' 1943 from &SYSLAST 1944 group by CDBALCAO, LIBALCAO, CDCLIENTE, NOMECLIENTE, NUCARTAO, 1945 NOMETITULAR, MTDISPONIVEL 1946 order by CDBALCAO, CDCLIENTE, NUCARTAO; 1947 quit; 1948 1949 %let SYSLAST = work.W6LMSSS4; 1950 1951 %rcSet(&sqlrc); 1952 1953 /*============================================================================* 1954 * Step: DEL_BY_DATE A50D7W6R.AR0030GF * 1955 * Transform: DEL_BY_DATE * 1956 * Description: * 1957 * * 1958 * Source Table: Extract Target - work.W6LMSSS4 A50D7W6R.AY0032NS * 1959 * Target Table: DEL_BY_DATE - work.W6LMTOIF A50D7W6R.AY0032NT * 1960 *============================================================================*/ 1961 40 The SAS System 12:24 Tuesday, January 12, 2016 1962 %let SYSLAST = %nrquote(work.W6LMSSS4); 1963 1964 %let transformID = %quote(A50D7W6R.AR0030GF); 1965 1966 %let trans_rc = 0; 1967 1968 /* Source table(s)/view(s) */ 1969 %let _INPUT1 = work.W6LMSSS4; 1970 1971 /* Target table/view(s) */ 1972 %let _OUTPUT = work.W6LMTOIF; 1973 %let _OUTPUT1 = work.W6LMTOIF; 1974 1975 /* Delete target table(s) */ 1976 proc datasets lib=work nolist nowarn memtype = (data view); 1977 delete W6LMTOIF; 1978 quit; 1979 1980 /* Options */ 1981 %let data_col = %nrquote(TO_CHAR%(DTPROC, %'YYYY-MM-DD%'%)); 1982 %let rel_table = %nrquote(GLBBESA.M_ODS_DW143); 1983 %let data_apagar = %nrquote(&Dataparam); 1984 1985 /* List of target columns to keep */ 1986 %let keep = CDCLIENTE NOMECLIENTE NUCARTAO NOMETITULAR MFACTURACAO 1987 CDBALCAO LIBALCAO MTDISPONIVEL; 1988 1989 %macro connect_oracle(schema); 1990 1991 connect to ORACLE 1992 ( 1993 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 1994 PATH = &ORACLE_CTB_SID 1995 USER = &ORACLE_CTB_USER 1996 PASSWORD = &ORACLE_CTB_PASSWORD 1997 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 1998 PATH = &ORACLE_DM_SID 1999 USER = &ORACLE_DM_USER 2000 PASSWORD = &ORACLE_DM_PASSWORD 2001 %END; 2002 ) 2003 2004 2005 %mend connect_oracle; 2006 2007 %macro tab_oracle(tabela); 2008 %let schema=%scan(&tabela,1); 2009 %IF %UPCASE(&schema) = GLBBESA 2010 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 2011 %ELSE %DO; &tabela %END; 2012 2013 2014 %mend tab_oracle; 2015 2016 2017 2018 2019 41 The SAS System 12:24 Tuesday, January 12, 2016 2020 /* Converte data DateTime em Data */ 2021 data _null_; 2022 format a Datetime.; 2023 a = &data_apagar; 2024 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 2025 run; 2026 2027 2028 2029 proc sql; 2030 %connect_oracle(%scan(&rel_table,1)); 2031 2032 execute( 2033 delete from %tab_oracle(&rel_table) 2034 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 2035 2036 disconnect from ORACLE; 2037 quit; 2038 2039 2040 proc sql; 2041 create view &_OUTPUT1 as 2042 select * 2043 from &_INPUT1; 2044 quit; 2045 2046 2047 2048 2049 2050 %rcSet(&syserr); 2051 %rcSet(&sysrc); 2052 %rcSet(&sqlrc); 2053 2054 /*============================================================================* 2055 * Step: Table Loader A50D7W6R.AR0030GG * 2056 * Transform: Table Loader (Version 2) * 2057 * Description: * 2058 * * 2059 * Source Table: DEL_BY_DATE - work.W6LMTOIF A50D7W6R.AY0032NT * 2060 * Target Table: M_ODS_DW143 - GLBBESA.M_ODS_DW143 A5NJAD6Z.BJ000ZHT * 2061 *============================================================================*/ 2062 2063 /* Access the data for GLBBESA */ 2064 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 2064 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 2065 %rcSet(&syslibrc); 2066 2067 %let SYSLAST = %nrquote(work.W6LMTOIF); 2068 2069 %let transformID = %quote(A50D7W6R.AR0030GG); 2070 2071 %let trans_rc = 0; 2072 2073 %global etls_tableExist; 2074 %global etls_numIndex; 2075 %global etls_lastTable; 2076 %let etls_tableExist = -1; 42 The SAS System 12:24 Tuesday, January 12, 2016 2077 %let etls_numIndex = -1; 2078 %let etls_lastTable = &SYSLAST; 2079 2080 /*---- Define load data macro ----*/ 2081 %macro etls_loader; 2082 2083 %let SYSOPT = ; 2084 2085 /*---- Map the columns ----*/ 2086 proc datasets lib = work nolist nowarn memtype = (data view); 2087 delete mapped; 2088 quit; 2089 2090 %put %str(NOTE: Mapping columns ...); 2091 proc sql; 2092 create view work.mapped as 2093 select (&Dataparam) as DTPROC length = 8 format = DATETIME20. informat = DATETIME20., 2094 CDBALCAO length = 3, 2095 LIBALCAO length = 80, 2096 CDCLIENTE length = 9, 2097 NOMECLIENTE length = 80, 2098 NUCARTAO length = 16, 2099 NOMETITULAR length = 80, 2100 MFACTURACAO as MTFACTURACAO length = 8, 2101 MTDISPONIVEL length = 8 2102 from &etls_lastTable; 2103 quit; 2104 2105 %let SYSLAST = work.mapped; 2106 2107 %let etls_lastTable = &SYSLAST; 2108 %let SYSOPT = ; 2109 2110 /* Determine if the target table exists */ 2111 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW143, DATA)) or 2112 %sysfunc(exist(GLBBESA.M_ODS_DW143, VIEW))); 2113 2114 /*---- Create a new table ----*/ 2115 %if (&etls_tableExist eq 0) %then 2116 %do; /* if table does not exist */ 2117 2118 %put %str(NOTE: Creating table ...); 2119 2120 data GLBBESA.M_ODS_DW143 2121 (dbnull = ( 2122 DTPROC = YES 2123 CDBALCAO = YES 2124 LIBALCAO = YES 2125 CDCLIENTE = YES 2126 NOMECLIENTE = YES 2127 NUCARTAO = YES 2128 NOMETITULAR = YES 2129 MTFACTURACAO = YES 2130 MTDISPONIVEL = YES)); 2131 attrib DTPROC length = 8 format = DATETIME20. informat = DATETIME20. 2132 label = 'DTPROC'; 2133 attrib CDBALCAO length = $3 format = $3. informat = $3. 2134 label = 'CDBALCAO'; 43 The SAS System 12:24 Tuesday, January 12, 2016 2135 attrib LIBALCAO length = $80 format = $80. informat = $80. 2136 label = 'LIBALCAO'; 2137 attrib CDCLIENTE length = $9 format = $9. informat = $9. 2138 label = 'CDCLIENTE'; 2139 attrib NOMECLIENTE length = $80 format = $80. informat = $80. 2140 label = 'NOMECLIENTE'; 2141 attrib NUCARTAO length = $16 format = $16. informat = $16. 2142 label = 'NUCARTAO'; 2143 attrib NOMETITULAR length = $80 format = $80. informat = $80. 2144 label = 'NOMETITULAR'; 2145 attrib MTFACTURACAO length = 8 2146 label = 'MTFACTURACAO'; 2147 attrib MTDISPONIVEL length = 8 2148 label = 'MTDISPONIVEL'; 2149 stop; 2150 run; 2151 2152 %rcSet(&syserr); 2153 2154 %end; /* if table does not exist */ 2155 2156 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 2157 2158 /*---- Append new data ----*/ 2159 %put %str(NOTE: Appending data ...); 2160 2161 proc append base = GLBBESA.M_ODS_DW143 2162 data = &etls_lastTable (&SYSOPT) force; 2163 run; 2164 2165 %rcSet(&syserr); 2166 2167 proc datasets lib = work nolist nowarn memtype = (data view); 2168 delete mapped; 2169 quit; 2170 2171 %mend etls_loader; 2172 %etls_loader; 2173 2174 %sysrput job_rc&handleName = &job_rc; 2175 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 2176 2177 %mend etls_jobW6O7ZER5; 2178 2179 %etls_jobW6O7ZER5; 2180 2181 endrsubmit; 2182 2183 %mend etls_processToLoopW6O7ZEQV; 2184 2185 %local etls_controlTable etls_statusTable etls_controlName 2186 etls_processesRunning etls_maxProcesses etls_parameterTable 2187 etls_additionalSignonOptions etls_signonRetries; 2188 %let etls_controlName = L43_; 2189 %let etls_statusTable = work.W6LMU3KG; 2190 %let etls_parameterTable = work.W6O7ZERB; 2191 %let etls_workload = ; 2192 %let etls_additionalSignonOptions = ; 44 The SAS System 12:24 Tuesday, January 12, 2016 2193 %let etls_signonRetries = 3; 2194 %let &etls_controlName = 0; 2195 %let etls_controlTable = work.W6LMU3GK; 2196 2197 %put %str(NOTE: Creating status table...); 2198 data &etls_statusTable 2199 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 2200 etls_status etls_jobRC DTFIM 2201 ); 2202 attrib etls_handleName length = $32 2203 label = 'Name of handle to remote session'; 2204 attrib etls_machineId length = $32 2205 label = 'Name of machine executing the task'; 2206 attrib etls_startTime length = 8 format = nldatmap. 2207 label = 'Start time of task'; 2208 attrib etls_endTime length = 8 format = nldatmap. 2209 label = 'End time of task'; 2210 attrib etls_status length = $32 2211 label = 'Current status of task'; 2212 attrib etls_jobRC length = 8 2213 label = 'Return code of task'; 2214 set &etls_controlTable; 2215 run; 2216 2217 %rcSet(&syserr); 2218 2219 %put %str(NOTE: Creating parameter table...); 2220 proc sql; 2221 create table &etls_parameterTable as 2222 select DTFIM as Dataparam 2223 from &etls_controlTable; 2224 quit; 2225 2226 %rcSet(&sqlrc); 2227 2228 /* Get the number of times to iterate from the number of rows in the source */ 2229 /* table */ 2230 proc sql noprint; 2231 select count(*) into :&etls_controlName._max from &etls_statusTable; 2232 %let &etls_controlName._max = &&&etls_controlName._max; 2233 quit; 2234 2235 %rcSet(&sqlrc); 2236 2237 %let etls_gridInstalled =; 2238 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 2239 2240 %if (%str(&etls_gridInstalled) ne %str()) %then 2241 %do; 2242 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 2243 %if (&etls_maxProcesses = 0) %then 2244 %do; 2245 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 2246 processes to SYSNCPU value.); 2247 %let etls_maxProcesses = &SYSNCPU; 2248 %end; 2249 %end; 2250 %else 45 The SAS System 12:24 Tuesday, January 12, 2016 2251 %do; 2252 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 2253 processes to SYSNCPU value.); 2254 %let etls_maxProcesses = &SYSNCPU; 2255 %end; 2256 2257 %if (&etls_maxProcesses > 0) %then 2258 %do; 2259 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 2260 2261 %let etls_lastLoopPtr = &&&etls_controlName; 2262 2263 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 2264 processCountMacro=etls_processesRunning, statusSetting="Running"); 2265 2266 %do %while(&etls_processesRunning lt &&&etls_controlName._max 2267 and &etls_processesRunning lt &etls_maxProcesses 2268 and &&&etls_controlName lt &&&etls_controlName._max); 2269 2270 %let &etls_controlName = %eval(&&&etls_controlName+1); 2271 2272 %global etls_signonStatus; 2273 %let etls_logOutputPath = &DIR_PRJ_LOG.; 2274 2275 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 2276 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 2277 row=&&&etls_controlName, machineVariable=etls_machineId, 2278 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 2279 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 2280 2281 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 2282 processCountMacro=etls_processesRunning, statusSetting="Running"); 2283 2284 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 2285 %etls_processToLoopW6O7ZEQV(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 2286 handleName=%etls_getHandle(statusTable=&etls_statusTable, 2287 handleVariable=etls_handleName, row=&&&etls_controlName)); 2288 %else 2289 %do; /* if signon error, set iterator to max to force loop to stop. */ 2290 %let &etls_controlName = &&&etls_controlName._max; 2291 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 2292 %end; 2293 %end; 2294 2295 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 2296 runningStatusSetting="Running", handleVariable=etls_handleName, 2297 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 2298 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 2299 returnCodeVariable=etls_jobRC, 2300 statusUnknownReturnCode=.); 2301 2302 %end; 2303 2304 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 2305 runningStatusSetting="Running", handleVariable=etls_handleName, 2306 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 2307 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 2308 returnCodeVariable=etls_jobRC, 46 The SAS System 12:24 Tuesday, January 12, 2016 2309 statusUnknownReturnCode=.); 2310 2311 %end; 2312 2313 proc datasets lib = work nolist nowarn memtype = (data view); 2314 delete W6O7ZERB; 2315 quit; 2316 2317 %mend etls_loopW6O7ZEQL; 2318 2319 %etls_loopW6O7ZEQL; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_LOOPW6O7ZEQL): data work.W6LMU3KG (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZEQL): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6LMU3GK MPRINT(ETLS_LOOPW6O7ZEQL): set work.W6LMU3GK; MPRINT(ETLS_LOOPW6O7ZEQL): run; NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W6LMU3GK. NOTE: The data set WORK.W6LMU3KG has 1 observations and 7 variables. NOTE: Compressing data set WORK.W6LMU3KG 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.05 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 4 Page Reclaims 9 Page Swaps 0 Voluntary Context Switches 12 Involuntary Context Switches 0 Block Input Operations 1 Block Output Operations 1 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZEQL): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZEQL): proc sql; 47 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZERB SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6LMU3GK MPRINT(ETLS_LOOPW6O7ZEQL): create table work.W6O7ZERB as select DTFIM as Dataparam from work.W6LMU3GK; NOTE: Compression was disabled for data set WORK.W6O7ZERB because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZERB created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZEQL): quit; 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 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZEQL): ; MPRINT(ETLS_LOOPW6O7ZEQL): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_LOOPW6O7ZEQL): select count(*) into :L43__max from work.W6LMU3KG; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZEQL): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZEQL): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled 48 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.04 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds Memory 330k Page Faults 4 Page Reclaims 23 Page Swaps 0 Voluntary Context Switches 8 Involuntary Context Switches 0 Block Input Operations 2 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZEQL): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6LMU3KG where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.03 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 227k Page Faults 13 Page Reclaims 5 Page Swaps 0 Voluntary Context Switches 14 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZEQL): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ 49 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable L43__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L43_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L43_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to 50 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable GRIDRC resolves to L43_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L43_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L43_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.11 seconds cpu time 0.07 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_work2E910000010E_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.13 seconds user cpu time 0.05 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 99 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_work2E910000010E_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L43_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.16 seconds user cpu time 0.01 seconds system cpu time 0.03 seconds Memory 223k Page Faults 92 Page Reclaims 36 Page Swaps 0 Voluntary Context Switches 106 Involuntary Context Switches 1 Block Input Operations 3 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_CREATEHANDLE): data work.W6LMU3KG; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_CREATEHANDLE): modify work.W6LMU3KG point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName 51 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L43_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L43_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W6LMU3KG has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.01 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 309k Page Faults 1 Page Reclaims 17 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZEQL): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6LMU3KG where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 52 The SAS System 12:24 Tuesday, January 12, 2016 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZEQL): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZERB SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZERB SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZERB MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZERB"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; 53 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L43_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZERB MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZERB, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable Dataparam with statement:%syslput Dataparam= 1764460800 / remote = L43_1; NOTE: DATA statement used (Total process time): real time 0.01 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 434k Page Faults 2 Page Reclaims 31 Page Swaps 0 Voluntary Context Switches 3 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZEQV): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L43_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 54 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L43_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L43_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZEQV): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L43_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L43_1.lst" ; 51 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: Background remote submit to L43_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6LMU3KG where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W6LMU3KG where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 65 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 NOTE: Remote signoff from L43_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1:01.98 user cpu time 36.01 seconds system cpu time 8.61 seconds Memory 193661k Page Faults 30 Page Reclaims 1823 Page Swaps 0 Voluntary Context Switches 15724 Involuntary Context Switches 2171 Block Input Operations 4 Block Output Operations 20 NOTE: Remote signoff from L43_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L43_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL43_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL43_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL43_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL43_1"); MPRINT(ETLS_FREEHANDLE): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 216k Page Faults 0 Page Reclaims 17 66 The SAS System 12:24 Tuesday, January 12, 2016 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL43_1 SYMBOLGEN: Macro variable JOB_RCL43_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L43_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L43_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L43_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L43_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L43_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L43_1"); MPRINT(ETLS_FREEHANDLE): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds 67 The SAS System 12:24 Tuesday, January 12, 2016 system cpu time 0.00 seconds Memory 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_FREEHANDLE): data work.W6LMU3KG; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L43_1" MPRINT(ETLS_FREEHANDLE): modify work.W6LMU3KG(where=(etls_handleName = "L43_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L43_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L43_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L43_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L43_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L43_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L43_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL43_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL43_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W6LMU3KG. WHERE etls_handleName='L43_1'; NOTE: The data set WORK.W6LMU3KG has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds 68 The SAS System 12:24 Tuesday, January 12, 2016 user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 5 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L43_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L43_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L43_1 NOTE: Process L43_1 has completed. MPRINT(ETLS_LOOPW6O7ZEQL): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43_ resolves to 1 SYMBOLGEN: && resolves to &. 69 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L43_ SYMBOLGEN: Macro variable L43__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6LMU3KG MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6LMU3KG SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6LMU3KG where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZEQL): ; MPRINT(ETLS_LOOPW6O7ZEQL): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZEQL): delete W6O7ZERB; MPRINT(ETLS_LOOPW6O7ZEQL): quit; NOTE: Deleting WORK.W6O7ZERB (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 1 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 2320 2321 /*============================================================================* 2322 * Step: Loop End A50D7W6R.B6001AAX * 2323 * Transform: Loop End * 70 The SAS System 12:24 Tuesday, January 12, 2016 2324 * Description: * 2325 *============================================================================*/ 2326 2327 /*============================================================================* 2328 * Step: Loop A50D7W6R.B6001AB1 * 2329 * Transform: Loop * 2330 * Description: * 2331 * * 2332 * Source Table: Splitter Target 2 - work.W5PBC8BC A50D7W6R.AY0032DF * 2333 * Target Table: Status Table - work.W5OV9ZCX A50D7W6R.AY0032DH * 2334 *============================================================================*/ 2335 2336 %let SYSLAST = %nrquote(work.W5PBC8BC); 2337 2338 %let transformID = %quote(A50D7W6R.B6001AB1); 2339 2340 %let trans_rc = 0; 2341 2342 %macro genSASCommand; 2343 %local noobjserver; 2344 %if "&sysscp"="OS" %then %let noobjserver=; 2345 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 2346 %else %let noobjserver=%quote(-noobjectserver); 2347 options sascmd = "!sascmd &noobjserver"; 2348 %mend genSASCommand; 2349 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 2350 2351 %macro etls_tsLevel(macroName=, featureName=); 2352 data _null_; 2353 call symput("¯oName",tslvl("&featureName")); 2354 run; 2355 %mend etls_tsLevel; 2356 2357 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 2358 gridRC=rc, useGrid=1, 2359 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 2360 log=, output=, additionalSignonOptions=, signonRetries=3); 2361 2362 %let etls_gridInstalled =; 2363 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 2364 2365 %if (&useGrid = 1) %then 2366 %do; 2367 %if ("&etls_gridInstalled" ne "") %then 2368 %do; 2369 %if (&gridRC eq ) %then 2370 %let gridRC = &handleName.RC ; 2371 2372 %global &gridRC; 2373 %let workload = ; 2374 %if (&workloadMacroVariable ne ) %then 2375 %do; 2376 data _null_; 71 The SAS System 12:24 Tuesday, January 12, 2016 2377 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 2378 run; 2379 %end; 2380 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 2381 %end; 2382 %else 2383 %put %str(NOTE: Grid service functions are not installed.); 2384 %end; 2385 2386 %local sleeptime sleepIncreaseAmount tryCount; 2387 %let sleepIncreaseAmount=5; 2388 %let sleeptime=5; 2389 %let tryCount=1; 2390 %let &cmacvar=1; 2391 2392 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 2393 data _null_; 2394 signon &handleName cmacvar=&cmacvar 2395 %if ("&log" ne "") %then 2396 log=&log; 2397 %if ("&output" ne "") %then 2398 output=&output; 2399 %if ("&additionalSignonOptions" ne "") %then 2400 &additionalSignonOptions; 2401 ;run; 2402 2403 %if ("&machineIdMacroVariable" ne "") %then 2404 %do; 2405 %if ("&etls_gridInstalled" ne "") %then 2406 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 2407 %else 2408 %put %str(NOTE: Grid service functions are not installed.); 2409 %end; 2410 2411 %if "&&&cmacvar" eq "1" %then 2412 %do; 2413 %if &tryCount lt %eval(&signonRetries+1) %then 2414 %do; 2415 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 2416 %let rc=%sysfunc(sleep(&sleeptime,1)); 2417 %end; 2418 %else %if &signonRetries gt 0 %then 2419 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 2420 2421 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 2422 %let tryCount=%eval(&tryCount+1); 2423 %end; 2424 %end; 2425 %rcSet(&syserr); 2426 2427 %mend etls_signon; 2428 2429 %macro etls_serverConnected(serverId=,macvarname=isConnected); 2430 %let &macvarname=0; 2431 %local search_str none_str savenotes; 2432 2433 /* setup information for listtask output */ 2434 /* listtask output on OS/390 differs */ 72 The SAS System 12:24 Tuesday, January 12, 2016 2435 %if %bquote(&sysscp) eq OS %then 2436 %do; 2437 %let search_str=Remote submit for; 2438 %let token=5; 2439 %end; 2440 %else 2441 %do; 2442 %let search_str=--------------; 2443 %let token=1; 2444 %end; 2445 2446 /* Issue listtask within PROC PRINTTO - send output to file */ 2447 filename __tmptxt TEMP; 2448 %let savenotes=%sysfunc(getoption(notes)); 2449 options nonotes; 2450 2451 proc printto log=__tmptxt new; 2452 run; 2453 2454 options notes; 2455 listtask; 2456 proc printto; 2457 run; 2458 2459 options nonotes; 2460 2461 /* read in the output from listtask */ 2462 %let dsname=_null_; 2463 data _null_(keep=Session); 2464 length line $256 sessionId $60; 2465 infile __tmptxt length=len; 2466 input @1 line $varying. len; 2467 2468 if line=:'There are no' then 2469 stop; 2470 /* look for the search string and scan for server name */ 2471 if index(line,"&search_str") then 2472 do; 2473 sessionId=scan(line,&token," "); 2474 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 2475 if sessionId=upcase(symget("serverId")) then 2476 do; 2477 call symput("&macvarname","1"); 2478 stop; 2479 end; 2480 end; 2481 run; 2482 filename __tmptxt clear; 2483 options &savenotes; 2484 %mend etls_serverConnected; 2485 2486 %macro etls_signoff(handleName=rmt); 2487 %local savemprint; 2488 %let savemprint=%sysfunc(getoption(mprint)); 2489 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 2490 options nomprint; 2491 %local isConnected; 2492 %etls_serverConnected(serverId=&handleName); 73 The SAS System 12:24 Tuesday, January 12, 2016 2493 options &savemprint; 2494 %if &isConnected %then 2495 signoff &handleName ;; 2496 %mend etls_signoff; 2497 2498 %macro etls_getHandle(statusTable=, handleVariable=, row=); 2499 %let etls_dsid = %sysfunc(open(&statusTable)); 2500 %if (&etls_dsid = 0) %then 2501 %put %sysfunc(sysmsg()); 2502 %else 2503 %do; 2504 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 2505 %if (&rc ne 0) %then 2506 %put %sysfunc(sysmsg()); 2507 %else 2508 %do; 2509 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 2510 %if (&etls_varnum > 0) %then 2511 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 2512 %else 2513 %put %sysfunc(sysmsg()); 2514 %end; 2515 %let rc = %sysfunc(close(&etls_dsid)); 2516 %end; 2517 %mend etls_getHandle; 2518 2519 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 2520 handleName=, statusSetting="Finished", 2521 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 2522 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 2523 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 2524 2525 %if ("&statusTable" ne "") %then 2526 %do; 2527 %local etls_rcMacroVarExisted; 2528 %let etls_rcMacroVarExisted = 0; 2529 %if ("&returnCodeMacroVariable" ne "") %then 2530 %do; 2531 proc sql noprint; 2532 select '1' into: etls_rcMacroVarExisted from dictionary.macros 2533 where name=upcase("&returnCodeMacroVariable"); 2534 quit; 2535 2536 %rcSet(&sqlrc); 2537 %if (&etls_rcMacroVarExisted = 0) %then 2538 %do; 2539 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 2540 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 2541 %end; 2542 %if (&setMainJobRC eq 1) %then 2543 %rcSet(&&&returnCodeMacroVariable); 2544 %end; 2545 %else 2546 %do; 2547 %let returnCodeMacroVariable=etls_rcmacvar; 2548 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 2549 %end; 2550 74 The SAS System 12:24 Tuesday, January 12, 2016 2551 %local etls_startTimeMacroVarExisted; 2552 %let etls_startTimeMacroVarExisted = 0; 2553 %if ("&startTimeMacroVariable" ne "") %then 2554 %do; 2555 proc sql noprint; 2556 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 2557 where name=upcase("&startTimeMacroVariable"); 2558 quit; 2559 2560 %rcSet(&sqlrc); 2561 %if (&etls_startTimeMacroVarExisted = 0) %then 2562 %do; 2563 %put WARNING: Start time from inner job not found. No value will be set.; 2564 %let &startTimeMacroVariable=; 2565 %end; 2566 %end; 2567 2568 %local etls_endTimeMacroVarExisted; 2569 %let etls_endTimeMacroVarExisted = 0; 2570 %if ("&endTimeMacroVariable" ne "") %then 2571 %do; 2572 proc sql noprint; 2573 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 2574 where name=upcase("&endTimeMacroVariable"); 2575 quit; 2576 2577 %rcSet(&sqlrc); 2578 %if (&etls_endTimeMacroVarExisted = 0) %then 2579 %do; 2580 %put WARNING: End time from inner job not found. Setting end time to current time.; 2581 %let &endTimeMacroVariable=%sysfunc(datetime()); 2582 %end; 2583 %end; 2584 2585 data &statusTable; 2586 modify &statusTable(where=(&handleVariable = &handleName)); 2587 %if ("&startTimeMacroVariable" ne "") %then 2588 %do; 2589 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 2590 %end; 2591 %if ("&endTimeVariable" ne "") %then 2592 %do; 2593 %if ("&endTimeMacroVariable" ne "") %then 2594 %do; 2595 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 2596 %end; 2597 %else 2598 &endTimeVariable = datetime();; 2599 %end; 2600 %if ("&returnCodeVariable" ne "") %then 2601 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 2602 %if ("&statusVariable" ne "") %then 2603 %do; 2604 if (symget("etls_rcMacroVarExisted") eq "0") then 2605 &statusVariable = "Unknown Status"; 2606 else 2607 &statusVariable = &statusSetting; 2608 %end; 75 The SAS System 12:24 Tuesday, January 12, 2016 2609 call symput('handle',&handleVariable); 2610 replace; 2611 stop; 2612 run; 2613 2614 %rcSet(&syserr); 2615 2616 %if (&signoff eq 1) %then 2617 %etls_signoff(handleName=&handle); 2618 %end; 2619 %mend etls_freeHandle; 2620 2621 %macro etls_createHandle(statusTable=, statusVariable=, 2622 handleVariable=, handlePrefix=rmt, 2623 workloadMacroVariable=, row=, machineVariable=, 2624 statusSetting="Running", startTimeVariable=startTime, 2625 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 2626 additionalSignonOptions=, signonRetries= ); 2627 2628 %local remoteSessionId; 2629 %let remoteSessionId = &handlePrefix.&row; 2630 %let &cmacvar = 1; 2631 %local etls_machineId; 2632 %if (&signon eq 1) %then 2633 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 2634 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 2635 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 2636 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 2637 %else %let &cmacvar=0; 2638 2639 data &statusTable; 2640 retain ptr &row; 2641 modify &statusTable point = ptr; 2642 &handleVariable = "&remoteSessionId"; 2643 %if (&signon eq 1) %then 2644 &machineVariable = "&etls_machineId";; 2645 %if (&&&cmacvar ne 0) %then 2646 %do; 2647 &statusVariable = "Failed Signon"; 2648 %end; 2649 %else 2650 &statusVariable = &statusSetting;; 2651 %if (&startTimeVariable ne ) %then 2652 &startTimeVariable = datetime();; 2653 replace; 2654 stop; 2655 run; 2656 2657 %rcSet(&syserr); 2658 %mend etls_createHandle; 2659 2660 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 2661 completeStatusSetting="Finished", endTimeVariable=endTime, 2662 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 2663 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 2664 2665 proc sql noprint; 2666 select count(*) into :etls_rows 76 The SAS System 12:24 Tuesday, January 12, 2016 2667 from &statusTable where &statusVariable = &runningStatusSetting; 2668 %let etls_rows = &etls_rows; 2669 %if (&etls_rows gt 0) %then 2670 %do; 2671 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 2672 from &statusTable where &statusVariable = &runningStatusSetting; 2673 %end; 2674 quit; 2675 2676 %rcSet(&sqlrc); 2677 2678 %if (&etls_rows gt 0) %then 2679 %do; 2680 waitfor &waitType 2681 %do i=1 %to &etls_rows; 2682 &&etlsHandles&i 2683 %end; 2684 ; 2685 %end; 2686 2687 %local useDefaultRCMacVar; 2688 %if ("&returnCodeMacroVariable" eq "") %then 2689 %let useDefaultRCMacVar=Y; 2690 2691 %do i=1 %to &etls_rows; 2692 2693 %if ("&useDefaultRCMacVar"="Y") %then 2694 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 2695 2696 waitfor &&etlsHandles&i timeout=1; 2697 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 2698 %do; 2699 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 2700 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 2701 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 2702 startTimeVariable=&startTimeVariable, signoff=&signoff, 2703 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 2704 statusUnknownReturnCode=&statusUnknownReturnCode, 2705 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 2706 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 2707 %put NOTE: Process &&etlsHandles&i. has completed.; 2708 %end; 2709 %else %if (&SYSRC ne -1) %then /* process status unknown */ 2710 %do; 2711 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 2712 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 2713 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 2714 startTimeVariable=&startTimeVariable, signoff=&signoff, 2715 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 2716 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 2717 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 2718 %end; 2719 %end; 2720 %mend etls_waitfor; 2721 2722 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 2723 statusSetting="Running"); 2724 77 The SAS System 12:24 Tuesday, January 12, 2016 2725 proc sql noprint; 2726 select count(*) into: &processCountMacro 2727 from &statusTable where &statusVariable = &statusSetting; 2728 quit; 2729 2730 %rcSet(&sqlrc); 2731 %mend etls_getProcessesRunning; 2732 2733 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 2734 %let ¶meterVariableMacro = ; 2735 %let dsid = %sysfunc(open(¶meterTable)); 2736 %if (&dsid gt 0) %then 2737 %do; 2738 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 2739 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 2740 %end; 2741 %let dsid = %sysfunc(close(&dsid)); 2742 %end; 2743 %else 2744 %put %sysfunc(sysmsg()); 2745 %rcSet(&syserr); 2746 %mend etls_getParameterNames; 2747 2748 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 2749 data _null_; 2750 length vname $256 vtype $1 value $3200; 2751 dsid = open("¶meterTable"); 2752 if (dsid > 0) then 2753 do; 2754 do _i = 1 to &row; 2755 fetchrc = fetch(dsid); 2756 end; 2757 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 2758 vname = varname(dsid,_i); 2759 vtype = vartype(dsid,_i); 2760 if (fetchrc = 0) then 2761 do; 2762 if (vtype = 'C') then 2763 do; 2764 value = getvarc(dsid,_i); 2765 value = tranwrd(value,"%","%%"); 2766 value = tranwrd(value,"(","%("); 2767 value = tranwrd(value,")","%)"); 2768 value = tranwrd(value,'"','%"'); 2769 end; 2770 else 2771 value = left(put(getvarn(dsid,_i),best32.)); 2772 end; /* fetchrc = 0 */ 2773 2774 put ; 2775 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 2776 do; 2777 value='%str('||trim(value)||')'; 2778 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 2779 end; 2780 %if %str(&handlename) ne %str() %then 2781 %do; 2782 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 78 The SAS System 12:24 Tuesday, January 12, 2016 2783 %end; 2784 %else 2785 %do; 2786 value = '%let '||trim(vname)||'= '||trim(value)||';'; 2787 %end; 2788 2789 put "NOTE: Setting macro variable " vname "with statement:" value ; 2790 call execute(value); 2791 end; /* do i= */ 2792 dsid = close(dsid); 2793 end; /* dsid > 0 */ 2794 else 2795 do; 2796 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 2797 abort; 2798 end; 2799 stop; 2800 run; 2801 2802 %rcSet(&syserr); 2803 %mend etls_getParameters; 2804 2805 %macro etls_loopW6O7ZERC; 2806 %local etls_filePrefix; 2807 %let etls_filePrefix = ; 2808 2809 %macro etls_processToLoopW6O7ZERM(parameterTable=, row=, handleName=rmt); 2810 %etls_getParameters(parameterTable=¶meterTable, row=&row, 2811 startingColumnNumber=1, handleName=&handleName); 2812 %let etls_previousFilePrefix = &etls_filePrefix; 2813 %local etls_filePrefix; 2814 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 2815 %syslput &etls_controlName = &row / remote = &handleName; 2816 %syslput handleName = &handleName / remote = &handleName; 2817 2818 /* Setup to pass macros to remote session */ 2819 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 2820 2821 rsubmit &handleName wait = no sysrputsync = yes persist = no 2822 log = "&etls_logOutputPath./&etls_filePrefix..log" 2823 output = "&etls_logOutputPath./&etls_filePrefix..lst" 2824 ; 2825 2826 %macro etls_jobW6O7ZERW; 2827 2828 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 2829 2830 /****************************************************************************** 2831 * Job: RPODSDW015 A50D7W6R.AQ00011Y * 2832 * Description: * 2833 * * 2834 * Repository: me_besa A0000001.A50D7W6R * 2835 * Server: besa A5NJAD6Z.AT000001 * 2836 * * 2837 * Source Tables: TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 2838 * TTIPOCLI - ODSBESA.TTIPOCLI A5NJAD6Z.BJ0000AB * 2839 * TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 2840 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 79 The SAS System 12:24 Tuesday, January 12, 2016 2841 * TLIMITECRED - ODSBESA.TLIMITECRED A5NJAD6Z.BJ00009B * 2842 * Target Table: M_ODS_DW15 - GLBBESA.M_ODS_DW15 A5NJAD6Z.BJ00007S * 2843 * * 2844 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 2845 * Generated by: s-bametasasd1\dvbesa * 2846 * Version: 9.1.20060626.51875 * 2847 ******************************************************************************/ 2848 2849 /* Create metadata macro variables */ 2850 %let IOMServer = %nrquote(besa); 2851 %let metaPort = %nrquote(8561); 2852 %let metaServer = %nrquote(s-bametasasd1); 2853 %let metaRepository = %nrquote(me_besa); 2854 2855 /* Set metadata options */ 2856 options metaport = &metaPort 2857 metaserver = "&metaServer" 2858 metarepository = "&metaRepository"; 2859 2860 %let jobID = %quote(A50D7W6R.AQ00011Y); 2861 2862 /* Setup to capture return codes */ 2863 %global job_rc trans_rc sqlrc; 2864 %let job_rc = 0; 2865 %let trans_rc = 0; 2866 %let sqlrc = 0; 2867 %global syserr; 2868 2869 %macro rcSet(error); 2870 %if (&error gt &trans_rc) %then 2871 %let trans_rc = &error; 2872 %if (&error gt &job_rc) %then 2873 %let job_rc = &error; 2874 %mend rcSet; 2875 2876 %macro rcSetDS(error); 2877 if &error gt input(symget('trans_rc'),12.) then 2878 call symput('trans_rc',trim(left(put(&error,12.)))); 2879 if &error gt input(symget('job_rc'),12.) then 2880 call symput('job_rc',trim(left(put(&error,12.)))); 2881 %mend rcSetDS; 2882 2883 %global etls_debug; 2884 %macro etls_setDebug; 2885 %if %str(&etls_debug) ne 0 %then 2886 OPTIONS MPRINT%str(;); 2887 %mend; 2888 %etls_setDebug; 2889 2890 %macro genSASCommand; 2891 %local noobjserver; 2892 %if "&sysscp"="OS" %then %let noobjserver=; 2893 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 2894 %else %let noobjserver=%quote(-noobjectserver); 2895 options sascmd = "!sascmd &noobjserver"; 2896 %mend genSASCommand; 2897 %genSASCommand; 2898 80 The SAS System 12:24 Tuesday, January 12, 2016 2899 /****************************************************************************** 2900 * Macro: * 2901 * etls_tsLevel- Executes a data step using the tslvl function to * 2902 * determine if a feature is installed. * 2903 * * 2904 * Parameters: * 2905 * macroName- Name of macro to hold the value returned from the * 2906 * function call, a blank value indicates the feature is not * 2907 * installed. * 2908 * featureName - Name of feature to test for installation status. * 2909 ******************************************************************************/ 2910 %macro etls_tsLevel(macroName=, featureName=); 2911 data _null_; 2912 call symput("¯oName",tslvl("&featureName")); 2913 run; 2914 %mend etls_tsLevel; 2915 2916 /****************************************************************************** 2917 * Macro: * 2918 * etls_signon - Executes a signon to a remote machine. * 2919 * * 2920 * Parameters: * 2921 * handleName - Name of handle to access the remote connection. * 2922 * cmacvar - Macro variable to capture the status of the signon. * 2923 * gridRC- Macro variable to capture the return code of the grid * 2924 * signon. * 2925 * useGrid- A value of 1 will attempt to use a grid for the signon. * 2926 * If the grid functions are not installed then a local signon * 2927 * is performed. * 2928 * machineIdMacroVariable- Name of macro variable to capture the name * 2929 * of the machine used for a grid signon. * 2930 * workloadMacroVariable- Name of macro variable that specifies the * 2931 * workload to use for a grid signon. * 2932 * log - Path to a log file for the signon. * 2933 * output - Path to an output file for the signon. * 2934 * additionalSignonOptions- Any additional options for the signon * 2935 * statement. * 2936 * signonRetries- Integer value of signons to try before quiting. * 2937 * The wait between tries starts at 5 seconds, * 2938 * increments by 5 seconds. * 2939 ******************************************************************************/ 2940 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 2941 gridRC=rc, useGrid=1, 2942 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 2943 log=, output=, additionalSignonOptions=, signonRetries=3); 2944 2945 %let etls_gridInstalled =; 2946 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 2947 2948 %if (&useGrid = 1) %then 2949 %do; 2950 %if ("&etls_gridInstalled" ne "") %then 2951 %do; 2952 %if (&gridRC eq ) %then 2953 %let gridRC = &handleName.RC ; 2954 2955 %global &gridRC; 2956 %let workload = ; 81 The SAS System 12:24 Tuesday, January 12, 2016 2957 %if (&workloadMacroVariable ne ) %then 2958 %do; 2959 data _null_; 2960 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 2961 run; 2962 %end; 2963 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 2964 %end; 2965 %else 2966 %put %str(NOTE: Grid service functions are not installed.); 2967 %end; 2968 2969 %local sleeptime sleepIncreaseAmount tryCount; 2970 %let sleepIncreaseAmount=5; 2971 %let sleeptime=5; 2972 %let tryCount=1; 2973 %let &cmacvar=1; 2974 2975 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 2976 data _null_; 2977 signon &handleName cmacvar=&cmacvar 2978 %if ("&log" ne "") %then 2979 log=&log; 2980 %if ("&output" ne "") %then 2981 output=&output; 2982 %if ("&additionalSignonOptions" ne "") %then 2983 &additionalSignonOptions; 2984 ;run; 2985 2986 %if ("&machineIdMacroVariable" ne "") %then 2987 %do; 2988 %if ("&etls_gridInstalled" ne "") %then 2989 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 2990 %else 2991 %put %str(NOTE: Grid service functions are not installed.); 2992 %end; 2993 2994 %if "&&&cmacvar" eq "1" %then 2995 %do; 2996 %if &tryCount lt %eval(&signonRetries+1) %then 2997 %do; 2998 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 2999 %let rc=%sysfunc(sleep(&sleeptime,1)); 3000 %end; 3001 %else %if &signonRetries gt 0 %then 3002 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 3003 3004 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 3005 %let tryCount=%eval(&tryCount+1); 3006 %end; 3007 %end; 3008 %rcSet(&syserr); 3009 3010 %mend etls_signon; 3011 3012 /****************************************************************************** 3013 * Macro: * 3014 * etls_serverConnected- Tests to see if a connection to a remote * 82 The SAS System 12:24 Tuesday, January 12, 2016 3015 * exists. * 3016 * * 3017 * Parameters: * 3018 * serverId - Handle to the remote to test. * 3019 * macvarname- Name of macro variable to hold the return value of the * 3020 * status. Will equal 1 if the connection exists, 0 * 3021 * otherwise. Macro variable must be localized before * 3022 * calling this macro. * 3023 ******************************************************************************/ 3024 %macro etls_serverConnected(serverId=,macvarname=isConnected); 3025 %let &macvarname=0; 3026 %local search_str none_str savenotes; 3027 3028 /* setup information for listtask output */ 3029 /* listtask output on OS/390 differs */ 3030 %if %bquote(&sysscp) eq OS %then 3031 %do; 3032 %let search_str=Remote submit for; 3033 %let token=5; 3034 %end; 3035 %else 3036 %do; 3037 %let search_str=--------------; 3038 %let token=1; 3039 %end; 3040 3041 /* Issue listtask within PROC PRINTTO - send output to file */ 3042 filename __tmptxt TEMP; 3043 %let savenotes=%sysfunc(getoption(notes)); 3044 options nonotes; 3045 3046 proc printto log=__tmptxt new; 3047 run; 3048 3049 options notes; 3050 listtask; 3051 proc printto; 3052 run; 3053 3054 options nonotes; 3055 3056 /* read in the output from listtask */ 3057 %let dsname=_null_; 3058 data _null_(keep=Session); 3059 length line $256 sessionId $60; 3060 infile __tmptxt length=len; 3061 input @1 line $varying. len; 3062 3063 if line=:'There are no' then 3064 stop; 3065 /* look for the search string and scan for server name */ 3066 if index(line,"&search_str") then 3067 do; 3068 sessionId=scan(line,&token," "); 3069 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 3070 if sessionId=upcase(symget("serverId")) then 3071 do; 3072 call symput("&macvarname","1"); 83 The SAS System 12:24 Tuesday, January 12, 2016 3073 stop; 3074 end; 3075 end; 3076 run; 3077 filename __tmptxt clear; 3078 options &savenotes; 3079 %mend etls_serverConnected; 3080 3081 /****************************************************************************** 3082 * Macro: * 3083 * etls_signoff- Executes a signoff for a remote session, if a * 3084 * connection still exists. * 3085 * * 3086 * Parameters: * 3087 * handleName - Handle to remote session. * 3088 ******************************************************************************/ 3089 %macro etls_signoff(handleName=rmt); 3090 %local savemprint; 3091 %let savemprint=%sysfunc(getoption(mprint)); 3092 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 3093 options nomprint; 3094 %local isConnected; 3095 %etls_serverConnected(serverId=&handleName); 3096 options &savemprint; 3097 %if &isConnected %then 3098 signoff &handleName ;; 3099 %mend etls_signoff; 3100 3101 /****************************************************************************** 3102 * Macro: * 3103 * etls_getHandle- Retrieves the handle for a remote connection from the * 3104 * status table. * 3105 * * 3106 * Parameters: * 3107 * statusTable - Table containing status information. * 3108 * handleVariable- Name of variable holding the handles to the remote * 3109 * connections. * 3110 * row - Row to retrieve the information from. * 3111 ******************************************************************************/ 3112 %macro etls_getHandle(statusTable=, handleVariable=, row=); 3113 %let etls_dsid = %sysfunc(open(&statusTable)); 3114 %if (&etls_dsid = 0) %then 3115 %put %sysfunc(sysmsg()); 3116 %else 3117 %do; 3118 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 3119 %if (&rc ne 0) %then 3120 %put %sysfunc(sysmsg()); 3121 %else 3122 %do; 3123 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 3124 %if (&etls_varnum > 0) %then 3125 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 3126 %else 3127 %put %sysfunc(sysmsg()); 3128 %end; 3129 %let rc = %sysfunc(close(&etls_dsid)); 3130 %end; 84 The SAS System 12:24 Tuesday, January 12, 2016 3131 %mend etls_getHandle; 3132 3133 /****************************************************************************** 3134 * Macro: * 3135 * etls_freeHandle- Update the status of a remote connection in the * 3136 * status table and optionally signoff the connection. * 3137 * Can update the ending time of the task if an end time * 3138 * is desired. * 3139 * * 3140 * Parameters: * 3141 * statusTable - Table containing status information. * 3142 * statusVariable- Variable in status table that holds the status of * 3143 * the connection. * 3144 * handleVariable- Variable in status table that holds the names of * 3145 * the connection handles. * 3146 * handleName - Name of handle to access the remote connection. * 3147 * statusSetting- Value to set the status variable to once the * 3148 * process is complete, value must be quoted if this is * 3149 * character variable. * 3150 * endTimeVariable- Variable that contains the end time for the * 3151 * processes in the status table. * 3152 * startTimeVariable- Variable that contains the start time for the * 3153 * processes in the status table. * 3154 * signoff- Indicates whether this macro should signoff the * 3155 * connection to a remote, a value of 1 indicates a signoff * 3156 * should be made. * 3157 * returnCodeVariable- Variable in the status table that contains the * 3158 * return code for the individual processes. * 3159 * returnCodeMacroVariable- Macro variable holding the value for the * 3160 * processes return code. * 3161 * setMainJobRC- Indicates whether this macro should update the main * 3162 * job_rc for the outer process. * 3163 * statusUnknownReturnCode- Numeric value to set the status to if the * 3164 * status of the process cannot be determined. * 3165 ******************************************************************************/ 3166 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 3167 handleName=, statusSetting="Finished", 3168 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 3169 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 3170 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 3171 3172 %if ("&statusTable" ne "") %then 3173 %do; 3174 %local etls_rcMacroVarExisted; 3175 %let etls_rcMacroVarExisted = 0; 3176 %if ("&returnCodeMacroVariable" ne "") %then 3177 %do; 3178 proc sql noprint; 3179 select '1' into: etls_rcMacroVarExisted from dictionary.macros 3180 where name=upcase("&returnCodeMacroVariable"); 3181 quit; 3182 3183 %rcSet(&sqlrc); 3184 %if (&etls_rcMacroVarExisted = 0) %then 3185 %do; 3186 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 3187 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 3188 %end; 85 The SAS System 12:24 Tuesday, January 12, 2016 3189 %if (&setMainJobRC eq 1) %then 3190 %rcSet(&&&returnCodeMacroVariable); 3191 %end; 3192 %else 3193 %do; 3194 %let returnCodeMacroVariable=etls_rcmacvar; 3195 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 3196 %end; 3197 3198 %local etls_startTimeMacroVarExisted; 3199 %let etls_startTimeMacroVarExisted = 0; 3200 %if ("&startTimeMacroVariable" ne "") %then 3201 %do; 3202 proc sql noprint; 3203 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 3204 where name=upcase("&startTimeMacroVariable"); 3205 quit; 3206 3207 %rcSet(&sqlrc); 3208 %if (&etls_startTimeMacroVarExisted = 0) %then 3209 %do; 3210 %put WARNING: Start time from inner job not found. No value will be set.; 3211 %let &startTimeMacroVariable=; 3212 %end; 3213 %end; 3214 3215 %local etls_endTimeMacroVarExisted; 3216 %let etls_endTimeMacroVarExisted = 0; 3217 %if ("&endTimeMacroVariable" ne "") %then 3218 %do; 3219 proc sql noprint; 3220 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 3221 where name=upcase("&endTimeMacroVariable"); 3222 quit; 3223 3224 %rcSet(&sqlrc); 3225 %if (&etls_endTimeMacroVarExisted = 0) %then 3226 %do; 3227 %put WARNING: End time from inner job not found. Setting end time to current time.; 3228 %let &endTimeMacroVariable=%sysfunc(datetime()); 3229 %end; 3230 %end; 3231 3232 data &statusTable; 3233 modify &statusTable(where=(&handleVariable = &handleName)); 3234 %if ("&startTimeMacroVariable" ne "") %then 3235 %do; 3236 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 3237 %end; 3238 %if ("&endTimeVariable" ne "") %then 3239 %do; 3240 %if ("&endTimeMacroVariable" ne "") %then 3241 %do; 3242 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 3243 %end; 3244 %else 3245 &endTimeVariable = datetime();; 3246 %end; 86 The SAS System 12:24 Tuesday, January 12, 2016 3247 %if ("&returnCodeVariable" ne "") %then 3248 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 3249 %if ("&statusVariable" ne "") %then 3250 %do; 3251 if (symget("etls_rcMacroVarExisted") eq "0") then 3252 &statusVariable = "Unknown Status"; 3253 else 3254 &statusVariable = &statusSetting; 3255 %end; 3256 call symput('handle',&handleVariable); 3257 replace; 3258 stop; 3259 run; 3260 3261 %rcSet(&syserr); 3262 3263 %if (&signoff eq 1) %then 3264 %etls_signoff(handleName=&handle); 3265 %end; 3266 %mend etls_freeHandle; 3267 3268 /****************************************************************************** 3269 * Macro: * 3270 * etls_createHandle- Creates a handle name for a connect session and * 3271 * optionally signon to the session. * 3272 * * 3273 * Parameters: * 3274 * statusTable - Table that holds status of connections. * 3275 * statusVariable- Variable in status table that holds the status of * 3276 * the connection. * 3277 * handleVariable- Variable in status table that holds the names of * 3278 * the connection handles. * 3279 * handlePrefix- Prefix for the names of the handles, a number will * 3280 * be appended representing the row number in the table. * 3281 * workloadMacroVariable - Specification for the grid workload option. * 3282 * row - Row number in the status table to update. * 3283 * machineVariable- Variable in status table holding the name of * 3284 * machine running the task. * 3285 * statusSetting- Value to set the status variable to once the handle * 3286 * connection is made, value must be quoted if this is * 3287 * character variable. * 3288 * signon - A value of 1 will execute the signon statement. * 3289 * useGrid - A value of 1 will attempt to use a grid for the signon. * 3290 * log - Path to a log file for the signon. * 3291 * output - Path to an output file for the signon. * 3292 * gridRC- Macro variable to capture the return code of the grid * 3293 * signon. * 3294 * cmacvar - Macro variable to capture the status of the signon. * 3295 * additionalSignonOptions- Any additional options for the signon * 3296 * statement. * 3297 * signonRetries- Integer value of signons to try before quiting. * 3298 * The wait between tries starts at 5 seconds, * 3299 * increments by 5 seconds. * 3300 ******************************************************************************/ 3301 %macro etls_createHandle(statusTable=, statusVariable=, 3302 handleVariable=, handlePrefix=rmt, 3303 workloadMacroVariable=, row=, machineVariable=, 3304 statusSetting="Running", startTimeVariable=startTime, 87 The SAS System 12:24 Tuesday, January 12, 2016 3305 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 3306 additionalSignonOptions=, signonRetries= ); 3307 3308 %local remoteSessionId; 3309 %let remoteSessionId = &handlePrefix.&row; 3310 %let &cmacvar = 1; 3311 %local etls_machineId; 3312 %if (&signon eq 1) %then 3313 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 3314 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 3315 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 3316 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 3317 %else %let &cmacvar=0; 3318 3319 data &statusTable; 3320 retain ptr &row; 3321 modify &statusTable point = ptr; 3322 &handleVariable = "&remoteSessionId"; 3323 %if (&signon eq 1) %then 3324 &machineVariable = "&etls_machineId";; 3325 %if (&&&cmacvar ne 0) %then 3326 %do; 3327 &statusVariable = "Failed Signon"; 3328 %end; 3329 %else 3330 &statusVariable = &statusSetting;; 3331 %if (&startTimeVariable ne ) %then 3332 &startTimeVariable = datetime();; 3333 replace; 3334 stop; 3335 run; 3336 3337 %rcSet(&syserr); 3338 %mend etls_createHandle; 3339 3340 /****************************************************************************** 3341 * Macro: * 3342 * etls_waitfor- Executes a waitfor statement based on the status * 3343 * setting of processes in the status table. Will * 3344 * optionally perform a etls_freeHandle call if the process * 3345 * has completed. * 3346 * * 3347 * Parameters: * 3348 * statusTable - Table containing status information. * 3349 * statusVariable- Variable in status table that holds the status of * 3350 * the connection. * 3351 * runningStatusSetting- Value that indicates that the process is * 3352 * running, value must be quoted if this is * 3353 * character variable. * 3354 * handleVariable- Variable in status table that holds the names of * 3355 * the connection handles. * 3356 * completeStatusSetting- Value to set the status variable to once * 3357 * the process is complete, value must be quoted * 3358 * if this is character variable. * 3359 * endTimeVariable- Variable that contains the end time for the * 3360 * processes in the status table. * 3361 * startTimeVariable- Variable that contains the start time for the * 3362 * processes in the status table. * 88 The SAS System 12:24 Tuesday, January 12, 2016 3363 * waitType- Type of waitfor to perform; valid values are , * 3364 * _ANY_, or _ALL_. * 3365 * signoff- Indicates whether this macro should signoff the * 3366 * connection to a remote, a value of 1 indicates a signoff * 3367 * should be made. * 3368 * returnCodeVariable- Variable in the status table that contains the * 3369 * return code for the individual processes. * 3370 * returnCodeMacroVariable- Macro variable holding the value for the * 3371 * processes return code. * 3372 * statusUnknownReturnCode- Numeric value to set the status to if the * 3373 * status of the process cannot be determined. * 3374 ******************************************************************************/ 3375 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 3376 completeStatusSetting="Finished", endTimeVariable=endTime, 3377 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 3378 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 3379 3380 proc sql noprint; 3381 select count(*) into :etls_rows 3382 from &statusTable where &statusVariable = &runningStatusSetting; 3383 %let etls_rows = &etls_rows; 3384 %if (&etls_rows gt 0) %then 3385 %do; 3386 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 3387 from &statusTable where &statusVariable = &runningStatusSetting; 3388 %end; 3389 quit; 3390 3391 %rcSet(&sqlrc); 3392 3393 %if (&etls_rows gt 0) %then 3394 %do; 3395 waitfor &waitType 3396 %do i=1 %to &etls_rows; 3397 &&etlsHandles&i 3398 %end; 3399 ; 3400 %end; 3401 3402 %local useDefaultRCMacVar; 3403 %if ("&returnCodeMacroVariable" eq "") %then 3404 %let useDefaultRCMacVar=Y; 3405 3406 %do i=1 %to &etls_rows; 3407 3408 %if ("&useDefaultRCMacVar"="Y") %then 3409 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 3410 3411 waitfor &&etlsHandles&i timeout=1; 3412 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 3413 %do; 3414 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 3415 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 3416 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 3417 startTimeVariable=&startTimeVariable, signoff=&signoff, 3418 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 3419 statusUnknownReturnCode=&statusUnknownReturnCode, 3420 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 89 The SAS System 12:24 Tuesday, January 12, 2016 3421 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 3422 %put NOTE: Process &&etlsHandles&i. has completed.; 3423 %end; 3424 %else %if (&SYSRC ne -1) %then /* process status unknown */ 3425 %do; 3426 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 3427 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 3428 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 3429 startTimeVariable=&startTimeVariable, signoff=&signoff, 3430 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 3431 statusUnknownReturnCode=&statusUnknownReturnCode, 3431 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 3432 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 3433 %end; 3434 %end; 3435 %mend etls_waitfor; 3436 3437 /****************************************************************************** 3438 * Macro: * 3439 * etls_getProcessesRunning- Gets the number of processes running by * 3440 * querying the status table. * 3441 * * 3442 * Parameters: * 3443 * statusTable - Table containing status information. * 3444 * statusVariable- Variable in status table that holds the status of * 3445 * the connection. * 3446 * processCountMacro- Macro variable to contain the value of the * 3447 * number of processes running. Macro variable must * 3448 * be localized before calling this macro. * 3449 * statusSetting- Value that indicates that the process is running, * 3450 * value must be quoted if this is character variable. * 3451 ******************************************************************************/ 3452 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 3453 statusSetting="Running"); 3454 3455 proc sql noprint; 3456 select count(*) into: &processCountMacro 3457 from &statusTable where &statusVariable = &statusSetting; 3458 quit; 3459 3460 %rcSet(&sqlrc); 3461 %mend etls_getProcessesRunning; 3462 3463 /*============================================================================* 3464 * Step: SQL Join A50D7W6R.AR001K6X * 3465 * Transform: SQL Join (Version 2) * 3466 * Description: * 3467 * * 3468 * Source Tables: TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 3469 * TLIMITECRED - ODSBESA.TLIMITECRED A5NJAD6Z.BJ00009B * 3470 * Target Table: SQL Target - work.W5R0CV43 A50D7W6R.AY001L0Y * 3471 *============================================================================*/ 3472 3473 /* Access the data for ODSBESA */ 3474 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 3474 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 3475 %rcSet(&syslibrc); 3476 90 The SAS System 12:24 Tuesday, January 12, 2016 3477 %let transformID = %quote(A50D7W6R.AR001K6X); 3478 3479 %let trans_rc = 0; 3480 3481 proc datasets lib = work nolist nowarn memtype = (data view); 3482 delete W5R0CV43; 3483 quit; 3484 3485 proc sql; 3486 create table work.W5R0CV43 as 3487 select 3488 TCONTRATO.IDENT length = 4 3489 format = $4. 3490 informat = $4. 3491 label = 'IDENT', 3492 TCONTRATO.CDCONTRATO length = 16 3493 format = $16. 3494 informat = $16. 3495 label = 'CDCONTRATO', 3496 TCONTRATO.CDPRODUTO length = 4 3497 format = $4. 3498 informat = $4. 3499 label = 'CDPRODUTO' 3500 from 3501 ODSBESA.TCONTRATO left join 3502 ODSBESA.TLIMITECRED 3503 on 3504 ( 3505 TCONTRATO.IDENT = TLIMITECRED.IDENT 3506 and TCONTRATO.CDCONTRATO = TLIMITECRED.CDCONTRATO 3507 and TLIMITECRED.DTCHANGE <= &dataparam 3508 and TLIMITECRED.DTENDCHANGE >= &dataparam 3509 and TLIMITECRED.DTVENCLCRED >= &dataparam 3510 and TLIMITECRED.INACTIVO = 'Y' 3511 ) 3512 where 3513 TCONTRATO.IDENT = "9009" 3514 and TCONTRATO.DTCHANGE <= &dataparam 3515 and TCONTRATO.DTENDCHANGE >= &dataparam 3516 and TCONTRATO.CDSITCONTRATO = 'O' 3517 and TCONTRATO.CDPRODUTO IN ('BESA', 'CARD', 'CCCA', 'CPRV', 'CURR', 'CXAT', 'ECST', 'EPRV', 'ESCR', 3517 ! 'FECH', 'FLPO', 'IMPO', 'LIMT', 'NOST', 'NUMR', 'PNMR', 'PRIV', 'SALR', 'SLZR', 'TNMR', 'TPRV', 'VOST') 3518 and dhms(INTNX('month',datepart(coalesce(TLIMITECRED.DILCRED ,TCONTRATO.DTCONTRATO)),0),0,0,0) = 3518 ! dhms(INTNX('month',datepart(&dataparam),0),0,0,0) 3519 ; 3520 quit; 3521 3522 %rcSet(&sqlrc); 3523 3524 %macro etls_completeTarget(); 3525 %mend etls_completeTarget; 3526 %etls_completeTarget; 3527 3528 /*============================================================================* 3529 * Step: SAS Extract A50D7W6R.AR001K6Y * 3530 * Transform: Extract * 3531 * Description: * 3532 * * 91 The SAS System 12:24 Tuesday, January 12, 2016 3533 * Source Table: SQL Target - work.W5R0CV43 A50D7W6R.AY001L0Y * 3534 * Target Table: Extract Target - work.W5OQQD7H A50D7W6R.AY001L0Q * 3535 *============================================================================*/ 3536 3537 %let SYSLAST = %nrquote(work.W5R0CV43); 3538 3539 %let transformID = %quote(A50D7W6R.AR001K6Y); 3540 3541 %let trans_rc = 0; 3542 3543 proc datasets lib = work nolist nowarn memtype = (data view); 3544 delete W5OQQD7H; 3545 quit; 3546 3547 proc sql; 3548 create view work.W5OQQD7H as 3549 select IDENT length = 4 label = 'IDENT', 3550 CDCONTRATO length = 16 label = 'CDCONTRATO', 3551 CDPRODUTO length = 4 label = 'CDPRODUTO' 3552 from &SYSLAST; 3553 quit; 3554 3555 %let SYSLAST = work.W5OQQD7H; 3556 3557 %rcSet(&sqlrc); 3558 3559 /*============================================================================* 3560 * Step: SAS Extract A50D7W6R.AR001K6U * 3561 * Transform: Extract * 3562 * Description: * 3563 * * 3564 * Source Table: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 3565 * Target Table: Extract Target - work.W5OQQQ6Y A50D7W6R.AY001L0W * 3566 *============================================================================*/ 3567 3568 %let SYSLAST = %nrquote(ODSBESA.TCLIENTE); 3569 3570 %let transformID = %quote(A50D7W6R.AR001K6U); 3571 3572 %let trans_rc = 0; 3573 3574 proc datasets lib = work nolist nowarn memtype = (data view); 3575 delete W5OQQQ6Y; 3576 quit; 3577 3578 data _null_; 3579 put "NOTE: The following column(s) do not have a column mapping, so the" 3580 " value(s) will be set to missing: DTCHANGE, DTENDCHANGE, LNCLIENTE," 3581 " DTABERTURA, CDNACIONALIDADE, CDPAISRESIDENCIA, CDTPDOCIDENT," 3582 " NUDOCIDENT, CDSWIFT, CDSITCLIENTE, CDCATEGRISCO, CDCATEGDEVEDOR," 3583 " CDCATEGEXPOS, CDPAISEXPOS, CDPERFILRISCO, CDCLASSIFCLIENTE," 3584 " CDGRUPOCLIENTE, CDGRUPOTAX, CDGRUPOCOB, CDGRUPOCLEAR, FEMPREGADO," 3585 " CDFISCAL, CDNATJUR, INEMIGRANTE, INRESIDENTE, CDSEGMENTOCLI," 3586 " CDSUBSEGCLI, CDSECTORINST, CDSECTORNEG, CDGESTORCONTA, CDBALCAOABERT," 3587 " LNMORADA, INSEXO, DTNASCIMENTO, LITELEFONE, CDTITACADEMICO," 3588 " CDESTADOCIVIL, QTFILHOS, DTCONSTITUICAO, CDSITFALENC, DTFALENC," 3589 " FULTVERSAO, DTUPDATE"; 3590 run; 92 The SAS System 12:24 Tuesday, January 12, 2016 3591 3592 proc sql; 3593 create table work.W5OQQQ6Y as 3594 select IDENT length = 4 label = 'IDENT', 3595 CDCATEGCLIENTE length = 10 label = 'CDCATEGCLIENTE', 3596 CDCLIENTE length = 9 label = 'CDCLIENTE', 3597 CDTPCLIENTE length = 1 label = 'CDTPCLIENTE', 3598 (substr(CDCAE,1,2)) as CDCAE length = 6 format = $6. informat = $6., 3599 CDBALCAO length = 3 label = 'CDBALCAO', 3600 . as DTCHANGE length = 8 format = DATETIME20. informat = DATETIME20., 3601 . as DTENDCHANGE length = 8 format = DATETIME20. informat = DATETIME20., 3602 "" as LNCLIENTE length = 80 format = $80. informat = $80., 3603 . as DTABERTURA length = 8 format = DATETIME20. informat = DATETIME20., 3604 "" as CDNACIONALIDADE length = 3 format = $3. informat = $3., 3605 "" as CDPAISRESIDENCIA length = 3 format = $3. informat = $3., 3606 "" as CDTPDOCIDENT length = 2 format = $2. informat = $2., 3607 "" as NUDOCIDENT length = 20 format = $20. informat = $20., 3608 "" as CDSWIFT length = 12 format = $12. informat = $12., 3609 "" as CDSITCLIENTE length = 1 format = $1. informat = $1., 3610 "" as CDCATEGRISCO length = 4 format = $4. informat = $4., 3611 "" as CDCATEGDEVEDOR length = 10 format = $10. informat = $10., 3612 "" as CDCATEGEXPOS length = 20 format = $20. informat = $20., 3613 "" as CDPAISEXPOS length = 3 format = $3. informat = $3., 3614 "" as CDPERFILRISCO length = 20 format = $20. informat = $20., 3615 "" as CDCLASSIFCLIENTE length = 20 format = $20. informat = $20., 3616 "" as CDGRUPOCLIENTE length = 10 format = $10. informat = $10., 3617 "" as CDGRUPOTAX length = 10 format = $10. informat = $10., 3618 "" as CDGRUPOCOB length = 10 format = $10. informat = $10., 3619 "" as CDGRUPOCLEAR length = 10 format = $10. informat = $10., 3620 "" as FEMPREGADO length = 1 format = $1. informat = $1., 3621 "" as CDFISCAL length = 40 format = $40. informat = $40., 3622 "" as CDNATJUR length = 2 format = $2. informat = $2., 3623 "" as INEMIGRANTE length = 1 format = $1. informat = $1., 3624 "" as INRESIDENTE length = 1 format = $1. informat = $1., 3625 "" as CDSEGMENTOCLI length = 9 format = $9. informat = $9., 3626 "" as CDSUBSEGCLI length = 9 format = $9. informat = $9., 3627 "" as CDSECTORINST length = 9 format = $9. informat = $9., 3628 "" as CDSECTORNEG length = 9 format = $9. informat = $9., 3629 "" as CDGESTORCONTA length = 9 format = $9. informat = $9., 3630 "" as CDBALCAOABERT length = 3 format = $3. informat = $3., 3631 "" as LNMORADA length = 80 format = $80. informat = $80., 3632 "" as INSEXO length = 1 format = $1. informat = $1., 3633 . as DTNASCIMENTO length = 8 format = DATETIME20. informat = DATETIME20., 3634 "" as LITELEFONE length = 10 format = $10. informat = $10., 3635 "" as CDTITACADEMICO length = 1 format = $1. informat = $1., 3636 "" as CDESTADOCIVIL length = 1 format = $1. informat = $1., 3637 . as QTFILHOS length = 8 format = 11. informat = 11., 3638 . as DTCONSTITUICAO length = 8 format = DATETIME20. informat = DATETIME20., 3639 "" as CDSITFALENC length = 2 format = $2. informat = $2., 3640 . as DTFALENC length = 8 format = DATETIME20. informat = DATETIME20., 3641 "" as FULTVERSAO length = 1 format = $1. informat = $1., 3642 . as DTUPDATE length = 8 format = DATETIME20. informat = DATETIME20. 3643 from &SYSLAST 3644 where DTCHANGE <= &dataparam 3645 AND DTENDCHANGE >= &dataparam; 3646 quit; 3647 3648 %let SYSLAST = work.W5OQQQ6Y; 93 The SAS System 12:24 Tuesday, January 12, 2016 3649 3650 %rcSet(&sqlrc); 3651 3652 /*============================================================================* 3653 * Step: SAS Extract A50D7W6R.AR001K6S * 3654 * Transform: Extract * 3655 * Description: * 3656 * * 3657 * Source Table: TTIPOCLI - ODSBESA.TTIPOCLI A5NJAD6Z.BJ0000AB * 3658 * Target Table: Extract Target - work.W5OQQT1C A50D7W6R.AY001L0T * 3659 *============================================================================*/ 3660 3661 %let SYSLAST = %nrquote(ODSBESA.TTIPOCLI); 3662 3663 %let transformID = %quote(A50D7W6R.AR001K6S); 3664 3665 %let trans_rc = 0; 3666 3667 proc datasets lib = work nolist nowarn memtype = (data view); 3668 delete W5OQQT1C; 3669 quit; 3670 3671 proc sql; 3672 create table work.W5OQQT1C as 3673 select IDENT length = 4 label = 'IDENT', 3674 CDTPCLIENTE length = 1 label = 'CDTPCLIENTE', 3675 LITPCLIENTE length = 80 label = 'LITPCLIENTE' 3676 from &SYSLAST; 3677 quit; 3678 3679 %let SYSLAST = work.W5OQQT1C; 3680 3681 %rcSet(&sqlrc); 3682 3683 /*============================================================================* 3684 * Step: SAS Extract A50D7W6R.AR001K6P * 3685 * Transform: Extract * 3686 * Description: * 3687 * * 3688 * Source Table: TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 3689 * Target Table: Extract Target - work.W5OQQ3XW A50D7W6R.AY001L0P * 3690 *============================================================================*/ 3691 3692 %let SYSLAST = %nrquote(ODSBESA.TCONTA); 3693 3694 %let transformID = %quote(A50D7W6R.AR001K6P); 3695 3696 %let trans_rc = 0; 3697 3698 proc datasets lib = work nolist nowarn memtype = (data view); 3699 delete W5OQQ3XW; 3700 quit; 3701 3702 proc sql; 3703 create view work.W5OQQ3XW as 3704 select IDENT length = 4 label = 'IDENT', 3705 CDCONTRATO length = 16 label = 'CDCONTRATO', 3706 CDCLIENTE length = 9 label = 'CDCLIENTE' 94 The SAS System 12:24 Tuesday, January 12, 2016 3707 from &SYSLAST 3708 where DTCREATE = &DataParam; 3709 quit; 3710 3711 %let SYSLAST = work.W5OQQ3XW; 3712 3713 %rcSet(&sqlrc); 3714 3715 /*============================================================================* 3716 * Step: SQL Join A50D7W6R.AR001K6Q * 3717 * Transform: SQL Join (Version 2) * 3718 * Description: * 3719 * * 3720 * Source Tables: Extract Target - work.W5OQQD7H A50D7W6R.AY001L0Q * 3721 * Extract Target - work.W5OQQ3XW A50D7W6R.AY001L0P * 3722 * Target Table: SQL Target - work.W5OQQEN2 A50D7W6R.AY001L0R * 3723 *============================================================================*/ 3724 3725 %let transformID = %quote(A50D7W6R.AR001K6Q); 3726 3727 %let trans_rc = 0; 3728 3729 proc datasets lib = work nolist nowarn memtype = (data view); 3730 delete W5OQQEN2; 3731 quit; 3732 3733 proc sql; 3734 create table work.W5OQQEN2 as 3735 select 3736 W5OQQ3XW.IDENT length = 4 3737 format = $4. 3738 informat = $4. 3739 label = 'IDENT', 3740 W5OQQ3XW.CDCONTRATO length = 16 3741 format = $16. 3742 informat = $16. 3743 label = 'CDCONTRATO', 3744 W5OQQ3XW.CDCLIENTE length = 9 3745 format = $9. 3746 informat = $9. 3747 label = 'CDCLIENTE', 3748 W5OQQD7H.CDPRODUTO length = 4 3749 format = $4. 3750 informat = $4. 3751 label = 'CDPRODUTO' 3752 from 3753 work.W5OQQ3XW, 3754 work.W5OQQD7H 3755 where 3756 W5OQQ3XW.IDENT = W5OQQD7H.IDENT 3757 and W5OQQ3XW.CDCONTRATO = W5OQQD7H.CDCONTRATO 3758 ; 3759 quit; 3760 3761 %rcSet(&sqlrc); 3762 3763 %macro etls_completeTarget(); 3764 %mend etls_completeTarget; 95 The SAS System 12:24 Tuesday, January 12, 2016 3765 %etls_completeTarget; 3766 3767 /*============================================================================* 3768 * Step: SAS Extract A50D7W6R.AR001K6R * 3769 * Transform: Extract * 3770 * Description: * 3771 * * 3772 * Source Table: SQL Target - work.W5OQQEN2 A50D7W6R.AY001L0R * 3773 * Target Table: Extract Target - work.W5OQQK59 A50D7W6R.AY001L0S * 3774 *============================================================================*/ 3775 3776 %let SYSLAST = %nrquote(work.W5OQQEN2); 3777 3778 %let transformID = %quote(A50D7W6R.AR001K6R); 3779 3780 %let trans_rc = 0; 3781 3782 proc datasets lib = work nolist nowarn memtype = (data view); 3783 delete W5OQQK59; 3784 quit; 3785 3786 proc sql; 3787 create view work.W5OQQK59 as 3788 select IDENT length = 4 label = 'IDENT', 3789 CDCLIENTE length = 9 label = 'CDCLIENTE', 3790 CDPRODUTO length = 4 label = 'CDPRODUTO', 3791 (count(*)) as NUMERO_CONTRATOS length = 8 3792 from &SYSLAST 3793 group by IDENT, CDCLIENTE, CDPRODUTO; 3794 quit; 3795 3796 %let SYSLAST = work.W5OQQK59; 3797 3798 %rcSet(&sqlrc); 3799 3800 /*============================================================================* 3801 * Step: SQL Join A50D7W6R.AR001K6W * 3802 * Transform: SQL Join (Version 2) * 3803 * Description: * 3804 * * 3805 * Source Tables: Extract Target - work.W5OQQK59 A50D7W6R.AY001L0S * 3806 * Extract Target - work.W5OQQQ6Y A50D7W6R.AY001L0W * 3807 * Target Table: SQL Target - work.W5OQQRK6 A50D7W6R.AY001L0U * 3808 *============================================================================*/ 3809 3810 %let transformID = %quote(A50D7W6R.AR001K6W); 3811 3812 %let trans_rc = 0; 3813 3814 proc datasets lib = work nolist nowarn memtype = (data view); 3815 delete W5OQQRK6; 3816 quit; 3817 3818 proc sql; 3819 create view work.W5OQQRK6 as 3820 select 3821 W5OQQK59.IDENT length = 4 3822 format = $4. 96 The SAS System 12:24 Tuesday, January 12, 2016 3823 informat = $4. 3824 label = 'IDENT', 3825 W5OQQK59.CDCLIENTE length = 9 3826 format = $9. 3827 informat = $9. 3828 label = 'CDCLIENTE', 3829 W5OQQK59.CDPRODUTO length = 4 3830 format = $4. 3831 informat = $4. 3832 label = 'CDPRODUTO', 3833 W5OQQQ6Y.CDCAE length = 6 3834 format = $6. 3835 informat = $6. 3836 label = 'CDCAE', 3837 W5OQQQ6Y.CDTPCLIENTE length = 1 3838 format = $1. 3839 informat = $1. 3840 label = 'CDTPCLIENTE', 3841 W5OQQQ6Y.CDCATEGCLIENTE length = 10 3842 format = $10. 3843 informat = $10. 3844 label = 'CDCATEGCLIENTE', 3845 W5OQQK59.NUMERO_CONTRATOS length = 8, 3846 W5OQQQ6Y.CDBALCAO length = 3 3847 format = $3. 3848 informat = $3. 3849 label = 'CDBALCAO' 3850 from 3851 work.W5OQQK59 left join 3852 work.W5OQQQ6Y 3853 on 3854 ( 3855 W5OQQK59.IDENT = W5OQQQ6Y.IDENT 3856 and W5OQQK59.CDCLIENTE = W5OQQQ6Y.CDCLIENTE 3857 ) 3858 ; 3859 quit; 3860 3861 %rcSet(&sqlrc); 3862 3863 /*============================================================================* 3864 * Step: SQL Join A50D7W6R.AR001K6T * 3865 * Transform: SQL Join (Version 2) * 3866 * Description: * 3867 * * 3868 * Source Tables: SQL Target - work.W5OQQRK6 A50D7W6R.AY001L0U * 3869 * Extract Target - work.W5OQQT1C A50D7W6R.AY001L0T * 3870 * Target Table: SQL Target - work.W5OQQWTT A50D7W6R.AY001L0V * 3871 *============================================================================*/ 3872 3873 %let transformID = %quote(A50D7W6R.AR001K6T); 3874 3875 %let trans_rc = 0; 3876 3877 proc datasets lib = work nolist nowarn memtype = (data view); 3878 delete W5OQQWTT; 3879 quit; 3880 97 The SAS System 12:24 Tuesday, January 12, 2016 3881 proc sql; 3882 create table work.W5OQQWTT as 3883 select 3884 W5OQQRK6.IDENT length = 4 3885 format = $4. 3886 informat = $4. 3887 label = 'IDENT', 3888 W5OQQRK6.CDPRODUTO length = 4 3889 format = $4. 3890 informat = $4. 3891 label = 'CDPRODUTO', 3892 W5OQQRK6.NUMERO_CONTRATOS length = 8, 3893 W5OQQRK6.CDCAE length = 6 3894 format = $6. 3895 informat = $6. 3896 label = 'CDCAE', 3897 W5OQQT1C.LITPCLIENTE length = 80 3898 format = $80. 3899 informat = $80. 3900 label = 'LITPCLIENTE', 3901 W5OQQRK6.CDCATEGCLIENTE length = 10 3902 format = $10. 3903 informat = $10. 3904 label = 'CDCATEGCLIENTE', 3905 W5OQQRK6.CDBALCAO length = 3 3906 format = $3. 3907 informat = $3. 3908 label = 'CDBALCAO' 3909 from 3910 work.W5OQQRK6 left join 3911 work.W5OQQT1C 3912 on 3913 ( 3914 W5OQQRK6.IDENT = W5OQQT1C.IDENT 3915 and W5OQQRK6.CDTPCLIENTE = W5OQQT1C.CDTPCLIENTE 3916 ) 3917 ; 3918 quit; 3919 3920 %rcSet(&sqlrc); 3921 3922 %macro etls_completeTarget(); 3923 %mend etls_completeTarget; 3924 %etls_completeTarget; 3925 3926 /*============================================================================* 3927 * Step: SAS Extract A50D7W6R.AR001K70 * 3928 * Transform: Extract * 3929 * Description: * 3930 * * 3931 * Source Table: SQL Target - work.W5OQQWTT A50D7W6R.AY001L0V * 3932 * Target Table: Extract Target - work.W5OQQZJ1 A50D7W6R.AY001L0Z * 3933 *============================================================================*/ 3934 3935 %let SYSLAST = %nrquote(work.W5OQQWTT); 3936 3937 %let transformID = %quote(A50D7W6R.AR001K70); 3938 98 The SAS System 12:24 Tuesday, January 12, 2016 3939 %let trans_rc = 0; 3940 3941 proc datasets lib = work nolist nowarn memtype = (data view); 3942 delete W5OQQZJ1; 3943 quit; 3944 3945 proc sql; 3946 create table work.W5OQQZJ1 as 3947 select (put(datepart(&dataparam),YYMMDD10.)) as DTPROC length = 10, 3948 IDENT length = 4 label = 'IDENT', 3949 CDPRODUTO length = 4 label = 'CDPRODUTO', 3950 CDCAE length = 6 label = 'CDCAE', 3951 LITPCLIENTE length = 80 label = 'LITPCLIENTE', 3952 CDCATEGCLIENTE length = 10 label = 'CDCATEGCLIENTE', 3953 CDBALCAO length = 3 label = 'CDBALCAO', 3954 (sum(NUMERO_CONTRATOS)) as NUMERO_CONTRATOS length = 8 3955 from &SYSLAST 3956 group by IDENT, CDBALCAO, CDPRODUTO, CDCAE, LITPCLIENTE, 3957 CDCATEGCLIENTE; 3958 quit; 3959 3960 %let SYSLAST = work.W5OQQZJ1; 3961 3962 %rcSet(&sqlrc); 3963 3964 /*============================================================================* 3965 * Step: DEL_BY_DATE A50D7W6R.AR001K6Z * 3966 * Transform: DEL_BY_DATE * 3967 * Description: * 3968 * * 3969 * Source Table: Extract Target - work.W5OQQZJ1 A50D7W6R.AY001L0Z * 3970 * Target Table: DEL_BY_DATE - work.W5OR3RUQ A50D7W6R.AY001L0X * 3971 *============================================================================*/ 3972 3973 %let SYSLAST = %nrquote(work.W5OQQZJ1); 3974 3975 %let transformID = %quote(A50D7W6R.AR001K6Z); 3976 3977 %let trans_rc = 0; 3978 3979 /* Source table(s)/view(s) */ 3980 %let _INPUT1 = work.W5OQQZJ1; 3981 3982 /* Target table/view(s) */ 3983 %let _OUTPUT = work.W5OR3RUQ; 3984 %let _OUTPUT1 = work.W5OR3RUQ; 3985 3986 /* Delete target table(s) */ 3987 proc datasets lib=work nolist nowarn memtype = (data view); 3988 delete W5OR3RUQ; 3989 quit; 3990 3991 /* Options */ 3992 %let data_col = %nrquote(DTPROC); 3993 %let rel_table = %nrquote(GLBBESA.M_ODS_DW15); 3994 %let data_apagar = %nrquote(&dataparam); 3995 3996 /* List of target columns to keep */ 99 The SAS System 12:24 Tuesday, January 12, 2016 3997 %let keep = DTPROC IDENT CDPRODUTO CDCAE LITPCLIENTE CDCATEGCLIENTE 3998 CDBALCAO NUMERO_CONTRATOS; 3999 4000 %macro connect_oracle(schema); 4001 4002 connect to ORACLE 4003 ( 4004 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 4005 PATH = &ORACLE_CTB_SID 4006 USER = &ORACLE_CTB_USER 4007 PASSWORD = &ORACLE_CTB_PASSWORD 4008 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 4009 PATH = &ORACLE_DM_SID 4010 USER = &ORACLE_DM_USER 4011 PASSWORD = &ORACLE_DM_PASSWORD 4012 %END; 4013 ) 4014 4015 4016 %mend connect_oracle; 4017 4018 %macro tab_oracle(tabela); 4019 %let schema=%scan(&tabela,1); 4020 %IF %UPCASE(&schema) = GLBBESA 4021 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 4022 %ELSE %DO; &tabela %END; 4023 4024 4025 %mend tab_oracle; 4026 4027 4028 4029 4030 4031 /* Converte data DateTime em Data */ 4032 data _null_; 4033 format a Datetime.; 4034 a = &data_apagar; 4035 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 4036 run; 4037 4038 4039 4040 proc sql; 4041 %connect_oracle(%scan(&rel_table,1)); 4042 4043 execute( 4044 delete from %tab_oracle(&rel_table) 4045 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 4046 4047 disconnect from ORACLE; 4048 quit; 4049 4050 4051 proc sql; 4052 create view &_OUTPUT1 as 4053 select * 4054 from &_INPUT1; 100 The SAS System 12:24 Tuesday, January 12, 2016 4055 quit; 4056 4057 4058 4059 4060 4061 %rcSet(&syserr); 4062 %rcSet(&sysrc); 4063 %rcSet(&sqlrc); 4064 4065 /*============================================================================* 4066 * Step: Table Loader A50D7W6R.AR001K6V * 4067 * Transform: Table Loader (Version 2) * 4068 * Description: * 4069 * * 4070 * Source Table: DEL_BY_DATE - work.W5OR3RUQ A50D7W6R.AY001L0X * 4071 * Target Table: M_ODS_DW15 - GLBBESA.M_ODS_DW15 A5NJAD6Z.BJ00007S * 4072 *============================================================================*/ 4073 4074 /* Access the data for GLBBESA */ 4075 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 4075 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 4076 %rcSet(&syslibrc); 4077 4078 %let SYSLAST = %nrquote(work.W5OR3RUQ); 4079 4080 %let transformID = %quote(A50D7W6R.AR001K6V); 4081 4082 %let trans_rc = 0; 4083 4084 %global etls_tableExist; 4085 %global etls_numIndex; 4086 %global etls_lastTable; 4087 %let etls_tableExist = -1; 4088 %let etls_numIndex = -1; 4089 %let etls_lastTable = &SYSLAST; 4090 4091 /*---- Define load data macro ----*/ 4092 %macro etls_loader; 4093 4094 %let SYSOPT = ; 4095 4096 /* Determine if the target table exists */ 4097 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW15, DATA)) or 4098 %sysfunc(exist(GLBBESA.M_ODS_DW15, VIEW))); 4099 4100 /*---- Create a new table ----*/ 4101 %if (&etls_tableExist eq 0) %then 4102 %do; /* if table does not exist */ 4103 4104 %put %str(NOTE: Creating table ...); 4105 4106 data GLBBESA.M_ODS_DW15 4107 (dbnull = ( 4108 DTPROC = YES 4109 IDENT = YES 4110 CDPRODUTO = YES 4111 CDCAE = YES 101 The SAS System 12:24 Tuesday, January 12, 2016 4112 LITPCLIENTE = YES 4113 CDCATEGCLIENTE = YES 4114 CDBALCAO = YES 4115 NUMERO_CONTRATOS = YES)); 4116 attrib DTPROC length = $10 format = $10. informat = $10. 4117 label = 'DTPROC'; 4118 attrib IDENT length = $4 format = $4. informat = $4. 4119 label = 'IDENT'; 4120 attrib CDPRODUTO length = $4 format = $4. informat = $4. 4121 label = 'CDPRODUTO'; 4122 attrib CDCAE length = $6 format = $6. informat = $6. 4123 label = 'CDCAE'; 4124 attrib LITPCLIENTE length = $80 format = $80. informat = $80. 4125 label = 'LITPCLIENTE'; 4126 attrib CDCATEGCLIENTE length = $10 format = $10. informat = $10. 4127 label = 'CDCATEGCLIENTE'; 4128 attrib CDBALCAO length = $3 format = $3. informat = $3. 4129 label = 'CDBALCAO'; 4130 attrib NUMERO_CONTRATOS length = 8 format = 9. informat = 9. 4131 label = 'NUMERO_CONTRATOS'; 4132 stop; 4133 run; 4134 4135 %rcSet(&syserr); 4136 4137 %end; /* if table does not exist */ 4138 4139 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 4140 4141 /*---- Append new data ----*/ 4142 %put %str(NOTE: Appending data ...); 4143 4144 proc append base = GLBBESA.M_ODS_DW15 4145 data = &etls_lastTable (&SYSOPT) force; 4146 run; 4147 4148 %rcSet(&syserr); 4149 4150 %mend etls_loader; 4151 %etls_loader; 4152 4153 %sysrput job_rc&handleName = &job_rc; 4154 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 4155 4156 %mend etls_jobW6O7ZERW; 4157 4158 %etls_jobW6O7ZERW; 4159 4160 endrsubmit; 4161 4162 %mend etls_processToLoopW6O7ZERM; 4163 4164 %local etls_controlTable etls_statusTable etls_controlName 4165 etls_processesRunning etls_maxProcesses etls_parameterTable 4166 etls_additionalSignonOptions etls_signonRetries; 4167 %let etls_controlName = L13_; 4168 %let etls_statusTable = work.W5OV9ZCX; 4169 %let etls_parameterTable = work.W6O7ZES6; 102 The SAS System 12:24 Tuesday, January 12, 2016 4170 %let etls_workload = ; 4171 %let etls_additionalSignonOptions = ; 4172 %let etls_signonRetries = 3; 4173 %let &etls_controlName = 0; 4174 %let etls_controlTable = work.W5PBC8BC; 4175 4176 %put %str(NOTE: Creating status table...); 4177 data &etls_statusTable 4178 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 4179 etls_status etls_jobRC DTFIM 4180 ); 4181 attrib etls_handleName length = $32 4182 label = 'Name of handle to remote session'; 4183 attrib etls_machineId length = $32 4184 label = 'Name of machine executing the task'; 4185 attrib etls_startTime length = 8 format = nldatmap. 4186 label = 'Start time of task'; 4187 attrib etls_endTime length = 8 format = nldatmap. 4188 label = 'End time of task'; 4189 attrib etls_status length = $32 4190 label = 'Current status of task'; 4191 attrib etls_jobRC length = 8 4192 label = 'Return code of task'; 4193 set &etls_controlTable; 4194 run; 4195 4196 %rcSet(&syserr); 4197 4198 %put %str(NOTE: Creating parameter table...); 4199 proc sql; 4200 create table &etls_parameterTable as 4201 select DTFIM as DataParam 4202 from &etls_controlTable; 4203 quit; 4204 4205 %rcSet(&sqlrc); 4206 4207 /* Get the number of times to iterate from the number of rows in the source */ 4208 /* table */ 4209 proc sql noprint; 4210 select count(*) into :&etls_controlName._max from &etls_statusTable; 4211 %let &etls_controlName._max = &&&etls_controlName._max; 4212 quit; 4213 4214 %rcSet(&sqlrc); 4215 4216 %let etls_gridInstalled =; 4217 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 4218 4219 %if (%str(&etls_gridInstalled) ne %str()) %then 4220 %do; 4221 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 4222 %if (&etls_maxProcesses = 0) %then 4223 %do; 4224 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 4225 processes to SYSNCPU value.); 4226 %let etls_maxProcesses = &SYSNCPU; 4227 %end; 103 The SAS System 12:24 Tuesday, January 12, 2016 4228 %end; 4229 %else 4230 %do; 4231 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 4232 processes to SYSNCPU value.); 4233 %let etls_maxProcesses = &SYSNCPU; 4234 %end; 4235 4236 %if (&etls_maxProcesses > 0) %then 4237 %do; 4238 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 4239 4240 %let etls_lastLoopPtr = &&&etls_controlName; 4241 4242 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 4243 processCountMacro=etls_processesRunning, statusSetting="Running"); 4244 4245 %do %while(&etls_processesRunning lt &&&etls_controlName._max 4246 and &etls_processesRunning lt &etls_maxProcesses 4247 and &&&etls_controlName lt &&&etls_controlName._max); 4248 4249 %let &etls_controlName = %eval(&&&etls_controlName+1); 4250 4251 %global etls_signonStatus; 4252 %let etls_logOutputPath = &DIR_PRJ_LOG.; 4253 4254 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 4255 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 4256 row=&&&etls_controlName, machineVariable=etls_machineId, 4257 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 4258 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 4259 4260 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 4261 processCountMacro=etls_processesRunning, statusSetting="Running"); 4262 4263 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 4264 %etls_processToLoopW6O7ZERM(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 4265 handleName=%etls_getHandle(statusTable=&etls_statusTable, 4266 handleVariable=etls_handleName, row=&&&etls_controlName)); 4267 %else 4268 %do; /* if signon error, set iterator to max to force loop to stop. */ 4269 %let &etls_controlName = &&&etls_controlName._max; 4270 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 4271 %end; 4272 %end; 4273 4274 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 4275 runningStatusSetting="Running", handleVariable=etls_handleName, 4276 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 4277 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 4278 returnCodeVariable=etls_jobRC, 4279 statusUnknownReturnCode=.); 4280 4281 %end; 4282 4283 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 4284 runningStatusSetting="Running", handleVariable=etls_handleName, 4285 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 104 The SAS System 12:24 Tuesday, January 12, 2016 4286 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 4287 returnCodeVariable=etls_jobRC, 4288 statusUnknownReturnCode=.); 4289 4290 %end; 4291 4292 proc datasets lib = work nolist nowarn memtype = (data view); 4293 delete W6O7ZES6; 4294 quit; 4295 4296 %mend etls_loopW6O7ZERC; 4297 4298 %etls_loopW6O7ZERC; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_LOOPW6O7ZERC): data work.W5OV9ZCX (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZERC): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W5PBC8BC MPRINT(ETLS_LOOPW6O7ZERC): set work.W5PBC8BC; MPRINT(ETLS_LOOPW6O7ZERC): run; NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W5PBC8BC. NOTE: The data set WORK.W5OV9ZCX has 1 observations and 7 variables. NOTE: Compressing data set WORK.W5OV9ZCX 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.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERC): ; 105 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZERC): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZES6 SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W5PBC8BC MPRINT(ETLS_LOOPW6O7ZERC): create table work.W6O7ZES6 as select DTFIM as DataParam from work.W5PBC8BC; NOTE: Compression was disabled for data set WORK.W6O7ZES6 because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZES6 created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZERC): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERC): ; MPRINT(ETLS_LOOPW6O7ZERC): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_LOOPW6O7ZERC): select count(*) into :L13__max from work.W5OV9ZCX; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZERC): quit; 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 226k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERC): ; 106 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZERC): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W5OV9ZCX where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZERC): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 107 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L13_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L13_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 108 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable GRIDRC resolves to L13_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L13_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L13_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.08 seconds cpu time 0.08 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_workC19000000120_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.16 seconds user cpu time 0.05 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 105 Involuntary Context Switches 3 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_workC19000000120_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L13_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.01 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds Memory 223k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 27 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_CREATEHANDLE): data work.W5OV9ZCX; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX 109 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_CREATEHANDLE): modify work.W5OV9ZCX point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L13_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L13_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W5OV9ZCX has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 309k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZERC): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W5OV9ZCX where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 110 The SAS System 12:24 Tuesday, January 12, 2016 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZERC): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZES6 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZES6 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZES6 MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZES6"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); 111 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L13_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZES6 MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZES6, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable DataParam with statement:%syslput DataParam= 1764460800 / remote = L13_1; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZERM): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L13_1 112 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L13_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L13_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZERM): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L13_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L13_1.lst" ; 109 The SAS System 12:25 Tuesday, January 12, 2016 NOTE: Background remote submit to L13_1 in progress. 122 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W5OV9ZCX where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W5OV9ZCX where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 NOTE: Remote signoff from L13_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 13.53 seconds user cpu time 4.51 seconds system cpu time 0.65 seconds Memory 22216k Page Faults 7 Page Reclaims 895 Page Swaps 0 Voluntary Context Switches 3561 Involuntary Context Switches 318 Block Input Operations 1 Block Output Operations 205 NOTE: Remote signoff from L13_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. 123 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L13_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL13_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL13_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL13_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL13_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL13_1 124 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable JOB_RCL13_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L13_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L13_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L13_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L13_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L13_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L13_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; 125 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_FREEHANDLE): data work.W5OV9ZCX; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L13_1" MPRINT(ETLS_FREEHANDLE): modify work.W5OV9ZCX(where=(etls_handleName = "L13_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L13_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L13_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L13_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L13_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L13_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L13_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL13_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL13_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W5OV9ZCX. WHERE etls_handleName='L13_1'; NOTE: The data set WORK.W5OV9ZCX has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 126 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L13_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L13_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L13_1 NOTE: Process L13_1 has completed. MPRINT(ETLS_LOOPW6O7ZERC): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L13_ SYMBOLGEN: Macro variable L13__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W5OV9ZCX MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W5OV9ZCX SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W5OV9ZCX where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; 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 227k Page Faults 0 127 The SAS System 12:24 Tuesday, January 12, 2016 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZERC): ; MPRINT(ETLS_LOOPW6O7ZERC): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZERC): delete W6O7ZES6; MPRINT(ETLS_LOOPW6O7ZERC): quit; NOTE: Deleting WORK.W6O7ZES6 (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 4299 4300 /*============================================================================* 4301 * Step: Loop End A50D7W6R.B6001AAR * 4302 * Transform: Loop End * 4303 * Description: * 4304 *============================================================================*/ 4305 4306 /*============================================================================* 4307 * Step: Loop A50D7W6R.B6001AAY * 4308 * Transform: Loop * 4309 * Description: * 4310 * * 4311 * Source Table: SAS Splitter - work.W6M2B9BO A50D7W6R.AY0032DD * 4312 * Target Table: Status Table - work.W6M2B9EQ A50D7W6R.AY0032DE * 4313 *============================================================================*/ 4314 4315 %let SYSLAST = %nrquote(work.W6M2B9BO); 4316 4317 %let transformID = %quote(A50D7W6R.B6001AAY); 4318 4319 %let trans_rc = 0; 128 The SAS System 12:24 Tuesday, January 12, 2016 4320 4321 %macro genSASCommand; 4322 %local noobjserver; 4323 %if "&sysscp"="OS" %then %let noobjserver=; 4324 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 4325 %else %let noobjserver=%quote(-noobjectserver); 4326 options sascmd = "!sascmd &noobjserver"; 4327 %mend genSASCommand; 4328 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 4329 4330 %macro etls_tsLevel(macroName=, featureName=); 4331 data _null_; 4332 call symput("¯oName",tslvl("&featureName")); 4333 run; 4334 %mend etls_tsLevel; 4335 4336 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 4337 gridRC=rc, useGrid=1, 4338 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 4339 log=, output=, additionalSignonOptions=, signonRetries=3); 4340 4341 %let etls_gridInstalled =; 4342 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 4343 4344 %if (&useGrid = 1) %then 4345 %do; 4346 %if ("&etls_gridInstalled" ne "") %then 4347 %do; 4348 %if (&gridRC eq ) %then 4349 %let gridRC = &handleName.RC ; 4350 4351 %global &gridRC; 4352 %let workload = ; 4353 %if (&workloadMacroVariable ne ) %then 4354 %do; 4355 data _null_; 4356 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 4357 run; 4358 %end; 4359 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 4360 %end; 4361 %else 4362 %put %str(NOTE: Grid service functions are not installed.); 4363 %end; 4364 4365 %local sleeptime sleepIncreaseAmount tryCount; 4366 %let sleepIncreaseAmount=5; 4367 %let sleeptime=5; 4368 %let tryCount=1; 4369 %let &cmacvar=1; 4370 4371 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 4372 data _null_; 129 The SAS System 12:24 Tuesday, January 12, 2016 4373 signon &handleName cmacvar=&cmacvar 4374 %if ("&log" ne "") %then 4375 log=&log; 4376 %if ("&output" ne "") %then 4377 output=&output; 4378 %if ("&additionalSignonOptions" ne "") %then 4379 &additionalSignonOptions; 4380 ;run; 4381 4382 %if ("&machineIdMacroVariable" ne "") %then 4383 %do; 4384 %if ("&etls_gridInstalled" ne "") %then 4385 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 4386 %else 4387 %put %str(NOTE: Grid service functions are not installed.); 4388 %end; 4389 4390 %if "&&&cmacvar" eq "1" %then 4391 %do; 4392 %if &tryCount lt %eval(&signonRetries+1) %then 4393 %do; 4394 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 4395 %let rc=%sysfunc(sleep(&sleeptime,1)); 4396 %end; 4397 %else %if &signonRetries gt 0 %then 4398 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 4399 4400 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 4401 %let tryCount=%eval(&tryCount+1); 4402 %end; 4403 %end; 4404 %rcSet(&syserr); 4405 4406 %mend etls_signon; 4407 4408 %macro etls_serverConnected(serverId=,macvarname=isConnected); 4409 %let &macvarname=0; 4410 %local search_str none_str savenotes; 4411 4412 /* setup information for listtask output */ 4413 /* listtask output on OS/390 differs */ 4414 %if %bquote(&sysscp) eq OS %then 4415 %do; 4416 %let search_str=Remote submit for; 4417 %let token=5; 4418 %end; 4419 %else 4420 %do; 4421 %let search_str=--------------; 4422 %let token=1; 4423 %end; 4424 4425 /* Issue listtask within PROC PRINTTO - send output to file */ 4426 filename __tmptxt TEMP; 4427 %let savenotes=%sysfunc(getoption(notes)); 4428 options nonotes; 4429 4430 proc printto log=__tmptxt new; 130 The SAS System 12:24 Tuesday, January 12, 2016 4431 run; 4432 4433 options notes; 4434 listtask; 4435 proc printto; 4436 run; 4437 4438 options nonotes; 4439 4440 /* read in the output from listtask */ 4441 %let dsname=_null_; 4442 data _null_(keep=Session); 4443 length line $256 sessionId $60; 4444 infile __tmptxt length=len; 4445 input @1 line $varying. len; 4446 4447 if line=:'There are no' then 4448 stop; 4449 /* look for the search string and scan for server name */ 4450 if index(line,"&search_str") then 4451 do; 4452 sessionId=scan(line,&token," "); 4453 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 4454 if sessionId=upcase(symget("serverId")) then 4455 do; 4456 call symput("&macvarname","1"); 4457 stop; 4458 end; 4459 end; 4460 run; 4461 filename __tmptxt clear; 4462 options &savenotes; 4463 %mend etls_serverConnected; 4464 4465 %macro etls_signoff(handleName=rmt); 4466 %local savemprint; 4467 %let savemprint=%sysfunc(getoption(mprint)); 4468 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 4469 options nomprint; 4470 %local isConnected; 4471 %etls_serverConnected(serverId=&handleName); 4472 options &savemprint; 4473 %if &isConnected %then 4474 signoff &handleName ;; 4475 %mend etls_signoff; 4476 4477 %macro etls_getHandle(statusTable=, handleVariable=, row=); 4478 %let etls_dsid = %sysfunc(open(&statusTable)); 4479 %if (&etls_dsid = 0) %then 4480 %put %sysfunc(sysmsg()); 4481 %else 4482 %do; 4483 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 4484 %if (&rc ne 0) %then 4485 %put %sysfunc(sysmsg()); 4486 %else 4487 %do; 4488 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 131 The SAS System 12:24 Tuesday, January 12, 2016 4489 %if (&etls_varnum > 0) %then 4490 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 4491 %else 4492 %put %sysfunc(sysmsg()); 4493 %end; 4494 %let rc = %sysfunc(close(&etls_dsid)); 4495 %end; 4496 %mend etls_getHandle; 4497 4498 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 4499 handleName=, statusSetting="Finished", 4500 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 4501 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 4502 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 4503 4504 %if ("&statusTable" ne "") %then 4505 %do; 4506 %local etls_rcMacroVarExisted; 4507 %let etls_rcMacroVarExisted = 0; 4508 %if ("&returnCodeMacroVariable" ne "") %then 4509 %do; 4510 proc sql noprint; 4511 select '1' into: etls_rcMacroVarExisted from dictionary.macros 4512 where name=upcase("&returnCodeMacroVariable"); 4513 quit; 4514 4515 %rcSet(&sqlrc); 4516 %if (&etls_rcMacroVarExisted = 0) %then 4517 %do; 4518 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 4519 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 4520 %end; 4521 %if (&setMainJobRC eq 1) %then 4522 %rcSet(&&&returnCodeMacroVariable); 4523 %end; 4524 %else 4525 %do; 4526 %let returnCodeMacroVariable=etls_rcmacvar; 4527 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 4528 %end; 4529 4530 %local etls_startTimeMacroVarExisted; 4531 %let etls_startTimeMacroVarExisted = 0; 4532 %if ("&startTimeMacroVariable" ne "") %then 4533 %do; 4534 proc sql noprint; 4535 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 4536 where name=upcase("&startTimeMacroVariable"); 4537 quit; 4538 4539 %rcSet(&sqlrc); 4540 %if (&etls_startTimeMacroVarExisted = 0) %then 4541 %do; 4542 %put WARNING: Start time from inner job not found. No value will be set.; 4543 %let &startTimeMacroVariable=; 4544 %end; 4545 %end; 4546 132 The SAS System 12:24 Tuesday, January 12, 2016 4547 %local etls_endTimeMacroVarExisted; 4548 %let etls_endTimeMacroVarExisted = 0; 4549 %if ("&endTimeMacroVariable" ne "") %then 4550 %do; 4551 proc sql noprint; 4552 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 4553 where name=upcase("&endTimeMacroVariable"); 4554 quit; 4555 4556 %rcSet(&sqlrc); 4557 %if (&etls_endTimeMacroVarExisted = 0) %then 4558 %do; 4559 %put WARNING: End time from inner job not found. Setting end time to current time.; 4560 %let &endTimeMacroVariable=%sysfunc(datetime()); 4561 %end; 4562 %end; 4563 4564 data &statusTable; 4565 modify &statusTable(where=(&handleVariable = &handleName)); 4566 %if ("&startTimeMacroVariable" ne "") %then 4567 %do; 4568 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 4569 %end; 4570 %if ("&endTimeVariable" ne "") %then 4571 %do; 4572 %if ("&endTimeMacroVariable" ne "") %then 4573 %do; 4574 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 4575 %end; 4576 %else 4577 &endTimeVariable = datetime();; 4578 %end; 4579 %if ("&returnCodeVariable" ne "") %then 4580 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 4581 %if ("&statusVariable" ne "") %then 4582 %do; 4583 if (symget("etls_rcMacroVarExisted") eq "0") then 4584 &statusVariable = "Unknown Status"; 4585 else 4586 &statusVariable = &statusSetting; 4587 %end; 4588 call symput('handle',&handleVariable); 4589 replace; 4590 stop; 4591 run; 4592 4593 %rcSet(&syserr); 4594 4595 %if (&signoff eq 1) %then 4596 %etls_signoff(handleName=&handle); 4597 %end; 4598 %mend etls_freeHandle; 4599 4600 %macro etls_createHandle(statusTable=, statusVariable=, 4601 handleVariable=, handlePrefix=rmt, 4602 workloadMacroVariable=, row=, machineVariable=, 4603 statusSetting="Running", startTimeVariable=startTime, 4604 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 133 The SAS System 12:24 Tuesday, January 12, 2016 4605 additionalSignonOptions=, signonRetries= ); 4606 4607 %local remoteSessionId; 4608 %let remoteSessionId = &handlePrefix.&row; 4609 %let &cmacvar = 1; 4610 %local etls_machineId; 4611 %if (&signon eq 1) %then 4612 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 4613 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 4614 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 4615 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 4616 %else %let &cmacvar=0; 4617 4618 data &statusTable; 4619 retain ptr &row; 4620 modify &statusTable point = ptr; 4621 &handleVariable = "&remoteSessionId"; 4622 %if (&signon eq 1) %then 4623 &machineVariable = "&etls_machineId";; 4624 %if (&&&cmacvar ne 0) %then 4625 %do; 4626 &statusVariable = "Failed Signon"; 4627 %end; 4628 %else 4629 &statusVariable = &statusSetting;; 4630 %if (&startTimeVariable ne ) %then 4631 &startTimeVariable = datetime();; 4632 replace; 4633 stop; 4634 run; 4635 4636 %rcSet(&syserr); 4637 %mend etls_createHandle; 4638 4639 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 4640 completeStatusSetting="Finished", endTimeVariable=endTime, 4641 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 4642 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 4643 4644 proc sql noprint; 4645 select count(*) into :etls_rows 4646 from &statusTable where &statusVariable = &runningStatusSetting; 4647 %let etls_rows = &etls_rows; 4648 %if (&etls_rows gt 0) %then 4649 %do; 4650 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 4651 from &statusTable where &statusVariable = &runningStatusSetting; 4652 %end; 4653 quit; 4654 4655 %rcSet(&sqlrc); 4656 4657 %if (&etls_rows gt 0) %then 4658 %do; 4659 waitfor &waitType 4660 %do i=1 %to &etls_rows; 4661 &&etlsHandles&i 4662 %end; 134 The SAS System 12:24 Tuesday, January 12, 2016 4663 ; 4664 %end; 4665 4666 %local useDefaultRCMacVar; 4667 %if ("&returnCodeMacroVariable" eq "") %then 4668 %let useDefaultRCMacVar=Y; 4669 4670 %do i=1 %to &etls_rows; 4671 4672 %if ("&useDefaultRCMacVar"="Y") %then 4673 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 4674 4675 waitfor &&etlsHandles&i timeout=1; 4676 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 4677 %do; 4678 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 4679 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 4680 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 4681 startTimeVariable=&startTimeVariable, signoff=&signoff, 4682 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 4683 statusUnknownReturnCode=&statusUnknownReturnCode, 4684 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 4685 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 4686 %put NOTE: Process &&etlsHandles&i. has completed.; 4687 %end; 4688 %else %if (&SYSRC ne -1) %then /* process status unknown */ 4689 %do; 4690 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 4691 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 4692 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 4693 startTimeVariable=&startTimeVariable, signoff=&signoff, 4694 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 4695 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 4696 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 4697 %end; 4698 %end; 4699 %mend etls_waitfor; 4700 4701 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 4702 statusSetting="Running"); 4703 4704 proc sql noprint; 4705 select count(*) into: &processCountMacro 4706 from &statusTable where &statusVariable = &statusSetting; 4707 quit; 4708 4709 %rcSet(&sqlrc); 4710 %mend etls_getProcessesRunning; 4711 4712 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 4713 %let ¶meterVariableMacro = ; 4714 %let dsid = %sysfunc(open(¶meterTable)); 4715 %if (&dsid gt 0) %then 4716 %do; 4717 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 4718 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 4719 %end; 4720 %let dsid = %sysfunc(close(&dsid)); 135 The SAS System 12:24 Tuesday, January 12, 2016 4721 %end; 4722 %else 4723 %put %sysfunc(sysmsg()); 4724 %rcSet(&syserr); 4725 %mend etls_getParameterNames; 4726 4727 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 4728 data _null_; 4729 length vname $256 vtype $1 value $3200; 4730 dsid = open("¶meterTable"); 4731 if (dsid > 0) then 4732 do; 4733 do _i = 1 to &row; 4734 fetchrc = fetch(dsid); 4735 end; 4736 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 4737 vname = varname(dsid,_i); 4738 vtype = vartype(dsid,_i); 4739 if (fetchrc = 0) then 4740 do; 4741 if (vtype = 'C') then 4742 do; 4743 value = getvarc(dsid,_i); 4744 value = tranwrd(value,"%","%%"); 4745 value = tranwrd(value,"(","%("); 4746 value = tranwrd(value,")","%)"); 4747 value = tranwrd(value,'"','%"'); 4748 end; 4749 else 4750 value = left(put(getvarn(dsid,_i),best32.)); 4751 end; /* fetchrc = 0 */ 4752 4753 put ; 4754 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 4755 do; 4756 value='%str('||trim(value)||')'; 4757 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 4758 end; 4759 %if %str(&handlename) ne %str() %then 4760 %do; 4761 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 4762 %end; 4763 %else 4764 %do; 4765 value = '%let '||trim(vname)||'= '||trim(value)||';'; 4766 %end; 4767 4768 put "NOTE: Setting macro variable " vname "with statement:" value ; 4769 call execute(value); 4770 end; /* do i= */ 4771 dsid = close(dsid); 4772 end; /* dsid > 0 */ 4773 else 4774 do; 4775 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 4776 abort; 4777 end; 4778 stop; 136 The SAS System 12:24 Tuesday, January 12, 2016 4779 run; 4780 4781 %rcSet(&syserr); 4782 %mend etls_getParameters; 4783 4784 %macro etls_loopW6O7ZERX; 4785 %local etls_filePrefix; 4786 %let etls_filePrefix = ; 4787 4788 %macro etls_processToLoopW6O7ZES7(parameterTable=, row=, handleName=rmt); 4789 %etls_getParameters(parameterTable=¶meterTable, row=&row, 4790 startingColumnNumber=1, handleName=&handleName); 4791 %let etls_previousFilePrefix = &etls_filePrefix; 4792 %local etls_filePrefix; 4793 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 4794 %syslput &etls_controlName = &row / remote = &handleName; 4795 %syslput handleName = &handleName / remote = &handleName; 4796 4797 /* Setup to pass macros to remote session */ 4798 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 4799 4800 rsubmit &handleName wait = no sysrputsync = yes persist = no 4801 log = "&etls_logOutputPath./&etls_filePrefix..log" 4802 output = "&etls_logOutputPath./&etls_filePrefix..lst" 4803 ; 4804 4805 %macro etls_jobW6O7ZESH; 4806 4807 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 4808 4809 /****************************************************************************** 4810 * Job: RPODSDW144 A50D7W6R.AQ0011T5 * 4811 * Description: * 4812 * * 4813 * Repository: me_besa A0000001.A50D7W6R * 4814 * Server: besa A5NJAD6Z.AT000001 * 4815 * * 4816 * Source Tables: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 4817 * TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 4818 * TCONTASTATS - ODSBESA.TCONTASTATS A5NJAD6Z.BJ00109Z * 4819 * Target Table: M_ODS_DW144 - GLBBESA.M_ODS_DW144 A5NJAD6Z.BJ00111D * 4820 * * 4821 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 4822 * Generated by: s-bametasasd1\dvbesa * 4823 * Version: 9.1.20060626.51875 * 4824 ******************************************************************************/ 4825 4826 /* Create metadata macro variables */ 4827 %let IOMServer = %nrquote(besa); 4828 %let metaPort = %nrquote(8561); 4829 %let metaServer = %nrquote(s-bametasasd1); 4830 %let metaRepository = %nrquote(me_besa); 4831 4832 /* Set metadata options */ 4833 options metaport = &metaPort 4834 metaserver = "&metaServer" 4835 metarepository = "&metaRepository"; 4836 137 The SAS System 12:24 Tuesday, January 12, 2016 4837 %let jobID = %quote(A50D7W6R.AQ0011T5); 4838 4839 /* Setup to capture return codes */ 4840 %global job_rc trans_rc sqlrc; 4841 %let job_rc = 0; 4842 %let trans_rc = 0; 4843 %let sqlrc = 0; 4844 %global syserr; 4845 4846 %macro rcSet(error); 4847 %if (&error gt &trans_rc) %then 4848 %let trans_rc = &error; 4849 %if (&error gt &job_rc) %then 4850 %let job_rc = &error; 4851 %mend rcSet; 4852 4853 %macro rcSetDS(error); 4854 if &error gt input(symget('trans_rc'),12.) then 4855 call symput('trans_rc',trim(left(put(&error,12.)))); 4856 if &error gt input(symget('job_rc'),12.) then 4857 call symput('job_rc',trim(left(put(&error,12.)))); 4858 %mend rcSetDS; 4859 4860 %global etls_debug; 4861 %macro etls_setDebug; 4862 %if %str(&etls_debug) ne 0 %then 4863 OPTIONS MPRINT%str(;); 4864 %mend; 4865 %etls_setDebug; 4866 4867 %macro genSASCommand; 4868 %local noobjserver; 4869 %if "&sysscp"="OS" %then %let noobjserver=; 4870 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 4871 %else %let noobjserver=%quote(-noobjectserver); 4872 options sascmd = "!sascmd &noobjserver"; 4873 %mend genSASCommand; 4874 %genSASCommand; 4875 4876 /****************************************************************************** 4877 * Macro: * 4878 * etls_tsLevel- Executes a data step using the tslvl function to * 4879 * determine if a feature is installed. * 4880 * * 4881 * Parameters: * 4882 * macroName- Name of macro to hold the value returned from the * 4883 * function call, a blank value indicates the feature is not * 4884 * installed. * 4885 * featureName - Name of feature to test for installation status. * 4886 ******************************************************************************/ 4887 %macro etls_tsLevel(macroName=, featureName=); 4888 data _null_; 4889 call symput("¯oName",tslvl("&featureName")); 4890 run; 4891 %mend etls_tsLevel; 4892 4893 /****************************************************************************** 4894 * Macro: * 138 The SAS System 12:24 Tuesday, January 12, 2016 4895 * etls_signon - Executes a signon to a remote machine. * 4896 * * 4897 * Parameters: * 4898 * handleName - Name of handle to access the remote connection. * 4899 * cmacvar - Macro variable to capture the status of the signon. * 4900 * gridRC- Macro variable to capture the return code of the grid * 4901 * signon. * 4902 * useGrid- A value of 1 will attempt to use a grid for the signon. * 4903 * If the grid functions are not installed then a local signon * 4904 * is performed. * 4905 * machineIdMacroVariable- Name of macro variable to capture the name * 4906 * of the machine used for a grid signon. * 4907 * workloadMacroVariable- Name of macro variable that specifies the * 4908 * workload to use for a grid signon. * 4909 * log - Path to a log file for the signon. * 4910 * output - Path to an output file for the signon. * 4911 * additionalSignonOptions- Any additional options for the signon * 4912 * statement. * 4913 * signonRetries- Integer value of signons to try before quiting. * 4914 * The wait between tries starts at 5 seconds, * 4915 * increments by 5 seconds. * 4916 ******************************************************************************/ 4917 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 4918 gridRC=rc, useGrid=1, 4919 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 4920 log=, output=, additionalSignonOptions=, signonRetries=3); 4921 4922 %let etls_gridInstalled =; 4923 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 4924 4925 %if (&useGrid = 1) %then 4926 %do; 4927 %if ("&etls_gridInstalled" ne "") %then 4928 %do; 4929 %if (&gridRC eq ) %then 4930 %let gridRC = &handleName.RC ; 4931 4932 %global &gridRC; 4933 %let workload = ; 4934 %if (&workloadMacroVariable ne ) %then 4935 %do; 4936 data _null_; 4937 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 4938 run; 4939 %end; 4940 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 4941 %end; 4942 %else 4943 %put %str(NOTE: Grid service functions are not installed.); 4944 %end; 4945 4946 %local sleeptime sleepIncreaseAmount tryCount; 4947 %let sleepIncreaseAmount=5; 4948 %let sleeptime=5; 4949 %let tryCount=1; 4950 %let &cmacvar=1; 4951 4952 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 139 The SAS System 12:24 Tuesday, January 12, 2016 4953 data _null_; 4954 signon &handleName cmacvar=&cmacvar 4955 %if ("&log" ne "") %then 4956 log=&log; 4957 %if ("&output" ne "") %then 4958 output=&output; 4959 %if ("&additionalSignonOptions" ne "") %then 4960 &additionalSignonOptions; 4961 ;run; 4962 4963 %if ("&machineIdMacroVariable" ne "") %then 4964 %do; 4965 %if ("&etls_gridInstalled" ne "") %then 4966 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 4967 %else 4968 %put %str(NOTE: Grid service functions are not installed.); 4969 %end; 4970 4971 %if "&&&cmacvar" eq "1" %then 4972 %do; 4973 %if &tryCount lt %eval(&signonRetries+1) %then 4974 %do; 4975 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 4976 %let rc=%sysfunc(sleep(&sleeptime,1)); 4977 %end; 4978 %else %if &signonRetries gt 0 %then 4979 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 4980 4981 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 4982 %let tryCount=%eval(&tryCount+1); 4983 %end; 4984 %end; 4985 %rcSet(&syserr); 4986 4987 %mend etls_signon; 4988 4989 /****************************************************************************** 4990 * Macro: * 4991 * etls_serverConnected- Tests to see if a connection to a remote * 4992 * exists. * 4993 * * 4994 * Parameters: * 4995 * serverId - Handle to the remote to test. * 4996 * macvarname- Name of macro variable to hold the return value of the * 4997 * status. Will equal 1 if the connection exists, 0 * 4998 * otherwise. Macro variable must be localized before * 4999 * calling this macro. * 5000 ******************************************************************************/ 5001 %macro etls_serverConnected(serverId=,macvarname=isConnected); 5002 %let &macvarname=0; 5003 %local search_str none_str savenotes; 5004 5005 /* setup information for listtask output */ 5006 /* listtask output on OS/390 differs */ 5007 %if %bquote(&sysscp) eq OS %then 5008 %do; 5009 %let search_str=Remote submit for; 5010 %let token=5; 140 The SAS System 12:24 Tuesday, January 12, 2016 5011 %end; 5012 %else 5013 %do; 5014 %let search_str=--------------; 5015 %let token=1; 5016 %end; 5017 5018 /* Issue listtask within PROC PRINTTO - send output to file */ 5019 filename __tmptxt TEMP; 5020 %let savenotes=%sysfunc(getoption(notes)); 5021 options nonotes; 5022 5023 proc printto log=__tmptxt new; 5024 run; 5025 5026 options notes; 5027 listtask; 5028 proc printto; 5029 run; 5030 5031 options nonotes; 5032 5033 /* read in the output from listtask */ 5034 %let dsname=_null_; 5035 data _null_(keep=Session); 5036 length line $256 sessionId $60; 5037 infile __tmptxt length=len; 5038 input @1 line $varying. len; 5039 5040 if line=:'There are no' then 5041 stop; 5042 /* look for the search string and scan for server name */ 5043 if index(line,"&search_str") then 5044 do; 5045 sessionId=scan(line,&token," "); 5046 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 5047 if sessionId=upcase(symget("serverId")) then 5048 do; 5049 call symput("&macvarname","1"); 5050 stop; 5051 end; 5052 end; 5053 run; 5054 filename __tmptxt clear; 5055 options &savenotes; 5056 %mend etls_serverConnected; 5057 5058 /****************************************************************************** 5059 * Macro: * 5060 * etls_signoff- Executes a signoff for a remote session, if a * 5061 * connection still exists. * 5062 * * 5063 * Parameters: * 5064 * handleName - Handle to remote session. * 5065 ******************************************************************************/ 5066 %macro etls_signoff(handleName=rmt); 5067 %local savemprint; 5068 %let savemprint=%sysfunc(getoption(mprint)); 141 The SAS System 12:24 Tuesday, January 12, 2016 5069 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 5070 options nomprint; 5071 %local isConnected; 5072 %etls_serverConnected(serverId=&handleName); 5073 options &savemprint; 5074 %if &isConnected %then 5075 signoff &handleName ;; 5076 %mend etls_signoff; 5077 5078 /****************************************************************************** 5079 * Macro: * 5080 * etls_getHandle- Retrieves the handle for a remote connection from the * 5081 * status table. * 5082 * * 5083 * Parameters: * 5084 * statusTable - Table containing status information. * 5085 * handleVariable- Name of variable holding the handles to the remote * 5086 * connections. * 5087 * row - Row to retrieve the information from. * 5088 ******************************************************************************/ 5089 %macro etls_getHandle(statusTable=, handleVariable=, row=); 5090 %let etls_dsid = %sysfunc(open(&statusTable)); 5091 %if (&etls_dsid = 0) %then 5092 %put %sysfunc(sysmsg()); 5093 %else 5094 %do; 5095 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 5096 %if (&rc ne 0) %then 5097 %put %sysfunc(sysmsg()); 5098 %else 5099 %do; 5100 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 5101 %if (&etls_varnum > 0) %then 5102 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 5103 %else 5104 %put %sysfunc(sysmsg()); 5105 %end; 5106 %let rc = %sysfunc(close(&etls_dsid)); 5107 %end; 5108 %mend etls_getHandle; 5109 5110 /****************************************************************************** 5111 * Macro: * 5112 * etls_freeHandle- Update the status of a remote connection in the * 5113 * status table and optionally signoff the connection. * 5114 * Can update the ending time of the task if an end time * 5115 * is desired. * 5116 * * 5117 * Parameters: * 5118 * statusTable - Table containing status information. * 5119 * statusVariable- Variable in status table that holds the status of * 5120 * the connection. * 5121 * handleVariable- Variable in status table that holds the names of * 5122 * the connection handles. * 5123 * handleName - Name of handle to access the remote connection. * 5124 * statusSetting- Value to set the status variable to once the * 5125 * process is complete, value must be quoted if this is * 5126 * character variable. * 142 The SAS System 12:24 Tuesday, January 12, 2016 5127 * endTimeVariable- Variable that contains the end time for the * 5128 * processes in the status table. * 5129 * startTimeVariable- Variable that contains the start time for the * 5130 * processes in the status table. * 5131 * signoff- Indicates whether this macro should signoff the * 5132 * connection to a remote, a value of 1 indicates a signoff * 5133 * should be made. * 5134 * returnCodeVariable- Variable in the status table that contains the * 5135 * return code for the individual processes. * 5136 * returnCodeMacroVariable- Macro variable holding the value for the * 5137 * processes return code. * 5138 * setMainJobRC- Indicates whether this macro should update the main * 5139 * job_rc for the outer process. * 5140 * statusUnknownReturnCode- Numeric value to set the status to if the * 5141 * status of the process cannot be determined. * 5142 ******************************************************************************/ 5143 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 5144 handleName=, statusSetting="Finished", 5145 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 5146 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 5147 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 5148 5149 %if ("&statusTable" ne "") %then 5150 %do; 5151 %local etls_rcMacroVarExisted; 5152 %let etls_rcMacroVarExisted = 0; 5153 %if ("&returnCodeMacroVariable" ne "") %then 5154 %do; 5155 proc sql noprint; 5156 select '1' into: etls_rcMacroVarExisted from dictionary.macros 5157 where name=upcase("&returnCodeMacroVariable"); 5158 quit; 5159 5160 %rcSet(&sqlrc); 5161 %if (&etls_rcMacroVarExisted = 0) %then 5162 %do; 5163 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 5164 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 5165 %end; 5166 %if (&setMainJobRC eq 1) %then 5167 %rcSet(&&&returnCodeMacroVariable); 5168 %end; 5169 %else 5170 %do; 5171 %let returnCodeMacroVariable=etls_rcmacvar; 5172 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 5173 %end; 5174 5175 %local etls_startTimeMacroVarExisted; 5176 %let etls_startTimeMacroVarExisted = 0; 5177 %if ("&startTimeMacroVariable" ne "") %then 5178 %do; 5179 proc sql noprint; 5180 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 5181 where name=upcase("&startTimeMacroVariable"); 5182 quit; 5183 5184 %rcSet(&sqlrc); 143 The SAS System 12:24 Tuesday, January 12, 2016 5185 %if (&etls_startTimeMacroVarExisted = 0) %then 5186 %do; 5187 %put WARNING: Start time from inner job not found. No value will be set.; 5188 %let &startTimeMacroVariable=; 5189 %end; 5190 %end; 5191 5192 %local etls_endTimeMacroVarExisted; 5193 %let etls_endTimeMacroVarExisted = 0; 5194 %if ("&endTimeMacroVariable" ne "") %then 5195 %do; 5196 proc sql noprint; 5197 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 5198 where name=upcase("&endTimeMacroVariable"); 5199 quit; 5200 5201 %rcSet(&sqlrc); 5202 %if (&etls_endTimeMacroVarExisted = 0) %then 5203 %do; 5204 %put WARNING: End time from inner job not found. Setting end time to current time.; 5205 %let &endTimeMacroVariable=%sysfunc(datetime()); 5206 %end; 5207 %end; 5208 5209 data &statusTable; 5210 modify &statusTable(where=(&handleVariable = &handleName)); 5211 %if ("&startTimeMacroVariable" ne "") %then 5212 %do; 5213 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 5214 %end; 5215 %if ("&endTimeVariable" ne "") %then 5216 %do; 5217 %if ("&endTimeMacroVariable" ne "") %then 5218 %do; 5219 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 5220 %end; 5221 %else 5222 &endTimeVariable = datetime();; 5223 %end; 5224 %if ("&returnCodeVariable" ne "") %then 5225 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 5226 %if ("&statusVariable" ne "") %then 5227 %do; 5228 if (symget("etls_rcMacroVarExisted") eq "0") then 5229 &statusVariable = "Unknown Status"; 5230 else 5231 &statusVariable = &statusSetting; 5232 %end; 5233 call symput('handle',&handleVariable); 5234 replace; 5235 stop; 5236 run; 5237 5238 %rcSet(&syserr); 5239 5240 %if (&signoff eq 1) %then 5241 %etls_signoff(handleName=&handle); 5242 %end; 144 The SAS System 12:24 Tuesday, January 12, 2016 5243 %mend etls_freeHandle; 5244 5245 /****************************************************************************** 5246 * Macro: * 5247 * etls_createHandle- Creates a handle name for a connect session and * 5248 * optionally signon to the session. * 5249 * * 5250 * Parameters: * 5251 * statusTable - Table that holds status of connections. * 5252 * statusVariable- Variable in status table that holds the status of * 5253 * the connection. * 5254 * handleVariable- Variable in status table that holds the names of * 5255 * the connection handles. * 5256 * handlePrefix- Prefix for the names of the handles, a number will * 5257 * be appended representing the row number in the table. * 5258 * workloadMacroVariable - Specification for the grid workload option. * 5259 * row - Row number in the status table to update. * 5260 * machineVariable- Variable in status table holding the name of * 5261 * machine running the task. * 5262 * statusSetting- Value to set the status variable to once the handle * 5263 * connection is made, value must be quoted if this is * 5264 * character variable. * 5265 * signon - A value of 1 will execute the signon statement. * 5266 * useGrid - A value of 1 will attempt to use a grid for the signon. * 5267 * log - Path to a log file for the signon. * 5268 * output - Path to an output file for the signon. * 5269 * gridRC- Macro variable to capture the return code of the grid * 5270 * signon. * 5271 * cmacvar - Macro variable to capture the status of the signon. * 5272 * additionalSignonOptions- Any additional options for the signon * 5273 * statement. * 5274 * signonRetries- Integer value of signons to try before quiting. * 5275 * The wait between tries starts at 5 seconds, * 5276 * increments by 5 seconds. * 5277 ******************************************************************************/ 5278 %macro etls_createHandle(statusTable=, statusVariable=, 5279 handleVariable=, handlePrefix=rmt, 5280 workloadMacroVariable=, row=, machineVariable=, 5281 statusSetting="Running", startTimeVariable=startTime, 5282 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 5283 additionalSignonOptions=, signonRetries= ); 5284 5285 %local remoteSessionId; 5286 %let remoteSessionId = &handlePrefix.&row; 5287 %let &cmacvar = 1; 5288 %local etls_machineId; 5289 %if (&signon eq 1) %then 5290 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 5291 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 5292 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 5293 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 5294 %else %let &cmacvar=0; 5295 5296 data &statusTable; 5297 retain ptr &row; 5298 modify &statusTable point = ptr; 5299 &handleVariable = "&remoteSessionId"; 5300 %if (&signon eq 1) %then 145 The SAS System 12:24 Tuesday, January 12, 2016 5301 &machineVariable = "&etls_machineId";; 5302 %if (&&&cmacvar ne 0) %then 5303 %do; 5304 &statusVariable = "Failed Signon"; 5305 %end; 5306 %else 5307 &statusVariable = &statusSetting;; 5308 %if (&startTimeVariable ne ) %then 5309 &startTimeVariable = datetime();; 5310 replace; 5311 stop; 5312 run; 5313 5314 %rcSet(&syserr); 5315 %mend etls_createHandle; 5316 5317 /****************************************************************************** 5318 * Macro: * 5319 * etls_waitfor- Executes a waitfor statement based on the status * 5320 * setting of processes in the status table. Will * 5321 * optionally perform a etls_freeHandle call if the process * 5322 * has completed. * 5323 * * 5324 * Parameters: * 5325 * statusTable - Table containing status information. * 5326 * statusVariable- Variable in status table that holds the status of * 5327 * the connection. * 5328 * runningStatusSetting- Value that indicates that the process is * 5329 * running, value must be quoted if this is * 5330 * character variable. * 5331 * handleVariable- Variable in status table that holds the names of * 5332 * the connection handles. * 5333 * completeStatusSetting- Value to set the status variable to once * 5334 * the process is complete, value must be quoted * 5335 * if this is character variable. * 5336 * endTimeVariable- Variable that contains the end time for the * 5337 * processes in the status table. * 5338 * startTimeVariable- Variable that contains the start time for the * 5339 * processes in the status table. * 5340 * waitType- Type of waitfor to perform; valid values are , * 5341 * _ANY_, or _ALL_. * 5342 * signoff- Indicates whether this macro should signoff the * 5343 * connection to a remote, a value of 1 indicates a signoff * 5344 * should be made. * 5345 * returnCodeVariable- Variable in the status table that contains the * 5346 * return code for the individual processes. * 5347 * returnCodeMacroVariable- Macro variable holding the value for the * 5348 * processes return code. * 5349 * statusUnknownReturnCode- Numeric value to set the status to if the * 5350 * status of the process cannot be determined. * 5351 ******************************************************************************/ 5352 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 5353 completeStatusSetting="Finished", endTimeVariable=endTime, 5354 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 5355 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 5356 5357 proc sql noprint; 5358 select count(*) into :etls_rows 146 The SAS System 12:24 Tuesday, January 12, 2016 5359 from &statusTable where &statusVariable = &runningStatusSetting; 5360 %let etls_rows = &etls_rows; 5361 %if (&etls_rows gt 0) %then 5362 %do; 5363 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 5364 from &statusTable where &statusVariable = &runningStatusSetting; 5365 %end; 5366 quit; 5367 5368 %rcSet(&sqlrc); 5369 5370 %if (&etls_rows gt 0) %then 5371 %do; 5372 waitfor &waitType 5373 %do i=1 %to &etls_rows; 5374 &&etlsHandles&i 5375 %end; 5376 ; 5377 %end; 5378 5379 %local useDefaultRCMacVar; 5380 %if ("&returnCodeMacroVariable" eq "") %then 5381 %let useDefaultRCMacVar=Y; 5382 5383 %do i=1 %to &etls_rows; 5384 5385 %if ("&useDefaultRCMacVar"="Y") %then 5386 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 5387 5388 waitfor &&etlsHandles&i timeout=1; 5389 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 5390 %do; 5391 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 5392 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 5393 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 5394 startTimeVariable=&startTimeVariable, signoff=&signoff, 5395 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 5396 statusUnknownReturnCode=&statusUnknownReturnCode, 5397 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 5398 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 5399 %put NOTE: Process &&etlsHandles&i. has completed.; 5400 %end; 5401 %else %if (&SYSRC ne -1) %then /* process status unknown */ 5402 %do; 5403 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 5404 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 5405 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 5406 startTimeVariable=&startTimeVariable, signoff=&signoff, 5407 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 5408 statusUnknownReturnCode=&statusUnknownReturnCode, 5408 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 5409 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 5410 %end; 5411 %end; 5412 %mend etls_waitfor; 5413 5414 /****************************************************************************** 5415 * Macro: * 147 The SAS System 12:24 Tuesday, January 12, 2016 5416 * etls_getProcessesRunning- Gets the number of processes running by * 5417 * querying the status table. * 5418 * * 5419 * Parameters: * 5420 * statusTable - Table containing status information. * 5421 * statusVariable- Variable in status table that holds the status of * 5422 * the connection. * 5423 * processCountMacro- Macro variable to contain the value of the * 5424 * number of processes running. Macro variable must * 5425 * be localized before calling this macro. * 5426 * statusSetting- Value that indicates that the process is running, * 5427 * value must be quoted if this is character variable. * 5428 ******************************************************************************/ 5429 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 5430 statusSetting="Running"); 5431 5432 proc sql noprint; 5433 select count(*) into: &processCountMacro 5434 from &statusTable where &statusVariable = &statusSetting; 5435 quit; 5436 5437 %rcSet(&sqlrc); 5438 %mend etls_getProcessesRunning; 5439 5440 /*============================================================================* 5441 * Step: SAS Extract A50D7W6R.AR002W68 * 5442 * Transform: Extract * 5443 * Description: * 5444 * * 5445 * Source Table: TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 5446 * Target Table: Extract Target - work.W6M1849P A50D7W6R.AY002YHI * 5447 *============================================================================*/ 5448 5449 /* Access the data for ODSBESA */ 5450 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 5450 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 5451 %rcSet(&syslibrc); 5452 5453 %let SYSLAST = %nrquote(ODSBESA.TCONTA); 5454 5455 %let transformID = %quote(A50D7W6R.AR002W68); 5456 5457 %let trans_rc = 0; 5458 5459 proc datasets lib = work nolist nowarn memtype = (data view); 5460 delete W6M1849P; 5461 quit; 5462 5463 proc sql; 5464 create table work.W6M1849P as 5465 select IDENT length = 4 label = 'IDENT', 5466 CDCONTRATO length = 16 label = 'CDCONTRATO', 5467 DTCREATE length = 8 label = 'DTCREATE', 5468 CDCLIENTE length = 9 label = 'CDCLIENTE', 5469 CDMOEDA length = 3 label = 'CDMOEDA', 5470 MTACTUAL length = 8 label = 'MTACTUAL' 5471 from &SYSLAST 5472 where IDENT = %MT_IDENT and DTCREATE = &DataParam.; 148 The SAS System 12:24 Tuesday, January 12, 2016 5473 quit; 5474 5475 %let SYSLAST = work.W6M1849P; 5476 5477 %rcSet(&sqlrc); 5478 5479 /*============================================================================* 5480 * Step: SAS Extract A50D7W6R.AR002W65 * 5481 * Transform: Extract * 5482 * Description: * 5483 * * 5484 * Source Table: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 5485 * Target Table: Extract Target - work.W69PR0DQ A50D7W6R.AY002YHD * 5486 *============================================================================*/ 5487 5488 %let SYSLAST = %nrquote(ODSBESA.TCLIENTE); 5489 5490 %let transformID = %quote(A50D7W6R.AR002W65); 5491 5492 %let trans_rc = 0; 5493 5494 proc datasets lib = work nolist nowarn memtype = (data view); 5495 delete W69PR0DQ; 5496 quit; 5497 5498 proc sql; 5499 create table work.W69PR0DQ as 5500 select IDENT length = 4 label = 'IDENT', 5501 CDCLIENTE length = 9 label = 'CDCLIENTE', 5502 CDGESTORCONTA length = 9 label = 'CDGESTORCONTA', 5503 CDBALCAO length = 3 label = 'CDBALCAO' 5504 from &SYSLAST 5505 where IDENT = %MT_IDENT & DTCHANGE <= &DataParam & DTENDCHANGE >= &DataParam; 5506 quit; 5507 5508 %let SYSLAST = work.W69PR0DQ; 5509 5510 %rcSet(&sqlrc); 5511 5512 /*============================================================================* 5513 * Step: SQL Join A50D7W6R.AR002W62 * 5514 * Transform: SQL Join (Version 2) * 5515 * Description: * 5516 * * 5517 * Source Tables: Extract Target - work.W69PR0DQ A50D7W6R.AY002YHD * 5518 * Extract Target - work.W6M1849P A50D7W6R.AY002YHI * 5519 * Target Table: SQL Target - work.W69PR0KB A50D7W6R.AY002YHE * 5520 *============================================================================*/ 5521 5522 %let transformID = %quote(A50D7W6R.AR002W62); 5523 5524 %let trans_rc = 0; 5525 5526 proc datasets lib = work nolist nowarn memtype = (data view); 5527 delete W69PR0KB; 5528 quit; 5529 5530 proc sql; 149 The SAS System 12:24 Tuesday, January 12, 2016 5531 create table work.W69PR0KB as 5532 select 5533 W69PR0DQ.IDENT length = 4 5534 format = $4. 5535 informat = $4. 5536 label = 'IDENT', 5537 W69PR0DQ.CDCLIENTE length = 9 5538 format = $9. 5539 informat = $9. 5540 label = 'CDCLIENTE', 5541 W69PR0DQ.CDGESTORCONTA length = 9 5542 format = $9. 5543 informat = $9. 5544 label = 'CDGESTORCONTA', 5545 W69PR0DQ.CDBALCAO length = 3 5546 format = $3. 5547 informat = $3. 5548 label = 'CDBALCAO', 5549 W6M1849P.CDCONTRATO length = 16 5550 format = $16. 5551 informat = $16. 5552 label = 'CDCONTRATO', 5553 W6M1849P.CDMOEDA length = 3 5554 format = $3. 5555 informat = $3. 5556 label = 'CDMOEDA', 5557 W6M1849P.MTACTUAL length = 8 5558 format = 25.3 5559 informat = 25.3 5560 label = 'MTACTUAL' 5561 from 5562 work.W69PR0DQ, 5563 work.W6M1849P 5564 where 5565 W69PR0DQ.IDENT = W6M1849P.IDENT 5566 and W69PR0DQ.CDCLIENTE = W6M1849P.CDCLIENTE 5567 ; 5568 quit; 5569 5570 %rcSet(&sqlrc); 5571 5572 %macro etls_completeTarget(); 5573 %mend etls_completeTarget; 5574 %etls_completeTarget; 5575 5576 /*============================================================================* 5577 * Step: SQL Join A50D7W6R.AR002W67 * 5578 * Transform: SQL Join (Version 2) * 5579 * Description: * 5580 * * 5581 * Source Tables: SQL Target - work.W69PR0KB A50D7W6R.AY002YHE * 5582 * TCONTASTATS - ODSBESA.TCONTASTATS A5NJAD6Z.BJ00109Z * 5583 * Target Table: SQL Target - work.W6M17NTP A50D7W6R.AY002YHH * 5584 *============================================================================*/ 5585 5586 %let transformID = %quote(A50D7W6R.AR002W67); 5587 5588 %let trans_rc = 0; 150 The SAS System 12:24 Tuesday, January 12, 2016 5589 5590 proc datasets lib = work nolist nowarn memtype = (data view); 5591 delete W6M17NTP; 5592 quit; 5593 5594 proc sql; 5595 create table work.W6M17NTP as 5596 select 5597 W69PR0KB.IDENT length = 4 5598 format = $4. 5599 informat = $4. 5600 label = 'IDENT', 5601 W69PR0KB.CDCLIENTE length = 9 5602 format = $9. 5603 informat = $9. 5604 label = 'CDCLIENTE', 5605 W69PR0KB.CDGESTORCONTA length = 9 5606 format = $9. 5607 informat = $9. 5608 label = 'CDGESTORCONTA', 5609 W69PR0KB.CDBALCAO length = 3 5610 format = $3. 5611 informat = $3. 5612 label = 'CDBALCAO', 5613 W69PR0KB.CDCONTRATO length = 16 5614 format = $16. 5615 informat = $16. 5616 label = 'CDCONTRATO', 5617 W69PR0KB.CDMOEDA length = 3 5618 format = $3. 5619 informat = $3. 5620 label = 'CDMOEDA', 5621 case 5622 when W69PR0KB.MTACTUAL > 0 5623 then 'C' 5624 else 'D' 5625 end as INDRCR length = 1 5626 format = $1. 5627 informat = $1., 5628 TCONTASTATS.MTSALDOMEDIO length = 8 5629 format = 26.3 5630 informat = 26.3 5631 label = 'MTSALDOMEDIO', 5632 %f_get_cambio(TCONTASTATS.MTSALDOMEDIO , W69PR0KB.CDMOEDA ,'USD',&DataParam, ) as MTSALDOMEDIO_USD 5632 ! length = 8 5633 format = 26.3 5634 informat = 26.3 5635 label = 'MTSALDOMEDIO_USD' 5636 from 5637 work.W69PR0KB left join 5638 ODSBESA.TCONTASTATS 5639 on 5640 ( 5641 W69PR0KB.IDENT = TCONTASTATS.IDENT 5642 and TRIM(W69PR0KB.CDCONTRATO) = TRIM(TCONTASTATS.CDCONTRATO) 5643 and TCONTASTATS.DTCREATE = &DataParam 5644 ) 5645 ; 151 The SAS System 12:24 Tuesday, January 12, 2016 5646 quit; 5647 5648 %rcSet(&sqlrc); 5649 5650 %macro etls_completeTarget(); 5651 %mend etls_completeTarget; 5652 %etls_completeTarget; 5653 5654 /*============================================================================* 5655 * Step: DEL_BY_DATE A50D7W6R.AR002W69 * 5656 * Transform: DEL_BY_DATE * 5657 * Description: * 5658 * * 5659 * Source Table: SQL Target - work.W6M17NTP A50D7W6R.AY002YHH * 5660 * Target Table: DEL_BY_DATE - work.W6M189NN A50D7W6R.AY002YHJ * 5661 *============================================================================*/ 5662 5663 %let SYSLAST = %nrquote(work.W6M17NTP); 5664 5665 %let transformID = %quote(A50D7W6R.AR002W69); 5666 5667 %let trans_rc = 0; 5668 5669 /* Source table(s)/view(s) */ 5670 %let _INPUT1 = work.W6M17NTP; 5671 5672 /* Target table/view(s) */ 5673 %let _OUTPUT = work.W6M189NN; 5674 %let _OUTPUT1 = work.W6M189NN; 5675 5676 /* Delete target table(s) */ 5677 proc datasets lib=work nolist nowarn memtype = (data view); 5678 delete W6M189NN; 5679 quit; 5680 5681 /* Options */ 5682 %let data_col = %nrquote(DTPROC); 5683 %let rel_table = %nrquote(GLBBESA.M_ODS_DW144); 5684 %let data_apagar = %nrquote(&Dataparam); 5685 5686 /* List of target columns to keep */ 5687 %let keep = IDENT CDCLIENTE CDGESTORCONTA CDBALCAO CDCONTRATO CDMOEDA 5688 INDRCR MTSALDOMEDIO MTSALDOMEDIO_USD; 5689 5690 %macro connect_oracle(schema); 5691 5692 connect to ORACLE 5693 ( 5694 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 5695 PATH = &ORACLE_CTB_SID 5696 USER = &ORACLE_CTB_USER 5697 PASSWORD = &ORACLE_CTB_PASSWORD 5698 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 5699 PATH = &ORACLE_DM_SID 5700 USER = &ORACLE_DM_USER 5701 PASSWORD = &ORACLE_DM_PASSWORD 5702 %END; 5703 ) 152 The SAS System 12:24 Tuesday, January 12, 2016 5704 5705 5706 %mend connect_oracle; 5707 5708 %macro tab_oracle(tabela); 5709 %let schema=%scan(&tabela,1); 5710 %IF %UPCASE(&schema) = GLBBESA 5711 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 5712 %ELSE %DO; &tabela %END; 5713 5714 5715 %mend tab_oracle; 5716 5717 5718 5719 5720 5721 /* Converte data DateTime em Data */ 5722 data _null_; 5723 format a Datetime.; 5724 a = &data_apagar; 5725 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 5726 run; 5727 5728 5729 5730 proc sql; 5731 %connect_oracle(%scan(&rel_table,1)); 5732 5733 execute( 5734 delete from %tab_oracle(&rel_table) 5735 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 5736 5737 disconnect from ORACLE; 5738 quit; 5739 5740 5741 proc sql; 5742 create view &_OUTPUT1 as 5743 select * 5744 from &_INPUT1; 5745 quit; 5746 5747 5748 5749 5750 5751 %rcSet(&syserr); 5752 %rcSet(&sysrc); 5753 %rcSet(&sqlrc); 5754 5755 /*============================================================================* 5756 * Step: Table Loader A50D7W6R.AR002W66 * 5757 * Transform: Table Loader (Version 2) * 5758 * Description: * 5759 * * 5760 * Source Table: DEL_BY_DATE - work.W6M189NN A50D7W6R.AY002YHJ * 5761 * Target Table: M_ODS_DW144 - GLBBESA.M_ODS_DW144 A5NJAD6Z.BJ00111D * 153 The SAS System 12:24 Tuesday, January 12, 2016 5762 *============================================================================*/ 5763 5764 /* Access the data for GLBBESA */ 5765 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 5765 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 5766 %rcSet(&syslibrc); 5767 5768 %let SYSLAST = %nrquote(work.W6M189NN); 5769 5770 %let transformID = %quote(A50D7W6R.AR002W66); 5771 5772 %let trans_rc = 0; 5773 5774 %global etls_tableExist; 5775 %global etls_numIndex; 5776 %global etls_lastTable; 5777 %let etls_tableExist = -1; 5778 %let etls_numIndex = -1; 5779 %let etls_lastTable = &SYSLAST; 5780 5781 /*---- Define load data macro ----*/ 5782 %macro etls_loader; 5783 5784 %let SYSOPT = ; 5785 5786 /*---- Map the columns ----*/ 5787 proc datasets lib = work nolist nowarn memtype = (data view); 5788 delete mapped; 5789 quit; 5790 5791 %put %str(NOTE: Mapping columns ...); 5792 proc sql; 5793 create view work.mapped as 5794 select IDENT length = 4, 5795 (put(datepart(&dataparam),yymmdd10.)) as DTPROC length = 10 format = $10. informat = $10., 5796 CDCLIENTE length = 9, 5797 CDCONTRATO length = 16, 5798 CDBALCAO length = 3, 5799 CDGESTORCONTA length = 9, 5800 INDRCR length = 1, 5801 CDMOEDA length = 3, 5802 MTSALDOMEDIO length = 8, 5803 MTSALDOMEDIO_USD length = 8 5804 from &etls_lastTable; 5805 quit; 5806 5807 %let SYSLAST = work.mapped; 5808 5809 %let etls_lastTable = &SYSLAST; 5810 %let SYSOPT = ; 5811 5812 /* Determine if the target table exists */ 5813 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW144, DATA)) or 5814 %sysfunc(exist(GLBBESA.M_ODS_DW144, VIEW))); 5815 5816 /*---- Create a new table ----*/ 5817 %if (&etls_tableExist eq 0) %then 5818 %do; /* if table does not exist */ 154 The SAS System 12:24 Tuesday, January 12, 2016 5819 5820 %put %str(NOTE: Creating table ...); 5821 5822 data GLBBESA.M_ODS_DW144 5823 (dbnull = ( 5824 IDENT = YES 5825 DTPROC = YES 5826 CDCLIENTE = YES 5827 CDCONTRATO = YES 5828 CDBALCAO = YES 5829 CDGESTORCONTA = YES 5830 INDRCR = YES 5831 CDMOEDA = YES 5832 MTSALDOMEDIO = YES 5833 MTSALDOMEDIO_USD = YES)); 5834 attrib IDENT length = $4 format = $4. informat = $4. 5835 label = 'IDENT'; 5836 attrib DTPROC length = $10 format = $10. informat = $10. 5837 label = 'DTPROC'; 5838 attrib CDCLIENTE length = $9 format = $9. informat = $9. 5839 label = 'CDCLIENTE'; 5840 attrib CDCONTRATO length = $16 format = $16. informat = $16. 5841 label = 'CDCONTRATO'; 5842 attrib CDBALCAO length = $3 format = $3. informat = $3. 5843 label = 'CDBALCAO'; 5844 attrib CDGESTORCONTA length = $9 format = $9. informat = $9. 5845 label = 'CDGESTORCONTA'; 5846 attrib INDRCR length = $1 format = $1. informat = $1. 5847 label = 'INDRCR'; 5848 attrib CDMOEDA length = $3 format = $3. informat = $3. 5849 label = 'CDMOEDA'; 5850 attrib MTSALDOMEDIO length = 8 5851 label = 'MTSALDOMEDIO'; 5852 attrib MTSALDOMEDIO_USD length = 8 5853 label = 'MTSALDOMEDIO_USD'; 5854 stop; 5855 run; 5856 5857 %rcSet(&syserr); 5858 5859 %end; /* if table does not exist */ 5860 5861 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 5862 5863 /*---- Append new data ----*/ 5864 %put %str(NOTE: Appending data ...); 5865 5866 proc append base = GLBBESA.M_ODS_DW144 5867 data = &etls_lastTable (&SYSOPT) force; 5868 run; 5869 5870 %rcSet(&syserr); 5871 5872 proc datasets lib = work nolist nowarn memtype = (data view); 5873 delete mapped; 5874 quit; 5875 5876 %mend etls_loader; 155 The SAS System 12:24 Tuesday, January 12, 2016 5877 %etls_loader; 5878 5879 %sysrput job_rc&handleName = &job_rc; 5880 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 5881 5882 %mend etls_jobW6O7ZESH; 5883 5884 %etls_jobW6O7ZESH; 5885 5886 endrsubmit; 5887 5888 %mend etls_processToLoopW6O7ZES7; 5889 5890 %local etls_controlTable etls_statusTable etls_controlName 5891 etls_processesRunning etls_maxProcesses etls_parameterTable 5892 etls_additionalSignonOptions etls_signonRetries; 5893 %let etls_controlName = L78_; 5894 %let etls_statusTable = work.W6M2B9EQ; 5895 %let etls_parameterTable = work.W6O7ZESR; 5896 %let etls_workload = ; 5897 %let etls_additionalSignonOptions = ; 5898 %let etls_signonRetries = 3; 5899 %let &etls_controlName = 0; 5900 %let etls_controlTable = work.W6M2B9BO; 5901 5902 %put %str(NOTE: Creating status table...); 5903 data &etls_statusTable 5904 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 5905 etls_status etls_jobRC DTFIM 5906 ); 5907 attrib etls_handleName length = $32 5908 label = 'Name of handle to remote session'; 5909 attrib etls_machineId length = $32 5910 label = 'Name of machine executing the task'; 5911 attrib etls_startTime length = 8 format = nldatmap. 5912 label = 'Start time of task'; 5913 attrib etls_endTime length = 8 format = nldatmap. 5914 label = 'End time of task'; 5915 attrib etls_status length = $32 5916 label = 'Current status of task'; 5917 attrib etls_jobRC length = 8 5918 label = 'Return code of task'; 5919 set &etls_controlTable; 5920 run; 5921 5922 %rcSet(&syserr); 5923 5924 %put %str(NOTE: Creating parameter table...); 5925 proc sql; 5926 create table &etls_parameterTable as 5927 select DTFIM as DataParam 5928 from &etls_controlTable; 5929 quit; 5930 5931 %rcSet(&sqlrc); 5932 5933 /* Get the number of times to iterate from the number of rows in the source */ 5934 /* table */ 156 The SAS System 12:24 Tuesday, January 12, 2016 5935 proc sql noprint; 5936 select count(*) into :&etls_controlName._max from &etls_statusTable; 5937 %let &etls_controlName._max = &&&etls_controlName._max; 5938 quit; 5939 5940 %rcSet(&sqlrc); 5941 5942 %let etls_gridInstalled =; 5943 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 5944 5945 %if (%str(&etls_gridInstalled) ne %str()) %then 5946 %do; 5947 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 5948 %if (&etls_maxProcesses = 0) %then 5949 %do; 5950 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 5951 processes to SYSNCPU value.); 5952 %let etls_maxProcesses = &SYSNCPU; 5953 %end; 5954 %end; 5955 %else 5956 %do; 5957 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 5958 processes to SYSNCPU value.); 5959 %let etls_maxProcesses = &SYSNCPU; 5960 %end; 5961 5962 %if (&etls_maxProcesses > 0) %then 5963 %do; 5964 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 5965 5966 %let etls_lastLoopPtr = &&&etls_controlName; 5967 5968 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 5969 processCountMacro=etls_processesRunning, statusSetting="Running"); 5970 5971 %do %while(&etls_processesRunning lt &&&etls_controlName._max 5972 and &etls_processesRunning lt &etls_maxProcesses 5973 and &&&etls_controlName lt &&&etls_controlName._max); 5974 5975 %let &etls_controlName = %eval(&&&etls_controlName+1); 5976 5977 %global etls_signonStatus; 5978 %let etls_logOutputPath = &DIR_PRJ_LOG.; 5979 5980 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 5981 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 5982 row=&&&etls_controlName, machineVariable=etls_machineId, 5983 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 5984 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 5985 5986 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 5987 processCountMacro=etls_processesRunning, statusSetting="Running"); 5988 5989 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 5990 %etls_processToLoopW6O7ZES7(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 5991 handleName=%etls_getHandle(statusTable=&etls_statusTable, 5992 handleVariable=etls_handleName, row=&&&etls_controlName)); 157 The SAS System 12:24 Tuesday, January 12, 2016 5993 %else 5994 %do; /* if signon error, set iterator to max to force loop to stop. */ 5995 %let &etls_controlName = &&&etls_controlName._max; 5996 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 5997 %end; 5998 %end; 5999 6000 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 6001 runningStatusSetting="Running", handleVariable=etls_handleName, 6002 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 6003 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 6004 returnCodeVariable=etls_jobRC, 6005 statusUnknownReturnCode=.); 6006 6007 %end; 6008 6009 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 6010 runningStatusSetting="Running", handleVariable=etls_handleName, 6011 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 6012 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 6013 returnCodeVariable=etls_jobRC, 6014 statusUnknownReturnCode=.); 6015 6016 %end; 6017 6018 proc datasets lib = work nolist nowarn memtype = (data view); 6019 delete W6O7ZESR; 6020 quit; 6021 6022 %mend etls_loopW6O7ZERX; 6023 6024 %etls_loopW6O7ZERX; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_LOOPW6O7ZERX): data work.W6M2B9EQ (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZERX): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6M2B9BO MPRINT(ETLS_LOOPW6O7ZERX): set work.W6M2B9BO; MPRINT(ETLS_LOOPW6O7ZERX): run; NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W6M2B9BO. NOTE: The data set WORK.W6M2B9EQ has 1 observations and 7 variables. NOTE: Compressing data set WORK.W6M2B9EQ increased size by 100.00 percent. Compressed is 2 pages; un-compressed would require 1 pages. NOTE: DATA statement used (Total process time): 158 The SAS System 12:24 Tuesday, January 12, 2016 real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERX): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZERX): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZESR SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6M2B9BO MPRINT(ETLS_LOOPW6O7ZERX): create table work.W6O7ZESR as select DTFIM as DataParam from work.W6M2B9BO; NOTE: Compression was disabled for data set WORK.W6O7ZESR because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZESR created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZERX): quit; 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 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERX): ; MPRINT(ETLS_LOOPW6O7ZERX): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_LOOPW6O7ZERX): select count(*) into :L78__max from work.W6M2B9EQ; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZERX): quit; NOTE: PROCEDURE SQL used (Total process time): 159 The SAS System 12:24 Tuesday, January 12, 2016 real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 226k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZERX): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZERX): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6M2B9EQ where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds 160 The SAS System 12:24 Tuesday, January 12, 2016 system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZERX): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L78_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L78_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc 161 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable GRIDRC resolves to L78_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L78_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L78_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.10 seconds cpu time 0.07 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_work983C00000122_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.12 seconds user cpu time 0.04 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 107 Involuntary Context Switches 3 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_work983C00000122_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L78_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.03 seconds user cpu time 0.00 seconds system cpu time 0.02 seconds Memory 223k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 26 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 NOTE: Connection is not grid enabled;the request did not return a value. 162 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_CREATEHANDLE): data work.W6M2B9EQ; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_CREATEHANDLE): modify work.W6M2B9EQ point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L78_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L78_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W6M2B9EQ has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 309k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 163 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZERX): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6M2B9EQ where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZERX): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZESR SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESR SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 164 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESR MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZESR"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L78_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESR MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZESR, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable DataParam with statement:%syslput DataParam= 1764460800 / remote = L78_1; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 165 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZES7): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L78_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L78_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L78_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZES7): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L78_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L78_1.lst" ; 162 The SAS System 12:26 Tuesday, January 12, 2016 NOTE: Background remote submit to L78_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status 174 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6M2B9EQ where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W6M2B9EQ where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 NOTE: Remote signoff from L78_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 2:47.36 user cpu time 32.41 seconds system cpu time 31.56 seconds Memory 28251k Page Faults 0 Page Reclaims 995 Page Swaps 0 Voluntary Context Switches 216587 Involuntary Context Switches 2671 Block Input Operations 2 Block Output Operations 188 NOTE: Remote signoff from L78_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L78_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" 175 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL78_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL78_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL78_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL78_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 1 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL78_1 SYMBOLGEN: Macro variable JOB_RCL78_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L78_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L78_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L78_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k 176 The SAS System 12:24 Tuesday, January 12, 2016 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L78_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L78_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L78_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_FREEHANDLE): data work.W6M2B9EQ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L78_1" MPRINT(ETLS_FREEHANDLE): modify work.W6M2B9EQ(where=(etls_handleName = "L78_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L78_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L78_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L78_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L78_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L78_1 177 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L78_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL78_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL78_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W6M2B9EQ. WHERE etls_handleName='L78_1'; NOTE: The data set WORK.W6M2B9EQ has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L78_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L78_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 8k Page Faults 0 178 The SAS System 12:24 Tuesday, January 12, 2016 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L78_1 NOTE: Process L78_1 has completed. MPRINT(ETLS_LOOPW6O7ZERX): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L78_ SYMBOLGEN: Macro variable L78__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6M2B9EQ MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6M2B9EQ SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6M2B9EQ where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to 179 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZERX): ; MPRINT(ETLS_LOOPW6O7ZERX): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZERX): delete W6O7ZESR; MPRINT(ETLS_LOOPW6O7ZERX): quit; NOTE: Deleting WORK.W6O7ZESR (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 6025 6026 /*============================================================================* 6027 * Step: Loop End A50D7W6R.B6001AAZ * 6028 * Transform: Loop End * 6029 * Description: * 6030 *============================================================================*/ 6031 6032 /*============================================================================* 6033 * Step: Loop A50D7W6R.B6001ADH * 6034 * Transform: Loop * 6035 * Description: * 6036 * * 6037 * Source Table: SAS Splitter - work.W6O48PLY A50D7W6R.AY0032NG * 6038 * Target Table: Status Table - work.W6O48PP3 A50D7W6R.AY0032NH * 6039 *============================================================================*/ 6040 6041 %let SYSLAST = %nrquote(work.W6O48PLY); 6042 6043 %let transformID = %quote(A50D7W6R.B6001ADH); 6044 6045 %let trans_rc = 0; 6046 6047 %macro genSASCommand; 6048 %local noobjserver; 6049 %if "&sysscp"="OS" %then %let noobjserver=; 6050 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 6051 %else %let noobjserver=%quote(-noobjectserver); 6052 options sascmd = "!sascmd &noobjserver"; 6053 %mend genSASCommand; 6054 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 6055 6056 %macro etls_tsLevel(macroName=, featureName=); 180 The SAS System 12:24 Tuesday, January 12, 2016 6057 data _null_; 6058 call symput("¯oName",tslvl("&featureName")); 6059 run; 6060 %mend etls_tsLevel; 6061 6062 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 6063 gridRC=rc, useGrid=1, 6064 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 6065 log=, output=, additionalSignonOptions=, signonRetries=3); 6066 6067 %let etls_gridInstalled =; 6068 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 6069 6070 %if (&useGrid = 1) %then 6071 %do; 6072 %if ("&etls_gridInstalled" ne "") %then 6073 %do; 6074 %if (&gridRC eq ) %then 6075 %let gridRC = &handleName.RC ; 6076 6077 %global &gridRC; 6078 %let workload = ; 6079 %if (&workloadMacroVariable ne ) %then 6080 %do; 6081 data _null_; 6082 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 6083 run; 6084 %end; 6085 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 6086 %end; 6087 %else 6088 %put %str(NOTE: Grid service functions are not installed.); 6089 %end; 6090 6091 %local sleeptime sleepIncreaseAmount tryCount; 6092 %let sleepIncreaseAmount=5; 6093 %let sleeptime=5; 6094 %let tryCount=1; 6095 %let &cmacvar=1; 6096 6097 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 6098 data _null_; 6099 signon &handleName cmacvar=&cmacvar 6100 %if ("&log" ne "") %then 6101 log=&log; 6102 %if ("&output" ne "") %then 6103 output=&output; 6104 %if ("&additionalSignonOptions" ne "") %then 6105 &additionalSignonOptions; 6106 ;run; 6107 6108 %if ("&machineIdMacroVariable" ne "") %then 6109 %do; 6110 %if ("&etls_gridInstalled" ne "") %then 6111 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 6112 %else 6113 %put %str(NOTE: Grid service functions are not installed.); 6114 %end; 181 The SAS System 12:24 Tuesday, January 12, 2016 6115 6116 %if "&&&cmacvar" eq "1" %then 6117 %do; 6118 %if &tryCount lt %eval(&signonRetries+1) %then 6119 %do; 6120 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 6121 %let rc=%sysfunc(sleep(&sleeptime,1)); 6122 %end; 6123 %else %if &signonRetries gt 0 %then 6124 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 6125 6126 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 6127 %let tryCount=%eval(&tryCount+1); 6128 %end; 6129 %end; 6130 %rcSet(&syserr); 6131 6132 %mend etls_signon; 6133 6134 %macro etls_serverConnected(serverId=,macvarname=isConnected); 6135 %let &macvarname=0; 6136 %local search_str none_str savenotes; 6137 6138 /* setup information for listtask output */ 6139 /* listtask output on OS/390 differs */ 6140 %if %bquote(&sysscp) eq OS %then 6141 %do; 6142 %let search_str=Remote submit for; 6143 %let token=5; 6144 %end; 6145 %else 6146 %do; 6147 %let search_str=--------------; 6148 %let token=1; 6149 %end; 6150 6151 /* Issue listtask within PROC PRINTTO - send output to file */ 6152 filename __tmptxt TEMP; 6153 %let savenotes=%sysfunc(getoption(notes)); 6154 options nonotes; 6155 6156 proc printto log=__tmptxt new; 6157 run; 6158 6159 options notes; 6160 listtask; 6161 proc printto; 6162 run; 6163 6164 options nonotes; 6165 6166 /* read in the output from listtask */ 6167 %let dsname=_null_; 6168 data _null_(keep=Session); 6169 length line $256 sessionId $60; 6170 infile __tmptxt length=len; 6171 input @1 line $varying. len; 6172 182 The SAS System 12:24 Tuesday, January 12, 2016 6173 if line=:'There are no' then 6174 stop; 6175 /* look for the search string and scan for server name */ 6176 if index(line,"&search_str") then 6177 do; 6178 sessionId=scan(line,&token," "); 6179 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 6180 if sessionId=upcase(symget("serverId")) then 6181 do; 6182 call symput("&macvarname","1"); 6183 stop; 6184 end; 6185 end; 6186 run; 6187 filename __tmptxt clear; 6188 options &savenotes; 6189 %mend etls_serverConnected; 6190 6191 %macro etls_signoff(handleName=rmt); 6192 %local savemprint; 6193 %let savemprint=%sysfunc(getoption(mprint)); 6194 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 6195 options nomprint; 6196 %local isConnected; 6197 %etls_serverConnected(serverId=&handleName); 6198 options &savemprint; 6199 %if &isConnected %then 6200 signoff &handleName ;; 6201 %mend etls_signoff; 6202 6203 %macro etls_getHandle(statusTable=, handleVariable=, row=); 6204 %let etls_dsid = %sysfunc(open(&statusTable)); 6205 %if (&etls_dsid = 0) %then 6206 %put %sysfunc(sysmsg()); 6207 %else 6208 %do; 6209 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 6210 %if (&rc ne 0) %then 6211 %put %sysfunc(sysmsg()); 6212 %else 6213 %do; 6214 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 6215 %if (&etls_varnum > 0) %then 6216 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 6217 %else 6218 %put %sysfunc(sysmsg()); 6219 %end; 6220 %let rc = %sysfunc(close(&etls_dsid)); 6221 %end; 6222 %mend etls_getHandle; 6223 6224 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 6225 handleName=, statusSetting="Finished", 6226 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 6227 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 6228 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 6229 6230 %if ("&statusTable" ne "") %then 183 The SAS System 12:24 Tuesday, January 12, 2016 6231 %do; 6232 %local etls_rcMacroVarExisted; 6233 %let etls_rcMacroVarExisted = 0; 6234 %if ("&returnCodeMacroVariable" ne "") %then 6235 %do; 6236 proc sql noprint; 6237 select '1' into: etls_rcMacroVarExisted from dictionary.macros 6238 where name=upcase("&returnCodeMacroVariable"); 6239 quit; 6240 6241 %rcSet(&sqlrc); 6242 %if (&etls_rcMacroVarExisted = 0) %then 6243 %do; 6244 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 6245 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 6246 %end; 6247 %if (&setMainJobRC eq 1) %then 6248 %rcSet(&&&returnCodeMacroVariable); 6249 %end; 6250 %else 6251 %do; 6252 %let returnCodeMacroVariable=etls_rcmacvar; 6253 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 6254 %end; 6255 6256 %local etls_startTimeMacroVarExisted; 6257 %let etls_startTimeMacroVarExisted = 0; 6258 %if ("&startTimeMacroVariable" ne "") %then 6259 %do; 6260 proc sql noprint; 6261 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 6262 where name=upcase("&startTimeMacroVariable"); 6263 quit; 6264 6265 %rcSet(&sqlrc); 6266 %if (&etls_startTimeMacroVarExisted = 0) %then 6267 %do; 6268 %put WARNING: Start time from inner job not found. No value will be set.; 6269 %let &startTimeMacroVariable=; 6270 %end; 6271 %end; 6272 6273 %local etls_endTimeMacroVarExisted; 6274 %let etls_endTimeMacroVarExisted = 0; 6275 %if ("&endTimeMacroVariable" ne "") %then 6276 %do; 6277 proc sql noprint; 6278 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 6279 where name=upcase("&endTimeMacroVariable"); 6280 quit; 6281 6282 %rcSet(&sqlrc); 6283 %if (&etls_endTimeMacroVarExisted = 0) %then 6284 %do; 6285 %put WARNING: End time from inner job not found. Setting end time to current time.; 6286 %let &endTimeMacroVariable=%sysfunc(datetime()); 6287 %end; 6288 %end; 184 The SAS System 12:24 Tuesday, January 12, 2016 6289 6290 data &statusTable; 6291 modify &statusTable(where=(&handleVariable = &handleName)); 6292 %if ("&startTimeMacroVariable" ne "") %then 6293 %do; 6294 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 6295 %end; 6296 %if ("&endTimeVariable" ne "") %then 6297 %do; 6298 %if ("&endTimeMacroVariable" ne "") %then 6299 %do; 6300 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 6301 %end; 6302 %else 6303 &endTimeVariable = datetime();; 6304 %end; 6305 %if ("&returnCodeVariable" ne "") %then 6306 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 6307 %if ("&statusVariable" ne "") %then 6308 %do; 6309 if (symget("etls_rcMacroVarExisted") eq "0") then 6310 &statusVariable = "Unknown Status"; 6311 else 6312 &statusVariable = &statusSetting; 6313 %end; 6314 call symput('handle',&handleVariable); 6315 replace; 6316 stop; 6317 run; 6318 6319 %rcSet(&syserr); 6320 6321 %if (&signoff eq 1) %then 6322 %etls_signoff(handleName=&handle); 6323 %end; 6324 %mend etls_freeHandle; 6325 6326 %macro etls_createHandle(statusTable=, statusVariable=, 6327 handleVariable=, handlePrefix=rmt, 6328 workloadMacroVariable=, row=, machineVariable=, 6329 statusSetting="Running", startTimeVariable=startTime, 6330 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 6331 additionalSignonOptions=, signonRetries= ); 6332 6333 %local remoteSessionId; 6334 %let remoteSessionId = &handlePrefix.&row; 6335 %let &cmacvar = 1; 6336 %local etls_machineId; 6337 %if (&signon eq 1) %then 6338 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 6339 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 6340 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 6341 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 6342 %else %let &cmacvar=0; 6343 6344 data &statusTable; 6345 retain ptr &row; 6346 modify &statusTable point = ptr; 185 The SAS System 12:24 Tuesday, January 12, 2016 6347 &handleVariable = "&remoteSessionId"; 6348 %if (&signon eq 1) %then 6349 &machineVariable = "&etls_machineId";; 6350 %if (&&&cmacvar ne 0) %then 6351 %do; 6352 &statusVariable = "Failed Signon"; 6353 %end; 6354 %else 6355 &statusVariable = &statusSetting;; 6356 %if (&startTimeVariable ne ) %then 6357 &startTimeVariable = datetime();; 6358 replace; 6359 stop; 6360 run; 6361 6362 %rcSet(&syserr); 6363 %mend etls_createHandle; 6364 6365 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 6366 completeStatusSetting="Finished", endTimeVariable=endTime, 6367 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 6368 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 6369 6370 proc sql noprint; 6371 select count(*) into :etls_rows 6372 from &statusTable where &statusVariable = &runningStatusSetting; 6373 %let etls_rows = &etls_rows; 6374 %if (&etls_rows gt 0) %then 6375 %do; 6376 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 6377 from &statusTable where &statusVariable = &runningStatusSetting; 6378 %end; 6379 quit; 6380 6381 %rcSet(&sqlrc); 6382 6383 %if (&etls_rows gt 0) %then 6384 %do; 6385 waitfor &waitType 6386 %do i=1 %to &etls_rows; 6387 &&etlsHandles&i 6388 %end; 6389 ; 6390 %end; 6391 6392 %local useDefaultRCMacVar; 6393 %if ("&returnCodeMacroVariable" eq "") %then 6394 %let useDefaultRCMacVar=Y; 6395 6396 %do i=1 %to &etls_rows; 6397 6398 %if ("&useDefaultRCMacVar"="Y") %then 6399 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 6400 6401 waitfor &&etlsHandles&i timeout=1; 6402 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 6403 %do; 6404 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 186 The SAS System 12:24 Tuesday, January 12, 2016 6405 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 6406 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 6407 startTimeVariable=&startTimeVariable, signoff=&signoff, 6408 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 6409 statusUnknownReturnCode=&statusUnknownReturnCode, 6410 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 6411 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 6412 %put NOTE: Process &&etlsHandles&i. has completed.; 6413 %end; 6414 %else %if (&SYSRC ne -1) %then /* process status unknown */ 6415 %do; 6416 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 6417 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 6418 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 6419 startTimeVariable=&startTimeVariable, signoff=&signoff, 6420 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 6421 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 6422 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 6423 %end; 6424 %end; 6425 %mend etls_waitfor; 6426 6427 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 6428 statusSetting="Running"); 6429 6430 proc sql noprint; 6431 select count(*) into: &processCountMacro 6432 from &statusTable where &statusVariable = &statusSetting; 6433 quit; 6434 6435 %rcSet(&sqlrc); 6436 %mend etls_getProcessesRunning; 6437 6438 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 6439 %let ¶meterVariableMacro = ; 6440 %let dsid = %sysfunc(open(¶meterTable)); 6441 %if (&dsid gt 0) %then 6442 %do; 6443 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 6444 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 6445 %end; 6446 %let dsid = %sysfunc(close(&dsid)); 6447 %end; 6448 %else 6449 %put %sysfunc(sysmsg()); 6450 %rcSet(&syserr); 6451 %mend etls_getParameterNames; 6452 6453 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 6454 data _null_; 6455 length vname $256 vtype $1 value $3200; 6456 dsid = open("¶meterTable"); 6457 if (dsid > 0) then 6458 do; 6459 do _i = 1 to &row; 6460 fetchrc = fetch(dsid); 6461 end; 6462 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 187 The SAS System 12:24 Tuesday, January 12, 2016 6463 vname = varname(dsid,_i); 6464 vtype = vartype(dsid,_i); 6465 if (fetchrc = 0) then 6466 do; 6467 if (vtype = 'C') then 6468 do; 6469 value = getvarc(dsid,_i); 6470 value = tranwrd(value,"%","%%"); 6471 value = tranwrd(value,"(","%("); 6472 value = tranwrd(value,")","%)"); 6473 value = tranwrd(value,'"','%"'); 6474 end; 6475 else 6476 value = left(put(getvarn(dsid,_i),best32.)); 6477 end; /* fetchrc = 0 */ 6478 6479 put ; 6480 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 6481 do; 6482 value='%str('||trim(value)||')'; 6483 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 6484 end; 6485 %if %str(&handlename) ne %str() %then 6486 %do; 6487 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 6488 %end; 6489 %else 6490 %do; 6491 value = '%let '||trim(vname)||'= '||trim(value)||';'; 6492 %end; 6493 6494 put "NOTE: Setting macro variable " vname "with statement:" value ; 6495 call execute(value); 6496 end; /* do i= */ 6497 dsid = close(dsid); 6498 end; /* dsid > 0 */ 6499 else 6500 do; 6501 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 6502 abort; 6503 end; 6504 stop; 6505 run; 6506 6507 %rcSet(&syserr); 6508 %mend etls_getParameters; 6509 6510 %macro etls_loopW6O7ZES8; 6511 %local etls_filePrefix; 6512 %let etls_filePrefix = ; 6513 6514 %macro etls_processToLoopW6O7ZESI(parameterTable=, row=, handleName=rmt); 6515 %etls_getParameters(parameterTable=¶meterTable, row=&row, 6516 startingColumnNumber=1, handleName=&handleName); 6517 %let etls_previousFilePrefix = &etls_filePrefix; 6518 %local etls_filePrefix; 6519 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 6520 %syslput &etls_controlName = &row / remote = &handleName; 188 The SAS System 12:24 Tuesday, January 12, 2016 6521 %syslput handleName = &handleName / remote = &handleName; 6522 6523 /* Setup to pass macros to remote session */ 6524 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 6525 6526 rsubmit &handleName wait = no sysrputsync = yes persist = no 6527 log = "&etls_logOutputPath./&etls_filePrefix..log" 6528 output = "&etls_logOutputPath./&etls_filePrefix..lst" 6529 ; 6530 6531 %macro etls_jobW6O7ZESS; 6532 6533 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 6534 6535 /****************************************************************************** 6536 * Job: RPODSDW148 A50D7W6R.AQ00144N * 6537 * Description: * 6538 * * 6539 * Repository: me_besa A0000001.A50D7W6R * 6540 * Server: besa A5NJAD6Z.AT000001 * 6541 * * 6542 * Source Tables: TTRANSACCOES - ODSBESA.TTRANSACCOES A5NJAD6Z.BJ0000AN * 6543 * TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 6544 * TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 6545 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 6546 * TCATEGORIACLI - ODSBESA.TCATEGORIACLI A5NJAD6Z.BJ00008N * 6547 * S_ODS_DW148_IN - GLBBESA.S_ODS_DW148 A5NJAD6Z.BJ0013D7 * 6548 * Target Table: S_ODS_DW148 - GLBBESA.S_ODS_DW148 A5NJAD6Z.BJ0013CS * 6549 * * 6550 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 6551 * Generated by: s-bametasasd1\dvbesa * 6552 * Version: 9.1.20060626.51875 * 6553 ******************************************************************************/ 6554 6555 /* Create metadata macro variables */ 6556 %let IOMServer = %nrquote(besa); 6557 %let metaPort = %nrquote(8561); 6558 %let metaServer = %nrquote(s-bametasasd1); 6559 %let metaRepository = %nrquote(me_besa); 6560 6561 /* Set metadata options */ 6562 options metaport = &metaPort 6563 metaserver = "&metaServer" 6564 metarepository = "&metaRepository"; 6565 6566 %let jobID = %quote(A50D7W6R.AQ00144N); 6567 6568 /* Setup to capture return codes */ 6569 %global job_rc trans_rc sqlrc; 6570 %let job_rc = 0; 6571 %let trans_rc = 0; 6572 %let sqlrc = 0; 6573 %global syserr; 6574 6575 %macro rcSet(error); 6576 %if (&error gt &trans_rc) %then 6577 %let trans_rc = &error; 6578 %if (&error gt &job_rc) %then 189 The SAS System 12:24 Tuesday, January 12, 2016 6579 %let job_rc = &error; 6580 %mend rcSet; 6581 6582 %macro rcSetDS(error); 6583 if &error gt input(symget('trans_rc'),12.) then 6584 call symput('trans_rc',trim(left(put(&error,12.)))); 6585 if &error gt input(symget('job_rc'),12.) then 6586 call symput('job_rc',trim(left(put(&error,12.)))); 6587 %mend rcSetDS; 6588 6589 %global etls_debug; 6590 %macro etls_setDebug; 6591 %if %str(&etls_debug) ne 0 %then 6592 OPTIONS MPRINT%str(;); 6593 %mend; 6594 %etls_setDebug; 6595 6596 %macro genSASCommand; 6597 %local noobjserver; 6598 %if "&sysscp"="OS" %then %let noobjserver=; 6599 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 6600 %else %let noobjserver=%quote(-noobjectserver); 6601 options sascmd = "!sascmd &noobjserver"; 6602 %mend genSASCommand; 6603 %genSASCommand; 6604 6605 /****************************************************************************** 6606 * Macro: * 6607 * etls_tsLevel- Executes a data step using the tslvl function to * 6608 * determine if a feature is installed. * 6609 * * 6610 * Parameters: * 6611 * macroName- Name of macro to hold the value returned from the * 6612 * function call, a blank value indicates the feature is not * 6613 * installed. * 6614 * featureName - Name of feature to test for installation status. * 6615 ******************************************************************************/ 6616 %macro etls_tsLevel(macroName=, featureName=); 6617 data _null_; 6618 call symput("¯oName",tslvl("&featureName")); 6619 run; 6620 %mend etls_tsLevel; 6621 6622 /****************************************************************************** 6623 * Macro: * 6624 * etls_signon - Executes a signon to a remote machine. * 6625 * * 6626 * Parameters: * 6627 * handleName - Name of handle to access the remote connection. * 6628 * cmacvar - Macro variable to capture the status of the signon. * 6629 * gridRC- Macro variable to capture the return code of the grid * 6630 * signon. * 6631 * useGrid- A value of 1 will attempt to use a grid for the signon. * 6632 * If the grid functions are not installed then a local signon * 6633 * is performed. * 6634 * machineIdMacroVariable- Name of macro variable to capture the name * 6635 * of the machine used for a grid signon. * 6636 * workloadMacroVariable- Name of macro variable that specifies the * 190 The SAS System 12:24 Tuesday, January 12, 2016 6637 * workload to use for a grid signon. * 6638 * log - Path to a log file for the signon. * 6639 * output - Path to an output file for the signon. * 6640 * additionalSignonOptions- Any additional options for the signon * 6641 * statement. * 6642 * signonRetries- Integer value of signons to try before quiting. * 6643 * The wait between tries starts at 5 seconds, * 6644 * increments by 5 seconds. * 6645 ******************************************************************************/ 6646 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 6647 gridRC=rc, useGrid=1, 6648 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 6649 log=, output=, additionalSignonOptions=, signonRetries=3); 6650 6651 %let etls_gridInstalled =; 6652 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 6653 6654 %if (&useGrid = 1) %then 6655 %do; 6656 %if ("&etls_gridInstalled" ne "") %then 6657 %do; 6658 %if (&gridRC eq ) %then 6659 %let gridRC = &handleName.RC ; 6660 6661 %global &gridRC; 6662 %let workload = ; 6663 %if (&workloadMacroVariable ne ) %then 6664 %do; 6665 data _null_; 6666 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 6667 run; 6668 %end; 6669 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 6670 %end; 6671 %else 6672 %put %str(NOTE: Grid service functions are not installed.); 6673 %end; 6674 6675 %local sleeptime sleepIncreaseAmount tryCount; 6676 %let sleepIncreaseAmount=5; 6677 %let sleeptime=5; 6678 %let tryCount=1; 6679 %let &cmacvar=1; 6680 6681 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 6682 data _null_; 6683 signon &handleName cmacvar=&cmacvar 6684 %if ("&log" ne "") %then 6685 log=&log; 6686 %if ("&output" ne "") %then 6687 output=&output; 6688 %if ("&additionalSignonOptions" ne "") %then 6689 &additionalSignonOptions; 6690 ;run; 6691 6692 %if ("&machineIdMacroVariable" ne "") %then 6693 %do; 6694 %if ("&etls_gridInstalled" ne "") %then 191 The SAS System 12:24 Tuesday, January 12, 2016 6695 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 6696 %else 6697 %put %str(NOTE: Grid service functions are not installed.); 6698 %end; 6699 6700 %if "&&&cmacvar" eq "1" %then 6701 %do; 6702 %if &tryCount lt %eval(&signonRetries+1) %then 6703 %do; 6704 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 6705 %let rc=%sysfunc(sleep(&sleeptime,1)); 6706 %end; 6707 %else %if &signonRetries gt 0 %then 6708 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 6709 6710 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 6711 %let tryCount=%eval(&tryCount+1); 6712 %end; 6713 %end; 6714 %rcSet(&syserr); 6715 6716 %mend etls_signon; 6717 6718 /****************************************************************************** 6719 * Macro: * 6720 * etls_serverConnected- Tests to see if a connection to a remote * 6721 * exists. * 6722 * * 6723 * Parameters: * 6724 * serverId - Handle to the remote to test. * 6725 * macvarname- Name of macro variable to hold the return value of the * 6726 * status. Will equal 1 if the connection exists, 0 * 6727 * otherwise. Macro variable must be localized before * 6728 * calling this macro. * 6729 ******************************************************************************/ 6730 %macro etls_serverConnected(serverId=,macvarname=isConnected); 6731 %let &macvarname=0; 6732 %local search_str none_str savenotes; 6733 6734 /* setup information for listtask output */ 6735 /* listtask output on OS/390 differs */ 6736 %if %bquote(&sysscp) eq OS %then 6737 %do; 6738 %let search_str=Remote submit for; 6739 %let token=5; 6740 %end; 6741 %else 6742 %do; 6743 %let search_str=--------------; 6744 %let token=1; 6745 %end; 6746 6747 /* Issue listtask within PROC PRINTTO - send output to file */ 6748 filename __tmptxt TEMP; 6749 %let savenotes=%sysfunc(getoption(notes)); 6750 options nonotes; 6751 6752 proc printto log=__tmptxt new; 192 The SAS System 12:24 Tuesday, January 12, 2016 6753 run; 6754 6755 options notes; 6756 listtask; 6757 proc printto; 6758 run; 6759 6760 options nonotes; 6761 6762 /* read in the output from listtask */ 6763 %let dsname=_null_; 6764 data _null_(keep=Session); 6765 length line $256 sessionId $60; 6766 infile __tmptxt length=len; 6767 input @1 line $varying. len; 6768 6769 if line=:'There are no' then 6770 stop; 6771 /* look for the search string and scan for server name */ 6772 if index(line,"&search_str") then 6773 do; 6774 sessionId=scan(line,&token," "); 6775 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 6776 if sessionId=upcase(symget("serverId")) then 6777 do; 6778 call symput("&macvarname","1"); 6779 stop; 6780 end; 6781 end; 6782 run; 6783 filename __tmptxt clear; 6784 options &savenotes; 6785 %mend etls_serverConnected; 6786 6787 /****************************************************************************** 6788 * Macro: * 6789 * etls_signoff- Executes a signoff for a remote session, if a * 6790 * connection still exists. * 6791 * * 6792 * Parameters: * 6793 * handleName - Handle to remote session. * 6794 ******************************************************************************/ 6795 %macro etls_signoff(handleName=rmt); 6796 %local savemprint; 6797 %let savemprint=%sysfunc(getoption(mprint)); 6798 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 6799 options nomprint; 6800 %local isConnected; 6801 %etls_serverConnected(serverId=&handleName); 6802 options &savemprint; 6803 %if &isConnected %then 6804 signoff &handleName ;; 6805 %mend etls_signoff; 6806 6807 /****************************************************************************** 6808 * Macro: * 6809 * etls_getHandle- Retrieves the handle for a remote connection from the * 6810 * status table. * 193 The SAS System 12:24 Tuesday, January 12, 2016 6811 * * 6812 * Parameters: * 6813 * statusTable - Table containing status information. * 6814 * handleVariable- Name of variable holding the handles to the remote * 6815 * connections. * 6816 * row - Row to retrieve the information from. * 6817 ******************************************************************************/ 6818 %macro etls_getHandle(statusTable=, handleVariable=, row=); 6819 %let etls_dsid = %sysfunc(open(&statusTable)); 6820 %if (&etls_dsid = 0) %then 6821 %put %sysfunc(sysmsg()); 6822 %else 6823 %do; 6824 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 6825 %if (&rc ne 0) %then 6826 %put %sysfunc(sysmsg()); 6827 %else 6828 %do; 6829 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 6830 %if (&etls_varnum > 0) %then 6831 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 6832 %else 6833 %put %sysfunc(sysmsg()); 6834 %end; 6835 %let rc = %sysfunc(close(&etls_dsid)); 6836 %end; 6837 %mend etls_getHandle; 6838 6839 /****************************************************************************** 6840 * Macro: * 6841 * etls_freeHandle- Update the status of a remote connection in the * 6842 * status table and optionally signoff the connection. * 6843 * Can update the ending time of the task if an end time * 6844 * is desired. * 6845 * * 6846 * Parameters: * 6847 * statusTable - Table containing status information. * 6848 * statusVariable- Variable in status table that holds the status of * 6849 * the connection. * 6850 * handleVariable- Variable in status table that holds the names of * 6851 * the connection handles. * 6852 * handleName - Name of handle to access the remote connection. * 6853 * statusSetting- Value to set the status variable to once the * 6854 * process is complete, value must be quoted if this is * 6855 * character variable. * 6856 * endTimeVariable- Variable that contains the end time for the * 6857 * processes in the status table. * 6858 * startTimeVariable- Variable that contains the start time for the * 6859 * processes in the status table. * 6860 * signoff- Indicates whether this macro should signoff the * 6861 * connection to a remote, a value of 1 indicates a signoff * 6862 * should be made. * 6863 * returnCodeVariable- Variable in the status table that contains the * 6864 * return code for the individual processes. * 6865 * returnCodeMacroVariable- Macro variable holding the value for the * 6866 * processes return code. * 6867 * setMainJobRC- Indicates whether this macro should update the main * 6868 * job_rc for the outer process. * 194 The SAS System 12:24 Tuesday, January 12, 2016 6869 * statusUnknownReturnCode- Numeric value to set the status to if the * 6870 * status of the process cannot be determined. * 6871 ******************************************************************************/ 6872 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 6873 handleName=, statusSetting="Finished", 6874 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 6875 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 6876 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 6877 6878 %if ("&statusTable" ne "") %then 6879 %do; 6880 %local etls_rcMacroVarExisted; 6881 %let etls_rcMacroVarExisted = 0; 6882 %if ("&returnCodeMacroVariable" ne "") %then 6883 %do; 6884 proc sql noprint; 6885 select '1' into: etls_rcMacroVarExisted from dictionary.macros 6886 where name=upcase("&returnCodeMacroVariable"); 6887 quit; 6888 6889 %rcSet(&sqlrc); 6890 %if (&etls_rcMacroVarExisted = 0) %then 6891 %do; 6892 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 6893 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 6894 %end; 6895 %if (&setMainJobRC eq 1) %then 6896 %rcSet(&&&returnCodeMacroVariable); 6897 %end; 6898 %else 6899 %do; 6900 %let returnCodeMacroVariable=etls_rcmacvar; 6901 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 6902 %end; 6903 6904 %local etls_startTimeMacroVarExisted; 6905 %let etls_startTimeMacroVarExisted = 0; 6906 %if ("&startTimeMacroVariable" ne "") %then 6907 %do; 6908 proc sql noprint; 6909 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 6910 where name=upcase("&startTimeMacroVariable"); 6911 quit; 6912 6913 %rcSet(&sqlrc); 6914 %if (&etls_startTimeMacroVarExisted = 0) %then 6915 %do; 6916 %put WARNING: Start time from inner job not found. No value will be set.; 6917 %let &startTimeMacroVariable=; 6918 %end; 6919 %end; 6920 6921 %local etls_endTimeMacroVarExisted; 6922 %let etls_endTimeMacroVarExisted = 0; 6923 %if ("&endTimeMacroVariable" ne "") %then 6924 %do; 6925 proc sql noprint; 6926 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 195 The SAS System 12:24 Tuesday, January 12, 2016 6927 where name=upcase("&endTimeMacroVariable"); 6928 quit; 6929 6930 %rcSet(&sqlrc); 6931 %if (&etls_endTimeMacroVarExisted = 0) %then 6932 %do; 6933 %put WARNING: End time from inner job not found. Setting end time to current time.; 6934 %let &endTimeMacroVariable=%sysfunc(datetime()); 6935 %end; 6936 %end; 6937 6938 data &statusTable; 6939 modify &statusTable(where=(&handleVariable = &handleName)); 6940 %if ("&startTimeMacroVariable" ne "") %then 6941 %do; 6942 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 6943 %end; 6944 %if ("&endTimeVariable" ne "") %then 6945 %do; 6946 %if ("&endTimeMacroVariable" ne "") %then 6947 %do; 6948 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 6949 %end; 6950 %else 6951 &endTimeVariable = datetime();; 6952 %end; 6953 %if ("&returnCodeVariable" ne "") %then 6954 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 6955 %if ("&statusVariable" ne "") %then 6956 %do; 6957 if (symget("etls_rcMacroVarExisted") eq "0") then 6958 &statusVariable = "Unknown Status"; 6959 else 6960 &statusVariable = &statusSetting; 6961 %end; 6962 call symput('handle',&handleVariable); 6963 replace; 6964 stop; 6965 run; 6966 6967 %rcSet(&syserr); 6968 6969 %if (&signoff eq 1) %then 6970 %etls_signoff(handleName=&handle); 6971 %end; 6972 %mend etls_freeHandle; 6973 6974 /****************************************************************************** 6975 * Macro: * 6976 * etls_createHandle- Creates a handle name for a connect session and * 6977 * optionally signon to the session. * 6978 * * 6979 * Parameters: * 6980 * statusTable - Table that holds status of connections. * 6981 * statusVariable- Variable in status table that holds the status of * 6982 * the connection. * 6983 * handleVariable- Variable in status table that holds the names of * 6984 * the connection handles. * 196 The SAS System 12:24 Tuesday, January 12, 2016 6985 * handlePrefix- Prefix for the names of the handles, a number will * 6986 * be appended representing the row number in the table. * 6987 * workloadMacroVariable - Specification for the grid workload option. * 6988 * row - Row number in the status table to update. * 6989 * machineVariable- Variable in status table holding the name of * 6990 * machine running the task. * 6991 * statusSetting- Value to set the status variable to once the handle * 6992 * connection is made, value must be quoted if this is * 6993 * character variable. * 6994 * signon - A value of 1 will execute the signon statement. * 6995 * useGrid - A value of 1 will attempt to use a grid for the signon. * 6996 * log - Path to a log file for the signon. * 6997 * output - Path to an output file for the signon. * 6998 * gridRC- Macro variable to capture the return code of the grid * 6999 * signon. * 7000 * cmacvar - Macro variable to capture the status of the signon. * 7001 * additionalSignonOptions- Any additional options for the signon * 7002 * statement. * 7003 * signonRetries- Integer value of signons to try before quiting. * 7004 * The wait between tries starts at 5 seconds, * 7005 * increments by 5 seconds. * 7006 ******************************************************************************/ 7007 %macro etls_createHandle(statusTable=, statusVariable=, 7008 handleVariable=, handlePrefix=rmt, 7009 workloadMacroVariable=, row=, machineVariable=, 7010 statusSetting="Running", startTimeVariable=startTime, 7011 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 7012 additionalSignonOptions=, signonRetries= ); 7013 7014 %local remoteSessionId; 7015 %let remoteSessionId = &handlePrefix.&row; 7016 %let &cmacvar = 1; 7017 %local etls_machineId; 7018 %if (&signon eq 1) %then 7019 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 7020 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 7021 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 7022 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 7023 %else %let &cmacvar=0; 7024 7025 data &statusTable; 7026 retain ptr &row; 7027 modify &statusTable point = ptr; 7028 &handleVariable = "&remoteSessionId"; 7029 %if (&signon eq 1) %then 7030 &machineVariable = "&etls_machineId";; 7031 %if (&&&cmacvar ne 0) %then 7032 %do; 7033 &statusVariable = "Failed Signon"; 7034 %end; 7035 %else 7036 &statusVariable = &statusSetting;; 7037 %if (&startTimeVariable ne ) %then 7038 &startTimeVariable = datetime();; 7039 replace; 7040 stop; 7041 run; 7042 197 The SAS System 12:24 Tuesday, January 12, 2016 7043 %rcSet(&syserr); 7044 %mend etls_createHandle; 7045 7046 /****************************************************************************** 7047 * Macro: * 7048 * etls_waitfor- Executes a waitfor statement based on the status * 7049 * setting of processes in the status table. Will * 7050 * optionally perform a etls_freeHandle call if the process * 7051 * has completed. * 7052 * * 7053 * Parameters: * 7054 * statusTable - Table containing status information. * 7055 * statusVariable- Variable in status table that holds the status of * 7056 * the connection. * 7057 * runningStatusSetting- Value that indicates that the process is * 7058 * running, value must be quoted if this is * 7059 * character variable. * 7060 * handleVariable- Variable in status table that holds the names of * 7061 * the connection handles. * 7062 * completeStatusSetting- Value to set the status variable to once * 7063 * the process is complete, value must be quoted * 7064 * if this is character variable. * 7065 * endTimeVariable- Variable that contains the end time for the * 7066 * processes in the status table. * 7067 * startTimeVariable- Variable that contains the start time for the * 7068 * processes in the status table. * 7069 * waitType- Type of waitfor to perform; valid values are , * 7070 * _ANY_, or _ALL_. * 7071 * signoff- Indicates whether this macro should signoff the * 7072 * connection to a remote, a value of 1 indicates a signoff * 7073 * should be made. * 7074 * returnCodeVariable- Variable in the status table that contains the * 7075 * return code for the individual processes. * 7076 * returnCodeMacroVariable- Macro variable holding the value for the * 7077 * processes return code. * 7078 * statusUnknownReturnCode- Numeric value to set the status to if the * 7079 * status of the process cannot be determined. * 7080 ******************************************************************************/ 7081 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 7082 completeStatusSetting="Finished", endTimeVariable=endTime, 7083 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 7084 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 7085 7086 proc sql noprint; 7087 select count(*) into :etls_rows 7088 from &statusTable where &statusVariable = &runningStatusSetting; 7089 %let etls_rows = &etls_rows; 7090 %if (&etls_rows gt 0) %then 7091 %do; 7092 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 7093 from &statusTable where &statusVariable = &runningStatusSetting; 7094 %end; 7095 quit; 7096 7097 %rcSet(&sqlrc); 7098 7099 %if (&etls_rows gt 0) %then 7100 %do; 198 The SAS System 12:24 Tuesday, January 12, 2016 7101 waitfor &waitType 7102 %do i=1 %to &etls_rows; 7103 &&etlsHandles&i 7104 %end; 7105 ; 7106 %end; 7107 7108 %local useDefaultRCMacVar; 7109 %if ("&returnCodeMacroVariable" eq "") %then 7110 %let useDefaultRCMacVar=Y; 7111 7112 %do i=1 %to &etls_rows; 7113 7114 %if ("&useDefaultRCMacVar"="Y") %then 7115 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 7116 7117 waitfor &&etlsHandles&i timeout=1; 7118 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 7119 %do; 7120 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 7121 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 7122 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 7123 startTimeVariable=&startTimeVariable, signoff=&signoff, 7124 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 7125 statusUnknownReturnCode=&statusUnknownReturnCode, 7126 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 7127 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 7128 %put NOTE: Process &&etlsHandles&i. has completed.; 7129 %end; 7130 %else %if (&SYSRC ne -1) %then /* process status unknown */ 7131 %do; 7132 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 7133 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 7134 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 7135 startTimeVariable=&startTimeVariable, signoff=&signoff, 7136 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 7137 statusUnknownReturnCode=&statusUnknownReturnCode, 7137 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 7138 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 7139 %end; 7140 %end; 7141 %mend etls_waitfor; 7142 7143 /****************************************************************************** 7144 * Macro: * 7145 * etls_getProcessesRunning- Gets the number of processes running by * 7146 * querying the status table. * 7147 * * 7148 * Parameters: * 7149 * statusTable - Table containing status information. * 7150 * statusVariable- Variable in status table that holds the status of * 7151 * the connection. * 7152 * processCountMacro- Macro variable to contain the value of the * 7153 * number of processes running. Macro variable must * 7154 * be localized before calling this macro. * 7155 * statusSetting- Value that indicates that the process is running, * 7156 * value must be quoted if this is character variable. * 7157 ******************************************************************************/ 199 The SAS System 12:24 Tuesday, January 12, 2016 7158 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 7159 statusSetting="Running"); 7160 7161 proc sql noprint; 7162 select count(*) into: &processCountMacro 7163 from &statusTable where &statusVariable = &statusSetting; 7164 quit; 7165 7166 %rcSet(&sqlrc); 7167 %mend etls_getProcessesRunning; 7168 7169 /*============================================================================* 7170 * Step: Extract TCONTA A50D7W6R.AR0030B3 * 7171 * Transform: Extract * 7172 * Description: * 7173 * * 7174 * Source Table: TCONTA - ODSBESA.TCONTA A5NJAD6Z.BJ00008T * 7175 * Target Table: Extract Target TCONTA - work.W6NK6WAN A50D7W6R.AY0032J5 * 7176 *============================================================================*/ 7177 7178 /* Access the data for ODSBESA */ 7179 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 7179 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 7180 %rcSet(&syslibrc); 7181 7182 %let SYSLAST = %nrquote(ODSBESA.TCONTA); 7183 7184 %let transformID = %quote(A50D7W6R.AR0030B3); 7185 7186 %let trans_rc = 0; 7187 7188 proc datasets lib = work nolist nowarn memtype = (data view); 7189 delete W6NK6WAN; 7190 quit; 7191 7192 proc sql; 7193 create table work.W6NK6WAN as 7194 select IDENT length = 4 label = 'IDENT', 7195 CDCONTRATO length = 16 label = 'CDCONTRATO', 7196 CDCLIENTE length = 9 label = 'CDCLIENTE', 7197 CDMOEDA length = 3 label = 'CDMOEDA', 7198 (MTACTUALLC) as MTACTUALLC length = 8 format = 25.3 informat = 25.3 7199 from &SYSLAST 7200 where DTCREATE = &dataparam. & CDCLIENTE ^= '00000000'; 7201 quit; 7202 7203 %let SYSLAST = work.W6NK6WAN; 7204 7205 %rcSet(&sqlrc); 7206 7207 /*============================================================================* 7208 * Step: Extract TTRANSACCOES A50D7W6R.AR0030B2 * 7209 * Transform: Extract * 7210 * Description: * 7211 * * 7212 * Source Table: TTRANSACCOES - ODSBESA.TTRANSACCOES A5NJAD6Z.BJ0000AN * 7213 * Target Table: SAS Extract TTRANSACCOES - work.W6N4VID0 A50D7W6R.AY0032J3 * 7214 *============================================================================*/ 200 The SAS System 12:24 Tuesday, January 12, 2016 7215 7216 %let SYSLAST = %nrquote(ODSBESA.TTRANSACCOES); 7217 7218 %let transformID = %quote(A50D7W6R.AR0030B2); 7219 7220 %let trans_rc = 0; 7221 7222 proc datasets lib = work nolist nowarn memtype = (data view); 7223 delete W6N4VID0; 7224 quit; 7225 7226 proc sql; 7227 create table work.W6N4VID0 as 7228 select distinct IDENT length = 4 label = 'IDENT', 7229 CDCLIENTE length = 9 label = 'CDCLIENTE' 7230 from &SYSLAST 7231 where DTTRANSACCAO >= intnx('dtmonth',&dataparam, -6,'b') AND DTTRANSACCAO <= &dataParam. and 7231 ! INCONTCONTAB='A' and CDPRODUTO <> 'DMNT'; 7232 quit; 7233 7234 %let SYSLAST = work.W6N4VID0; 7235 7236 %rcSet(&sqlrc); 7237 7238 /*============================================================================* 7239 * Step: SQL Join A50D7W6R.AR0030AY * 7240 * Transform: SQL Join (Version 2) * 7241 * Description: * 7242 * * 7243 * Source Tables: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 7244 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 7245 * SAS Extract TTRANSACCOES - work.W6N4VID0 A50D7W6R.AY0032J3 * 7246 * Extract Target TCONTA - work.W6NK6WAN A50D7W6R.AY0032J5 * 7247 * TCATEGORIACLI - ODSBESA.TCATEGORIACLI A5NJAD6Z.BJ00008N * 7248 * Target Table: SQL Target - work.W6NINDD1 A50D7W6R.AY0032IY * 7249 *============================================================================*/ 7250 7251 %let transformID = %quote(A50D7W6R.AR0030AY); 7252 7253 %let trans_rc = 0; 7254 7255 proc datasets lib = work nolist nowarn memtype = (data view); 7256 delete W6NINDD1; 7257 quit; 7258 7259 proc sql; 7260 create table work.W6NINDD1 as 7261 select distinct 7262 TCONTRATO.CDCLIENTE length = 9 7263 format = $9. 7264 informat = $9. 7265 label = 'CDCLIENTE', 7266 TCLIENTE.LNCLIENTE length = 80 7267 format = $80. 7268 informat = $80. 7269 label = 'LNCLIENTE', 7270 TCONTRATO.CDCONTRATO length = 16 7271 format = $16. 201 The SAS System 12:24 Tuesday, January 12, 2016 7272 informat = $16. 7273 label = 'CDCONTRATO', 7274 TCONTRATO.CDPRODUTO length = 4 7275 format = $4. 7276 informat = $4. 7277 label = 'CDPRODUTO', 7278 TCONTRATO.CDBALCAO length = 3 7279 format = $3. 7280 informat = $3. 7281 label = 'CDBALCAO', 7282 TCONTRATO.CDMOEDA length = 3 7283 format = $3. 7284 informat = $3. 7285 label = 'CDMOEDA', 7286 W6NK6WAN.MTACTUALLC length = 8 7287 format = 25.3 7288 informat = 25.3 7289 label = 'MTACTUALLC', 7290 case when (W6NK6WAN.MTACTUALLC >= 2014) then '2000' else 'SALDO INSUF.' end as COMISSAO length = 15 7291 format = 7291 ! $15. 7292 informat = 7292 ! $15. 7293 label = 7293 ! 'COMISSAO', 7294 case when TCLIENTE.CDBALCAO in ( '026' , '001' , '009') then 'Private' else 'Não Private' end as 7294 ! TP_CLIENTE length = 15 7295 format = $15. 7296 informat = $15. 7297 label = 'TP_CLIENTE', 7298 put(datepart(&dataparam),yymmdd10.) as DTPROC length = 10 7299 format = $10. 7300 informat = $10. 7301 label = 'DTPROC', 7302 case when (TCLIENTE.CDBALCAO in ( '951' ) and W6NK6WAN.MTACTUALLC >= 2014 ) then '0'when ___ 49 7302 ! (W6NK6WAN.MTACTUALLC < 2014 ) then 'SALDO INSUF.' else '14' end as IMPOSTO length = 15 NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. 7303 format = $15. 7304 informat = $15. 7305 label = 'IMPOSTO', 7306 TCATEGORIACLI.LICATEGCLIENTE length = 80 7307 format = $80. 7308 informat = $80. 7309 label = 'LICATEGCLIENTE', 7310 TCLIENTE.IDENT length = 4 7311 format = $4. 7312 informat = $4. 7313 label = 'IDENT' 7314 from 7315 work.W6N4VID0 right join 7316 ODSBESA.TCONTRATO 7317 on 7318 ( 7319 W6N4VID0.IDENT = TCONTRATO.IDENT 7320 and W6N4VID0.CDCLIENTE = TCONTRATO.CDCLIENTE 202 The SAS System 12:24 Tuesday, January 12, 2016 7321 ) left join 7322 ODSBESA.TCLIENTE 7323 on 7324 ( 7325 &dataparam. BETWEEN TCLIENTE.DTCHANGE and TCLIENTE.DTENDCHANGE 7326 and TCLIENTE.IDENT = TCONTRATO.IDENT 7327 and TCLIENTE.CDCLIENTE = TCONTRATO.CDCLIENTE 7328 and TCLIENTE.CDCLIENTE <> '00000000' 7329 ) left join 7330 work.W6NK6WAN 7331 on 7332 ( 7333 W6NK6WAN.CDCLIENTE = TCONTRATO.CDCLIENTE 7334 and W6NK6WAN.CDMOEDA = TCONTRATO.CDMOEDA 7335 and W6NK6WAN.CDCONTRATO = TCONTRATO.CDCONTRATO 7336 ) left join 7337 ODSBESA.TCATEGORIACLI 7338 on 7339 ( 7340 TCLIENTE.CDCATEGCLIENTE = TCATEGORIACLI.CDCATEGCLIENTE 7341 ) 7342 where 7343 &dataparam. BETWEEN TCONTRATO.DTCHANGE and TCONTRATO.DTENDCHANGE 7344 and TCONTRATO.CDCLIENTE <> '00000000' 7345 and TCONTRATO.CDMODULO = 'CA' 7346 and TCONTRATO.CDPRODUTO IN ('PNMR' ,'CURR', 'TPRV' , 'TNMR' , 'PRIV', 'NUMR', 'SALR') 7347 and W6N4VID0.CDCLIENTE IS NULL 7348 ; 7349 quit; 7350 7351 %rcSet(&sqlrc); 7352 7353 %macro etls_completeTarget(); 7354 %mend etls_completeTarget; 7355 %etls_completeTarget; 7356 7357 /*============================================================================* 7358 * Step: Sum MTACTUALLC A50D7W6R.AR0030B5 * 7359 * Transform: Extract * 7360 * Description: * 7361 * * 7362 * Source Table: SQL Target - work.W6NINDD1 A50D7W6R.AY0032IY * 7363 * Target Table: Extract Target - work.W6NKOVYO A50D7W6R.AY0032J7 * 7364 *============================================================================*/ 7365 7366 %let SYSLAST = %nrquote(work.W6NINDD1); 7367 7368 %let transformID = %quote(A50D7W6R.AR0030B5); 7369 7370 %let trans_rc = 0; 7371 7372 proc datasets lib = work nolist nowarn memtype = (data view); 7373 delete W6NKOVYO; 7374 quit; 7375 7376 proc sql; 7377 create table work.W6NKOVYO as 7378 select CDCLIENTE length = 9 label = 'CDCLIENTE', 203 The SAS System 12:24 Tuesday, January 12, 2016 7379 LNCLIENTE length = 80 label = 'LNCLIENTE', 7380 CDCONTRATO length = 16 label = 'CDCONTRATO', 7381 CDPRODUTO length = 4 label = 'CDPRODUTO', 7382 CDBALCAO length = 3 label = 'CDBALCAO', 7383 CDMOEDA length = 3 label = 'CDMOEDA', 7384 MTACTUALLC length = 8 label = 'MTACTUALLC', 7385 COMISSAO length = 15 label = 'COMISSAO', 7386 TP_CLIENTE length = 15 label = 'TP_CLIENTE', 7387 DTPROC length = 10 label = 'DTPROC', 7388 IMPOSTO length = 15 label = 'IMPOSTO', 7389 LICATEGCLIENTE length = 80 label = 'LICATEGCLIENTE', 7390 IDENT length = 4 label = 'IDENT', 7391 (sum(MTACTUALLC)) as SUM_MTACTUALLC length = 8 7392 from &SYSLAST 7393 group by CDCLIENTE; 7394 quit; 7395 7396 %let SYSLAST = work.W6NKOVYO; 7397 7398 %rcSet(&sqlrc); 7399 7400 /*============================================================================* 7401 * Step: MTACTUALLC < 20000 A50D7W6R.AR0030B6 * 7402 * Transform: Extract * 7403 * Description: * 7404 * * 7405 * Source Table: Extract Target - work.W6NKOVYO A50D7W6R.AY0032J7 * 7406 * Target Table: Extract Target - work.W6NKOYEV A50D7W6R.AY0032J8 * 7407 *============================================================================*/ 7408 7409 %let SYSLAST = %nrquote(work.W6NKOVYO); 7410 7411 %let transformID = %quote(A50D7W6R.AR0030B6); 7412 7413 %let trans_rc = 0; 7414 7415 proc datasets lib = work nolist nowarn memtype = (data view); 7416 delete W6NKOYEV; 7417 quit; 7418 7419 proc sql; 7420 create table work.W6NKOYEV as 7421 select CDCLIENTE length = 9 label = 'CDCLIENTE', 7422 LNCLIENTE length = 80 label = 'LNCLIENTE', 7423 CDCONTRATO length = 16 label = 'CDCONTRATO', 7424 CDPRODUTO length = 4 label = 'CDPRODUTO', 7425 CDBALCAO length = 3 label = 'CDBALCAO', 7426 CDMOEDA length = 3 label = 'CDMOEDA', 7427 MTACTUALLC length = 8 label = 'MTACTUALLC', 7428 COMISSAO length = 15 label = 'COMISSAO', 7429 TP_CLIENTE length = 15 label = 'TP_CLIENTE', 7430 DTPROC length = 10 label = 'DTPROC', 7431 IMPOSTO length = 15 label = 'IMPOSTO', 7432 LICATEGCLIENTE length = 80 label = 'LICATEGCLIENTE', 7433 IDENT length = 4 label = 'IDENT' 7434 from &SYSLAST 7435 where SUM_MTACTUALLC < 20000; 7436 quit; 204 The SAS System 12:24 Tuesday, January 12, 2016 7437 7438 %let SYSLAST = work.W6NKOYEV; 7439 7440 %rcSet(&sqlrc); 7441 7442 /*============================================================================* 7443 * Step: DEL_BY_DATE A50D7W6R.AR0030B7 * 7444 * Transform: DEL_BY_DATE * 7445 * Description: * 7446 * * 7447 * Source Table: Extract Target - work.W6NKOYEV A50D7W6R.AY0032J8 * 7448 * Target Table: DEL_BY_DATE - work.W6NKP0CJ A50D7W6R.AY0032J9 * 7449 *============================================================================*/ 7450 7451 %let SYSLAST = %nrquote(work.W6NKOYEV); 7452 7453 %let transformID = %quote(A50D7W6R.AR0030B7); 7454 7455 %let trans_rc = 0; 7456 7457 /* Source table(s)/view(s) */ 7458 %let _INPUT1 = work.W6NKOYEV; 7459 7460 /* Target table/view(s) */ 7461 %let _OUTPUT = work.W6NKP0CJ; 7462 %let _OUTPUT1 = work.W6NKP0CJ; 7463 7464 /* Delete target table(s) */ 7465 proc datasets lib=work nolist nowarn memtype = (data view); 7466 delete W6NKP0CJ; 7467 quit; 7468 7469 /* Options */ 7470 %let data_col = %nrquote(DTPROC); 7471 %let rel_table = %nrquote(GLBBESA.S_ODS_DW148); 7472 %let data_apagar = %nrquote(&dataparam); 7473 7474 /* List of target columns to keep */ 7475 %let keep = CDCLIENTE LNCLIENTE CDCONTRATO CDPRODUTO CDBALCAO CDMOEDA 7476 MTACTUALLC COMISSAO TP_CLIENTE DTPROC IMPOSTO LICATEGCLIENTE 7477 IDENT; 7478 7479 %macro connect_oracle(schema); 7480 7481 connect to ORACLE 7482 ( 7483 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 7484 PATH = &ORACLE_CTB_SID 7485 USER = &ORACLE_CTB_USER 7486 PASSWORD = &ORACLE_CTB_PASSWORD 7487 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 7488 PATH = &ORACLE_DM_SID 7489 USER = &ORACLE_DM_USER 7490 PASSWORD = &ORACLE_DM_PASSWORD 7491 %END; 7492 ) 7493 7494 205 The SAS System 12:24 Tuesday, January 12, 2016 7495 %mend connect_oracle; 7496 7497 %macro tab_oracle(tabela); 7498 %let schema=%scan(&tabela,1); 7499 %IF %UPCASE(&schema) = GLBBESA 7500 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 7501 %ELSE %DO; &tabela %END; 7502 7503 7504 %mend tab_oracle; 7505 7506 7507 7508 7509 7510 /* Converte data DateTime em Data */ 7511 data _null_; 7512 format a Datetime.; 7513 a = &data_apagar; 7514 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 7515 run; 7516 7517 7518 7519 proc sql; 7520 %connect_oracle(%scan(&rel_table,1)); 7521 7522 execute( 7523 delete from %tab_oracle(&rel_table) 7524 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 7525 7526 disconnect from ORACLE; 7527 quit; 7528 7529 7530 proc sql; 7531 create view &_OUTPUT1 as 7532 select * 7533 from &_INPUT1; 7534 quit; 7535 7536 7537 7538 7539 7540 %rcSet(&syserr); 7541 %rcSet(&sysrc); 7542 %rcSet(&sqlrc); 7543 7544 /*============================================================================* 7545 * Step: SQL Join A50D7W6R.AR0030G3 * 7546 * Transform: SQL Join (Version 2) * 7547 * Description: * 7548 * * 7549 * Source Tables: DEL_BY_DATE - work.W6NKP0CJ A50D7W6R.AY0032J9 * 7550 * S_ODS_DW148_IN - GLBBESA.S_ODS_DW148 A5NJAD6Z.BJ0013D7 * 7551 * Target Table: SQL Target - work.W6O48460 A50D7W6R.AY0032NF * 7552 *============================================================================*/ 206 The SAS System 12:24 Tuesday, January 12, 2016 7553 7554 /* Access the data for GLBBESA */ 7555 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 7555 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 7556 %rcSet(&syslibrc); 7557 7558 %let transformID = %quote(A50D7W6R.AR0030G3); 7559 7560 %let trans_rc = 0; 7561 7562 proc datasets lib = work nolist nowarn memtype = (data view); 7563 delete W6O48460; 7564 quit; 7565 7566 proc sql; 7567 create table work.W6O48460 as 7568 select 7569 W6NKP0CJ.CDCLIENTE length = 9 7570 format = $9. 7571 informat = $9. 7572 label = 'CDCLIENTE', 7573 W6NKP0CJ.LNCLIENTE length = 80 7574 format = $80. 7575 informat = $80. 7576 label = 'LNCLIENTE', 7577 W6NKP0CJ.CDCONTRATO length = 16 7578 format = $16. 7579 informat = $16. 7580 label = 'CDCONTRATO', 7581 W6NKP0CJ.CDPRODUTO length = 4 7582 format = $4. 7583 informat = $4. 7584 label = 'CDPRODUTO', 7585 W6NKP0CJ.CDBALCAO length = 3 7586 format = $3. 7587 informat = $3. 7588 label = 'CDBALCAO', 7589 W6NKP0CJ.CDMOEDA length = 3 7590 format = $3. 7591 informat = $3. 7592 label = 'CDMOEDA', 7593 W6NKP0CJ.MTACTUALLC length = 8 7594 format = 25.3 7595 informat = 25.3 7596 label = 'MTACTUALLC', 7597 W6NKP0CJ.COMISSAO length = 15 7598 format = $15. 7599 informat = $15. 7600 label = 'COMISSAO', 7601 W6NKP0CJ.TP_CLIENTE length = 15 7602 format = $15. 7603 informat = $15. 7604 label = 'TP_CLIENTE', 7605 W6NKP0CJ.DTPROC length = 10 7606 format = $10. 7607 informat = $10. 7608 label = 'DTPROC', 7609 W6NKP0CJ.IMPOSTO length = 15 207 The SAS System 12:24 Tuesday, January 12, 2016 7610 format = $15. 7611 informat = $15. 7612 label = 'IMPOSTO', 7613 W6NKP0CJ.LICATEGCLIENTE length = 80 7614 format = $80. 7615 informat = $80. 7616 label = 'LICATEGCLIENTE', 7617 W6NKP0CJ.IDENT length = 4 7618 format = $4. 7619 informat = $4. 7620 label = 'IDENT' 7621 from 7622 work.W6NKP0CJ left join 7623 GLBBESA.S_ODS_DW148 7624 on 7625 ( 7626 W6NKP0CJ.CDCLIENTE = S_ODS_DW148.CDCLIENTE 7627 and W6NKP0CJ.CDCONTRATO = S_ODS_DW148.CDCONTRATOREL 7628 ) 7629 where 7630 S_ODS_DW148.CDCLIENTE IS NULL 7631 ; 7632 quit; 7633 7634 %rcSet(&sqlrc); 7635 7636 %macro etls_completeTarget(); 7637 %mend etls_completeTarget; 7638 %etls_completeTarget; 7639 7640 /*============================================================================* 7641 * Step: Table Loader A50D7W6R.AR0030AW * 7642 * Transform: Table Loader (Version 2) * 7643 * Description: * 7644 * * 7645 * Source Table: SQL Target - work.W6O48460 A50D7W6R.AY0032NF * 7646 * Target Table: S_ODS_DW148 - GLBBESA.S_ODS_DW148 A5NJAD6Z.BJ0013CS * 7647 *============================================================================*/ 7648 7649 %let SYSLAST = %nrquote(work.W6O48460); 7650 7651 %let transformID = %quote(A50D7W6R.AR0030AW); 7652 7653 %let trans_rc = 0; 7654 7655 %global etls_tableExist; 7656 %global etls_numIndex; 7657 %global etls_lastTable; 7658 %let etls_tableExist = -1; 7659 %let etls_numIndex = -1; 7660 %let etls_lastTable = &SYSLAST; 7661 7662 /*---- Define load data macro ----*/ 7663 %macro etls_loader; 7664 7665 %let SYSOPT = ; 7666 7667 /*---- Map the columns ----*/ 208 The SAS System 12:24 Tuesday, January 12, 2016 7668 proc datasets lib = work nolist nowarn memtype = (data view); 7669 delete mapped; 7670 quit; 7671 7672 %put %str(NOTE: Mapping columns ...); 7673 proc sql; 7674 create view work.mapped as 7675 select IDENT length = 4, 7676 CDCLIENTE length = 9, 7677 LNCLIENTE length = 80, 7678 CDCONTRATO as CDCONTRATOREL length = 16, 7679 CDPRODUTO length = 4, 7680 CDBALCAO length = 3, 7681 CDMOEDA length = 3, 7682 MTACTUALLC as SALDO_AOA length = 8 format = 20.3 informat = 20.3, 7683 COMISSAO length = 15, 7684 IMPOSTO length = 15, 7685 TP_CLIENTE as TPCLIENTE length = 15, 7686 LICATEGCLIENTE length = 80, 7687 DTPROC length = 10 7688 from &etls_lastTable; 7689 quit; 7690 7691 %let SYSLAST = work.mapped; 7692 7693 %let etls_lastTable = &SYSLAST; 7694 %let SYSOPT = ; 7695 7696 /* Determine if the target table exists */ 7697 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.S_ODS_DW148, DATA)) or 7698 %sysfunc(exist(GLBBESA.S_ODS_DW148, VIEW))); 7699 7700 /*---- Create a new table ----*/ 7701 %if (&etls_tableExist eq 0) %then 7702 %do; /* if table does not exist */ 7703 7704 %put %str(NOTE: Creating table ...); 7705 7706 data GLBBESA.S_ODS_DW148 7707 (dbnull = ( 7708 IDENT = YES 7709 CDCLIENTE = YES 7710 LNCLIENTE = YES 7711 CDCONTRATOREL = YES 7712 CDPRODUTO = YES 7713 CDBALCAO = YES 7714 CDMOEDA = YES 7715 SALDO_AOA = YES 7716 COMISSAO = YES 7717 IMPOSTO = YES 7718 TPCLIENTE = YES 7719 LICATEGCLIENTE = YES 7720 DTPROC = YES)); 7721 attrib IDENT length = $4 format = $4. informat = $4. 7722 label = 'IDENT'; 7723 attrib CDCLIENTE length = $9 format = $9. informat = $9. 7724 label = 'CDCLIENTE'; 7725 attrib LNCLIENTE length = $80 format = $80. informat = $80. 209 The SAS System 12:24 Tuesday, January 12, 2016 7726 label = 'LNCLIENTE'; 7727 attrib CDCONTRATOREL length = $16 format = $16. informat = $16. 7728 label = 'CDCONTRATOREL'; 7729 attrib CDPRODUTO length = $4 format = $4. informat = $4. 7730 label = 'CDPRODUTO'; 7731 attrib CDBALCAO length = $3 format = $3. informat = $3. 7732 label = 'CDBALCAO'; 7733 attrib CDMOEDA length = $3 format = $3. informat = $3. 7734 label = 'CDMOEDA'; 7735 attrib SALDO_AOA length = 8 format = 20.3 informat = 20.3 7736 label = 'SALDO_AOA'; 7737 attrib COMISSAO length = $15 format = $15. informat = $15. 7738 label = 'COMISSAO'; 7739 attrib IMPOSTO length = $15 format = $15. informat = $15. 7740 label = 'IMPOSTO'; 7741 attrib TPCLIENTE length = $15 format = $15. informat = $15. 7742 label = 'TPCLIENTE'; 7743 attrib LICATEGCLIENTE length = $80 format = $80. informat = $80. 7744 label = 'LICATEGCLIENTE'; 7745 attrib DTPROC length = $10 format = $10. informat = $10. 7746 label = 'DTPROC'; 7747 stop; 7748 run; 7749 7750 %rcSet(&syserr); 7751 7752 %end; /* if table does not exist */ 7753 7754 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 7755 7756 /*---- Append new data ----*/ 7757 %put %str(NOTE: Appending data ...); 7758 7759 proc append base = GLBBESA.S_ODS_DW148 7760 data = &etls_lastTable (&SYSOPT) force; 7761 run; 7762 7763 %rcSet(&syserr); 7764 7765 proc datasets lib = work nolist nowarn memtype = (data view); 7766 delete mapped; 7767 quit; 7768 7769 %mend etls_loader; 7770 %etls_loader; 7771 7772 %sysrput job_rc&handleName = &job_rc; 7773 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 7774 7775 %mend etls_jobW6O7ZESS; 7776 7777 %etls_jobW6O7ZESS; 7778 7779 endrsubmit; 7780 7781 %mend etls_processToLoopW6O7ZESI; 7782 7783 %local etls_controlTable etls_statusTable etls_controlName 210 The SAS System 12:24 Tuesday, January 12, 2016 7784 etls_processesRunning etls_maxProcesses etls_parameterTable 7785 etls_additionalSignonOptions etls_signonRetries; 7786 %let etls_controlName = L18_; 7787 %let etls_statusTable = work.W6O48PP3; 7788 %let etls_parameterTable = work.W6O7ZESN; 7789 %let etls_workload = ; 7790 %let etls_additionalSignonOptions = ; 7791 %let etls_signonRetries = 3; 7792 %let &etls_controlName = 0; 7793 %let etls_controlTable = work.W6O48PLY; 7794 7795 %put %str(NOTE: Creating status table...); 7796 data &etls_statusTable 7797 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 7798 etls_status etls_jobRC 7799 ); 7800 attrib etls_handleName length = $32 7801 label = 'Name of handle to remote session'; 7802 attrib etls_machineId length = $32 7803 label = 'Name of machine executing the task'; 7804 attrib etls_startTime length = 8 format = nldatmap. 7805 label = 'Start time of task'; 7806 attrib etls_endTime length = 8 format = nldatmap. 7807 label = 'End time of task'; 7808 attrib etls_status length = $32 7809 label = 'Current status of task'; 7810 attrib etls_jobRC length = 8 7811 label = 'Return code of task'; 7812 set &etls_controlTable; 7813 run; 7814 7815 %rcSet(&syserr); 7816 7817 %put %str(NOTE: Creating parameter table...); 7818 proc sql; 7819 create table &etls_parameterTable as 7820 select DTFIM as dataParam 7821 from &etls_controlTable; 7822 quit; 7823 7824 %rcSet(&sqlrc); 7825 7826 /* Get the number of times to iterate from the number of rows in the source */ 7827 /* table */ 7828 proc sql noprint; 7829 select count(*) into :&etls_controlName._max from &etls_statusTable; 7830 %let &etls_controlName._max = &&&etls_controlName._max; 7831 quit; 7832 7833 %rcSet(&sqlrc); 7834 7835 %let etls_gridInstalled =; 7836 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 7837 7838 %if (%str(&etls_gridInstalled) ne %str()) %then 7839 %do; 7840 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 7841 %if (&etls_maxProcesses = 0) %then 211 The SAS System 12:24 Tuesday, January 12, 2016 7842 %do; 7843 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 7844 processes to SYSNCPU value.); 7845 %let etls_maxProcesses = &SYSNCPU; 7846 %end; 7847 %end; 7848 %else 7849 %do; 7850 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 7851 processes to SYSNCPU value.); 7852 %let etls_maxProcesses = &SYSNCPU; 7853 %end; 7854 7855 %if (&etls_maxProcesses > 0) %then 7856 %do; 7857 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 7858 7859 %let etls_lastLoopPtr = &&&etls_controlName; 7860 7861 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 7862 processCountMacro=etls_processesRunning, statusSetting="Running"); 7863 7864 %do %while(&etls_processesRunning lt &&&etls_controlName._max 7865 and &etls_processesRunning lt &etls_maxProcesses 7866 and &&&etls_controlName lt &&&etls_controlName._max); 7867 7868 %let &etls_controlName = %eval(&&&etls_controlName+1); 7869 7870 %global etls_signonStatus; 7871 %let etls_logOutputPath = &DIR_PRJ_LOG.; 7872 7873 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 7874 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 7875 row=&&&etls_controlName, machineVariable=etls_machineId, 7876 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 7877 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 7878 7879 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 7880 processCountMacro=etls_processesRunning, statusSetting="Running"); 7881 7882 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 7883 %etls_processToLoopW6O7ZESI(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 7884 handleName=%etls_getHandle(statusTable=&etls_statusTable, 7885 handleVariable=etls_handleName, row=&&&etls_controlName)); 7886 %else 7887 %do; /* if signon error, set iterator to max to force loop to stop. */ 7888 %let &etls_controlName = &&&etls_controlName._max; 7889 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 7890 %end; 7891 %end; 7892 7893 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 7894 runningStatusSetting="Running", handleVariable=etls_handleName, 7895 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 7896 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 7897 returnCodeVariable=etls_jobRC, 7898 statusUnknownReturnCode=.); 7899 212 The SAS System 12:24 Tuesday, January 12, 2016 7900 %end; 7901 7902 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 7903 runningStatusSetting="Running", handleVariable=etls_handleName, 7904 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 7905 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 7906 returnCodeVariable=etls_jobRC, 7907 statusUnknownReturnCode=.); 7908 7909 %end; 7910 7911 proc datasets lib = work nolist nowarn memtype = (data view); 7912 delete W6O7ZESN; 7913 quit; 7914 7915 %mend etls_loopW6O7ZES8; 7916 7917 %etls_loopW6O7ZES8; NOTE: Line generated by the invoked macro "ETLS_LOOPW6O7ZES8". 7917 case when (TCLIENTE.CDBALCAO in ( '951' ) and W6NK6WAN.MTACTUALLC >= 2014 ) then '0'when ___ 49 7917 ! (W6NK6WAN.MTACTUALLC < 2014 ) then 'SALDO INSUF.' else '14' end as IMPOSTO length = 15 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_LOOPW6O7ZES8): data work.W6O48PP3 (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC ); MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZES8): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6O48PLY MPRINT(ETLS_LOOPW6O7ZES8): set work.W6O48PLY; MPRINT(ETLS_LOOPW6O7ZES8): run; NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W6O48PLY. NOTE: The data set WORK.W6O48PP3 has 1 observations and 6 variables. NOTE: Compressing data set WORK.W6O48PP3 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.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 213 The SAS System 12:24 Tuesday, January 12, 2016 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZES8): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZES8): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZESN SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6O48PLY MPRINT(ETLS_LOOPW6O7ZES8): create table work.W6O7ZESN as select DTFIM as dataParam from work.W6O48PLY; NOTE: Compression was disabled for data set WORK.W6O7ZESN because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZESN created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZES8): quit; 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 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZES8): ; MPRINT(ETLS_LOOPW6O7ZES8): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_LOOPW6O7ZES8): select count(*) into :L18__max from work.W6O48PP3; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZES8): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 226k Page Faults 0 Page Reclaims 0 214 The SAS System 12:24 Tuesday, January 12, 2016 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZES8): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZES8): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6O48PP3 where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 215 The SAS System 12:24 Tuesday, January 12, 2016 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZES8): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L18_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L18_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds 216 The SAS System 12:24 Tuesday, January 12, 2016 system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable GRIDRC resolves to L18_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L18_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L18_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.12 seconds cpu time 0.09 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_work17D100000126_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.12 seconds user cpu time 0.04 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 97 Involuntary Context Switches 2 Block Input Operations 1 Block Output Operations 0 /opt/sasdata/work/SAS_work17D100000126_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L18_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.02 seconds user cpu time 0.01 seconds system cpu time 0.02 seconds Memory 223k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 24 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 217 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_CREATEHANDLE): data work.W6O48PP3; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_CREATEHANDLE): modify work.W6O48PP3 point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L18_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L18_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W6O48PP3 has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 308k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZES8): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 218 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6O48PP3 where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZES8): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZESN SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESN SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESN MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZESN"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 219 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L18_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZESN MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZESN, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable dataParam with statement:%syslput dataParam= 1764460800 / remote = L18_1; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 220 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZESI): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L18_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L18_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L18_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZESI): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L18_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L18_1.lst" ; 217 The SAS System 12:28 Tuesday, January 12, 2016 NOTE: Background remote submit to L18_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_WAITFOR): proc sql noprint; NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6O48PP3 where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 230 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W6O48PP3 where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 NOTE: Remote signoff from L18_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 45.12 seconds user cpu time 20.39 seconds system cpu time 5.20 seconds Memory 107147k Page Faults 9 Page Reclaims 1476 Page Swaps 0 Voluntary Context Switches 27347 Involuntary Context Switches 688 Block Input Operations 5 Block Output Operations 596 NOTE: Remote signoff from L18_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L18_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL18_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. 231 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL18_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL18_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL18_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL18_1 SYMBOLGEN: Macro variable JOB_RCL18_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L18_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L18_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L18_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 232 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L18_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L18_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L18_1"); MPRINT(ETLS_FREEHANDLE): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_FREEHANDLE): data work.W6O48PP3; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L18_1" MPRINT(ETLS_FREEHANDLE): modify work.W6O48PP3(where=(etls_handleName = "L18_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L18_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L18_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L18_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L18_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L18_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L18_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL18_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL18_1"),32.); 233 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W6O48PP3. WHERE etls_handleName='L18_1'; NOTE: The data set WORK.W6O48PP3 has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 650k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 2 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L18_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L18_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 234 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L18_1 NOTE: Process L18_1 has completed. MPRINT(ETLS_LOOPW6O7ZES8): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L18_ SYMBOLGEN: Macro variable L18__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6O48PP3 MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6O48PP3 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6O48PP3 where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZES8): ; MPRINT(ETLS_LOOPW6O7ZES8): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZES8): delete W6O7ZESN; MPRINT(ETLS_LOOPW6O7ZES8): quit; NOTE: Deleting WORK.W6O7ZESN (memtype=DATA). 235 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 7918 7919 /*============================================================================* 7920 * Step: Loop End A50D7W6R.B6001ADI * 7921 * Transform: Loop End * 7922 * Description: * 7923 *============================================================================*/ 7924 7925 /*============================================================================* 7926 * Step: Loop A50D7W6R.B6001AB2 * 7927 * Transform: Loop * 7928 * Description: * 7929 * * 7930 * Source Table: SAS Splitter - work.W6MR01OE A50D7W6R.AY0032DG * 7931 * Target Table: Status Table - work.W6MR01SB A50D7W6R.AY0032DI * 7932 *============================================================================*/ 7933 7934 %let SYSLAST = %nrquote(work.W6MR01OE); 7935 7936 %let transformID = %quote(A50D7W6R.B6001AB2); 7937 7938 %let trans_rc = 0; 7939 7940 %macro genSASCommand; 7941 %local noobjserver; 7942 %if "&sysscp"="OS" %then %let noobjserver=; 7943 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 7944 %else %let noobjserver=%quote(-noobjectserver); 7945 options sascmd = "!sascmd &noobjserver"; 7946 %mend genSASCommand; 7947 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 7948 7949 %macro etls_tsLevel(macroName=, featureName=); 7950 data _null_; 7951 call symput("¯oName",tslvl("&featureName")); 7952 run; 7953 %mend etls_tsLevel; 7954 7955 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 7956 gridRC=rc, useGrid=1, 236 The SAS System 12:24 Tuesday, January 12, 2016 7957 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 7958 log=, output=, additionalSignonOptions=, signonRetries=3); 7959 7960 %let etls_gridInstalled =; 7961 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 7962 7963 %if (&useGrid = 1) %then 7964 %do; 7965 %if ("&etls_gridInstalled" ne "") %then 7966 %do; 7967 %if (&gridRC eq ) %then 7968 %let gridRC = &handleName.RC ; 7969 7970 %global &gridRC; 7971 %let workload = ; 7972 %if (&workloadMacroVariable ne ) %then 7973 %do; 7974 data _null_; 7975 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 7976 run; 7977 %end; 7978 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 7979 %end; 7980 %else 7981 %put %str(NOTE: Grid service functions are not installed.); 7982 %end; 7983 7984 %local sleeptime sleepIncreaseAmount tryCount; 7985 %let sleepIncreaseAmount=5; 7986 %let sleeptime=5; 7987 %let tryCount=1; 7988 %let &cmacvar=1; 7989 7990 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 7991 data _null_; 7992 signon &handleName cmacvar=&cmacvar 7993 %if ("&log" ne "") %then 7994 log=&log; 7995 %if ("&output" ne "") %then 7996 output=&output; 7997 %if ("&additionalSignonOptions" ne "") %then 7998 &additionalSignonOptions; 7999 ;run; 8000 8001 %if ("&machineIdMacroVariable" ne "") %then 8002 %do; 8003 %if ("&etls_gridInstalled" ne "") %then 8004 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 8005 %else 8006 %put %str(NOTE: Grid service functions are not installed.); 8007 %end; 8008 8009 %if "&&&cmacvar" eq "1" %then 8010 %do; 8011 %if &tryCount lt %eval(&signonRetries+1) %then 8012 %do; 8013 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 8014 %let rc=%sysfunc(sleep(&sleeptime,1)); 237 The SAS System 12:24 Tuesday, January 12, 2016 8015 %end; 8016 %else %if &signonRetries gt 0 %then 8017 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 8018 8019 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 8020 %let tryCount=%eval(&tryCount+1); 8021 %end; 8022 %end; 8023 %rcSet(&syserr); 8024 8025 %mend etls_signon; 8026 8027 %macro etls_serverConnected(serverId=,macvarname=isConnected); 8028 %let &macvarname=0; 8029 %local search_str none_str savenotes; 8030 8031 /* setup information for listtask output */ 8032 /* listtask output on OS/390 differs */ 8033 %if %bquote(&sysscp) eq OS %then 8034 %do; 8035 %let search_str=Remote submit for; 8036 %let token=5; 8037 %end; 8038 %else 8039 %do; 8040 %let search_str=--------------; 8041 %let token=1; 8042 %end; 8043 8044 /* Issue listtask within PROC PRINTTO - send output to file */ 8045 filename __tmptxt TEMP; 8046 %let savenotes=%sysfunc(getoption(notes)); 8047 options nonotes; 8048 8049 proc printto log=__tmptxt new; 8050 run; 8051 8052 options notes; 8053 listtask; 8054 proc printto; 8055 run; 8056 8057 options nonotes; 8058 8059 /* read in the output from listtask */ 8060 %let dsname=_null_; 8061 data _null_(keep=Session); 8062 length line $256 sessionId $60; 8063 infile __tmptxt length=len; 8064 input @1 line $varying. len; 8065 8066 if line=:'There are no' then 8067 stop; 8068 /* look for the search string and scan for server name */ 8069 if index(line,"&search_str") then 8070 do; 8071 sessionId=scan(line,&token," "); 8072 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 238 The SAS System 12:24 Tuesday, January 12, 2016 8073 if sessionId=upcase(symget("serverId")) then 8074 do; 8075 call symput("&macvarname","1"); 8076 stop; 8077 end; 8078 end; 8079 run; 8080 filename __tmptxt clear; 8081 options &savenotes; 8082 %mend etls_serverConnected; 8083 8084 %macro etls_signoff(handleName=rmt); 8085 %local savemprint; 8086 %let savemprint=%sysfunc(getoption(mprint)); 8087 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 8088 options nomprint; 8089 %local isConnected; 8090 %etls_serverConnected(serverId=&handleName); 8091 options &savemprint; 8092 %if &isConnected %then 8093 signoff &handleName ;; 8094 %mend etls_signoff; 8095 8096 %macro etls_getHandle(statusTable=, handleVariable=, row=); 8097 %let etls_dsid = %sysfunc(open(&statusTable)); 8098 %if (&etls_dsid = 0) %then 8099 %put %sysfunc(sysmsg()); 8100 %else 8101 %do; 8102 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 8103 %if (&rc ne 0) %then 8104 %put %sysfunc(sysmsg()); 8105 %else 8106 %do; 8107 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 8108 %if (&etls_varnum > 0) %then 8109 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 8110 %else 8111 %put %sysfunc(sysmsg()); 8112 %end; 8113 %let rc = %sysfunc(close(&etls_dsid)); 8114 %end; 8115 %mend etls_getHandle; 8116 8117 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 8118 handleName=, statusSetting="Finished", 8119 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 8120 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 8121 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 8122 8123 %if ("&statusTable" ne "") %then 8124 %do; 8125 %local etls_rcMacroVarExisted; 8126 %let etls_rcMacroVarExisted = 0; 8127 %if ("&returnCodeMacroVariable" ne "") %then 8128 %do; 8129 proc sql noprint; 8130 select '1' into: etls_rcMacroVarExisted from dictionary.macros 239 The SAS System 12:24 Tuesday, January 12, 2016 8131 where name=upcase("&returnCodeMacroVariable"); 8132 quit; 8133 8134 %rcSet(&sqlrc); 8135 %if (&etls_rcMacroVarExisted = 0) %then 8136 %do; 8137 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 8138 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 8139 %end; 8140 %if (&setMainJobRC eq 1) %then 8141 %rcSet(&&&returnCodeMacroVariable); 8142 %end; 8143 %else 8144 %do; 8145 %let returnCodeMacroVariable=etls_rcmacvar; 8146 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 8147 %end; 8148 8149 %local etls_startTimeMacroVarExisted; 8150 %let etls_startTimeMacroVarExisted = 0; 8151 %if ("&startTimeMacroVariable" ne "") %then 8152 %do; 8153 proc sql noprint; 8154 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 8155 where name=upcase("&startTimeMacroVariable"); 8156 quit; 8157 8158 %rcSet(&sqlrc); 8159 %if (&etls_startTimeMacroVarExisted = 0) %then 8160 %do; 8161 %put WARNING: Start time from inner job not found. No value will be set.; 8162 %let &startTimeMacroVariable=; 8163 %end; 8164 %end; 8165 8166 %local etls_endTimeMacroVarExisted; 8167 %let etls_endTimeMacroVarExisted = 0; 8168 %if ("&endTimeMacroVariable" ne "") %then 8169 %do; 8170 proc sql noprint; 8171 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 8172 where name=upcase("&endTimeMacroVariable"); 8173 quit; 8174 8175 %rcSet(&sqlrc); 8176 %if (&etls_endTimeMacroVarExisted = 0) %then 8177 %do; 8178 %put WARNING: End time from inner job not found. Setting end time to current time.; 8179 %let &endTimeMacroVariable=%sysfunc(datetime()); 8180 %end; 8181 %end; 8182 8183 data &statusTable; 8184 modify &statusTable(where=(&handleVariable = &handleName)); 8185 %if ("&startTimeMacroVariable" ne "") %then 8186 %do; 8187 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 8188 %end; 240 The SAS System 12:24 Tuesday, January 12, 2016 8189 %if ("&endTimeVariable" ne "") %then 8190 %do; 8191 %if ("&endTimeMacroVariable" ne "") %then 8192 %do; 8193 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 8194 %end; 8195 %else 8196 &endTimeVariable = datetime();; 8197 %end; 8198 %if ("&returnCodeVariable" ne "") %then 8199 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 8200 %if ("&statusVariable" ne "") %then 8201 %do; 8202 if (symget("etls_rcMacroVarExisted") eq "0") then 8203 &statusVariable = "Unknown Status"; 8204 else 8205 &statusVariable = &statusSetting; 8206 %end; 8207 call symput('handle',&handleVariable); 8208 replace; 8209 stop; 8210 run; 8211 8212 %rcSet(&syserr); 8213 8214 %if (&signoff eq 1) %then 8215 %etls_signoff(handleName=&handle); 8216 %end; 8217 %mend etls_freeHandle; 8218 8219 %macro etls_createHandle(statusTable=, statusVariable=, 8220 handleVariable=, handlePrefix=rmt, 8221 workloadMacroVariable=, row=, machineVariable=, 8222 statusSetting="Running", startTimeVariable=startTime, 8223 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 8224 additionalSignonOptions=, signonRetries= ); 8225 8226 %local remoteSessionId; 8227 %let remoteSessionId = &handlePrefix.&row; 8228 %let &cmacvar = 1; 8229 %local etls_machineId; 8230 %if (&signon eq 1) %then 8231 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 8232 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 8233 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 8234 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 8235 %else %let &cmacvar=0; 8236 8237 data &statusTable; 8238 retain ptr &row; 8239 modify &statusTable point = ptr; 8240 &handleVariable = "&remoteSessionId"; 8241 %if (&signon eq 1) %then 8242 &machineVariable = "&etls_machineId";; 8243 %if (&&&cmacvar ne 0) %then 8244 %do; 8245 &statusVariable = "Failed Signon"; 8246 %end; 241 The SAS System 12:24 Tuesday, January 12, 2016 8247 %else 8248 &statusVariable = &statusSetting;; 8249 %if (&startTimeVariable ne ) %then 8250 &startTimeVariable = datetime();; 8251 replace; 8252 stop; 8253 run; 8254 8255 %rcSet(&syserr); 8256 %mend etls_createHandle; 8257 8258 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 8259 completeStatusSetting="Finished", endTimeVariable=endTime, 8260 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 8261 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 8262 8263 proc sql noprint; 8264 select count(*) into :etls_rows 8265 from &statusTable where &statusVariable = &runningStatusSetting; 8266 %let etls_rows = &etls_rows; 8267 %if (&etls_rows gt 0) %then 8268 %do; 8269 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 8270 from &statusTable where &statusVariable = &runningStatusSetting; 8271 %end; 8272 quit; 8273 8274 %rcSet(&sqlrc); 8275 8276 %if (&etls_rows gt 0) %then 8277 %do; 8278 waitfor &waitType 8279 %do i=1 %to &etls_rows; 8280 &&etlsHandles&i 8281 %end; 8282 ; 8283 %end; 8284 8285 %local useDefaultRCMacVar; 8286 %if ("&returnCodeMacroVariable" eq "") %then 8287 %let useDefaultRCMacVar=Y; 8288 8289 %do i=1 %to &etls_rows; 8290 8291 %if ("&useDefaultRCMacVar"="Y") %then 8292 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 8293 8294 waitfor &&etlsHandles&i timeout=1; 8295 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 8296 %do; 8297 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 8298 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 8299 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 8300 startTimeVariable=&startTimeVariable, signoff=&signoff, 8301 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 8302 statusUnknownReturnCode=&statusUnknownReturnCode, 8303 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 8304 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 242 The SAS System 12:24 Tuesday, January 12, 2016 8305 %put NOTE: Process &&etlsHandles&i. has completed.; 8306 %end; 8307 %else %if (&SYSRC ne -1) %then /* process status unknown */ 8308 %do; 8309 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 8310 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 8311 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 8312 startTimeVariable=&startTimeVariable, signoff=&signoff, 8313 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 8314 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 8315 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 8316 %end; 8317 %end; 8318 %mend etls_waitfor; 8319 8320 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 8321 statusSetting="Running"); 8322 8323 proc sql noprint; 8324 select count(*) into: &processCountMacro 8325 from &statusTable where &statusVariable = &statusSetting; 8326 quit; 8327 8328 %rcSet(&sqlrc); 8329 %mend etls_getProcessesRunning; 8330 8331 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 8332 %let ¶meterVariableMacro = ; 8333 %let dsid = %sysfunc(open(¶meterTable)); 8334 %if (&dsid gt 0) %then 8335 %do; 8336 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 8337 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 8338 %end; 8339 %let dsid = %sysfunc(close(&dsid)); 8340 %end; 8341 %else 8342 %put %sysfunc(sysmsg()); 8343 %rcSet(&syserr); 8344 %mend etls_getParameterNames; 8345 8346 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 8347 data _null_; 8348 length vname $256 vtype $1 value $3200; 8349 dsid = open("¶meterTable"); 8350 if (dsid > 0) then 8351 do; 8352 do _i = 1 to &row; 8353 fetchrc = fetch(dsid); 8354 end; 8355 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 8356 vname = varname(dsid,_i); 8357 vtype = vartype(dsid,_i); 8358 if (fetchrc = 0) then 8359 do; 8360 if (vtype = 'C') then 8361 do; 8362 value = getvarc(dsid,_i); 243 The SAS System 12:24 Tuesday, January 12, 2016 8363 value = tranwrd(value,"%","%%"); 8364 value = tranwrd(value,"(","%("); 8365 value = tranwrd(value,")","%)"); 8366 value = tranwrd(value,'"','%"'); 8367 end; 8368 else 8369 value = left(put(getvarn(dsid,_i),best32.)); 8370 end; /* fetchrc = 0 */ 8371 8372 put ; 8373 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 8374 do; 8375 value='%str('||trim(value)||')'; 8376 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 8377 end; 8378 %if %str(&handlename) ne %str() %then 8379 %do; 8380 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 8381 %end; 8382 %else 8383 %do; 8384 value = '%let '||trim(vname)||'= '||trim(value)||';'; 8385 %end; 8386 8387 put "NOTE: Setting macro variable " vname "with statement:" value ; 8388 call execute(value); 8389 end; /* do i= */ 8390 dsid = close(dsid); 8391 end; /* dsid > 0 */ 8392 else 8393 do; 8394 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 8395 abort; 8396 end; 8397 stop; 8398 run; 8399 8400 %rcSet(&syserr); 8401 %mend etls_getParameters; 8402 8403 %macro etls_loopW6O7ZESO; 8404 %local etls_filePrefix; 8405 %let etls_filePrefix = ; 8406 8407 %macro etls_processToLoopW6O7ZESY(parameterTable=, row=, handleName=rmt); 8408 %etls_getParameters(parameterTable=¶meterTable, row=&row, 8409 startingColumnNumber=1, handleName=&handleName); 8410 %let etls_previousFilePrefix = &etls_filePrefix; 8411 %local etls_filePrefix; 8412 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 8413 %syslput &etls_controlName = &row / remote = &handleName; 8414 %syslput handleName = &handleName / remote = &handleName; 8415 8416 /* Setup to pass macros to remote session */ 8417 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 8418 8419 rsubmit &handleName wait = no sysrputsync = yes persist = no 8420 log = "&etls_logOutputPath./&etls_filePrefix..log" 244 The SAS System 12:24 Tuesday, January 12, 2016 8421 output = "&etls_logOutputPath./&etls_filePrefix..lst" 8422 ; 8423 8424 %macro etls_jobW6O7ZET8; 8425 8426 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 8427 8428 /****************************************************************************** 8429 * Job: RPODSDW146 A50D7W6R.AQ0013CQ * 8430 * Description: * 8431 * * 8432 * Repository: me_besa A0000001.A50D7W6R * 8433 * Server: besa A5NJAD6Z.AT000001 * 8434 * * 8435 * Source Tables: TTRANSACCOES - ODSBESA.TTRANSACCOES A5NJAD6Z.BJ0000AN * 8436 * TCARREGAMENTO - ODSBESA.TCARREGAMENTO A5NJAD6Z.BJ00008K * 8437 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 8438 * TPRODUTO - ODSBESA.TPRODUTO A5NJAD6Z.BJ00009P * 8439 * TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 8440 * TTIPOCLI - ODSBESA.TTIPOCLI A5NJAD6Z.BJ0000AB * 8441 * Target Table: M_ODS_DW146 - GLBBESA.M_ODS_DW146 A5NJAD6Z.BJ0012KY * 8442 * * 8443 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 8444 * Generated by: s-bametasasd1\dvbesa * 8445 * Version: 9.1.20060626.51875 * 8446 ******************************************************************************/ 8447 8448 /* Create metadata macro variables */ 8449 %let IOMServer = %nrquote(besa); 8450 %let metaPort = %nrquote(8561); 8451 %let metaServer = %nrquote(s-bametasasd1); 8452 %let metaRepository = %nrquote(me_besa); 8453 8454 /* Set metadata options */ 8455 options metaport = &metaPort 8456 metaserver = "&metaServer" 8457 metarepository = "&metaRepository"; 8458 8459 %let jobID = %quote(A50D7W6R.AQ0013CQ); 8460 8461 /* Setup to capture return codes */ 8462 %global job_rc trans_rc sqlrc; 8463 %let job_rc = 0; 8464 %let trans_rc = 0; 8465 %let sqlrc = 0; 8466 %global syserr; 8467 8468 %macro rcSet(error); 8469 %if (&error gt &trans_rc) %then 8470 %let trans_rc = &error; 8471 %if (&error gt &job_rc) %then 8472 %let job_rc = &error; 8473 %mend rcSet; 8474 8475 %macro rcSetDS(error); 8476 if &error gt input(symget('trans_rc'),12.) then 8477 call symput('trans_rc',trim(left(put(&error,12.)))); 8478 if &error gt input(symget('job_rc'),12.) then 245 The SAS System 12:24 Tuesday, January 12, 2016 8479 call symput('job_rc',trim(left(put(&error,12.)))); 8480 %mend rcSetDS; 8481 8482 %global etls_debug; 8483 %macro etls_setDebug; 8484 %if %str(&etls_debug) ne 0 %then 8485 OPTIONS MPRINT%str(;); 8486 %mend; 8487 %etls_setDebug; 8488 8489 %macro genSASCommand; 8490 %local noobjserver; 8491 %if "&sysscp"="OS" %then %let noobjserver=; 8492 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 8493 %else %let noobjserver=%quote(-noobjectserver); 8494 options sascmd = "!sascmd &noobjserver"; 8495 %mend genSASCommand; 8496 %genSASCommand; 8497 8498 /****************************************************************************** 8499 * Macro: * 8500 * etls_tsLevel- Executes a data step using the tslvl function to * 8501 * determine if a feature is installed. * 8502 * * 8503 * Parameters: * 8504 * macroName- Name of macro to hold the value returned from the * 8505 * function call, a blank value indicates the feature is not * 8506 * installed. * 8507 * featureName - Name of feature to test for installation status. * 8508 ******************************************************************************/ 8509 %macro etls_tsLevel(macroName=, featureName=); 8510 data _null_; 8511 call symput("¯oName",tslvl("&featureName")); 8512 run; 8513 %mend etls_tsLevel; 8514 8515 /****************************************************************************** 8516 * Macro: * 8517 * etls_signon - Executes a signon to a remote machine. * 8518 * * 8519 * Parameters: * 8520 * handleName - Name of handle to access the remote connection. * 8521 * cmacvar - Macro variable to capture the status of the signon. * 8522 * gridRC- Macro variable to capture the return code of the grid * 8523 * signon. * 8524 * useGrid- A value of 1 will attempt to use a grid for the signon. * 8525 * If the grid functions are not installed then a local signon * 8526 * is performed. * 8527 * machineIdMacroVariable- Name of macro variable to capture the name * 8528 * of the machine used for a grid signon. * 8529 * workloadMacroVariable- Name of macro variable that specifies the * 8530 * workload to use for a grid signon. * 8531 * log - Path to a log file for the signon. * 8532 * output - Path to an output file for the signon. * 8533 * additionalSignonOptions- Any additional options for the signon * 8534 * statement. * 8535 * signonRetries- Integer value of signons to try before quiting. * 8536 * The wait between tries starts at 5 seconds, * 246 The SAS System 12:24 Tuesday, January 12, 2016 8537 * increments by 5 seconds. * 8538 ******************************************************************************/ 8539 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 8540 gridRC=rc, useGrid=1, 8541 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 8542 log=, output=, additionalSignonOptions=, signonRetries=3); 8543 8544 %let etls_gridInstalled =; 8545 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 8546 8547 %if (&useGrid = 1) %then 8548 %do; 8549 %if ("&etls_gridInstalled" ne "") %then 8550 %do; 8551 %if (&gridRC eq ) %then 8552 %let gridRC = &handleName.RC ; 8553 8554 %global &gridRC; 8555 %let workload = ; 8556 %if (&workloadMacroVariable ne ) %then 8557 %do; 8558 data _null_; 8559 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 8560 run; 8561 %end; 8562 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 8563 %end; 8564 %else 8565 %put %str(NOTE: Grid service functions are not installed.); 8566 %end; 8567 8568 %local sleeptime sleepIncreaseAmount tryCount; 8569 %let sleepIncreaseAmount=5; 8570 %let sleeptime=5; 8571 %let tryCount=1; 8572 %let &cmacvar=1; 8573 8574 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 8575 data _null_; 8576 signon &handleName cmacvar=&cmacvar 8577 %if ("&log" ne "") %then 8578 log=&log; 8579 %if ("&output" ne "") %then 8580 output=&output; 8581 %if ("&additionalSignonOptions" ne "") %then 8582 &additionalSignonOptions; 8583 ;run; 8584 8585 %if ("&machineIdMacroVariable" ne "") %then 8586 %do; 8587 %if ("&etls_gridInstalled" ne "") %then 8588 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 8589 %else 8590 %put %str(NOTE: Grid service functions are not installed.); 8591 %end; 8592 8593 %if "&&&cmacvar" eq "1" %then 8594 %do; 247 The SAS System 12:24 Tuesday, January 12, 2016 8595 %if &tryCount lt %eval(&signonRetries+1) %then 8596 %do; 8597 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 8598 %let rc=%sysfunc(sleep(&sleeptime,1)); 8599 %end; 8600 %else %if &signonRetries gt 0 %then 8601 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 8602 8603 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 8604 %let tryCount=%eval(&tryCount+1); 8605 %end; 8606 %end; 8607 %rcSet(&syserr); 8608 8609 %mend etls_signon; 8610 8611 /****************************************************************************** 8612 * Macro: * 8613 * etls_serverConnected- Tests to see if a connection to a remote * 8614 * exists. * 8615 * * 8616 * Parameters: * 8617 * serverId - Handle to the remote to test. * 8618 * macvarname- Name of macro variable to hold the return value of the * 8619 * status. Will equal 1 if the connection exists, 0 * 8620 * otherwise. Macro variable must be localized before * 8621 * calling this macro. * 8622 ******************************************************************************/ 8623 %macro etls_serverConnected(serverId=,macvarname=isConnected); 8624 %let &macvarname=0; 8625 %local search_str none_str savenotes; 8626 8627 /* setup information for listtask output */ 8628 /* listtask output on OS/390 differs */ 8629 %if %bquote(&sysscp) eq OS %then 8630 %do; 8631 %let search_str=Remote submit for; 8632 %let token=5; 8633 %end; 8634 %else 8635 %do; 8636 %let search_str=--------------; 8637 %let token=1; 8638 %end; 8639 8640 /* Issue listtask within PROC PRINTTO - send output to file */ 8641 filename __tmptxt TEMP; 8642 %let savenotes=%sysfunc(getoption(notes)); 8643 options nonotes; 8644 8645 proc printto log=__tmptxt new; 8646 run; 8647 8648 options notes; 8649 listtask; 8650 proc printto; 8651 run; 8652 248 The SAS System 12:24 Tuesday, January 12, 2016 8653 options nonotes; 8654 8655 /* read in the output from listtask */ 8656 %let dsname=_null_; 8657 data _null_(keep=Session); 8658 length line $256 sessionId $60; 8659 infile __tmptxt length=len; 8660 input @1 line $varying. len; 8661 8662 if line=:'There are no' then 8663 stop; 8664 /* look for the search string and scan for server name */ 8665 if index(line,"&search_str") then 8666 do; 8667 sessionId=scan(line,&token," "); 8668 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 8669 if sessionId=upcase(symget("serverId")) then 8670 do; 8671 call symput("&macvarname","1"); 8672 stop; 8673 end; 8674 end; 8675 run; 8676 filename __tmptxt clear; 8677 options &savenotes; 8678 %mend etls_serverConnected; 8679 8680 /****************************************************************************** 8681 * Macro: * 8682 * etls_signoff- Executes a signoff for a remote session, if a * 8683 * connection still exists. * 8684 * * 8685 * Parameters: * 8686 * handleName - Handle to remote session. * 8687 ******************************************************************************/ 8688 %macro etls_signoff(handleName=rmt); 8689 %local savemprint; 8690 %let savemprint=%sysfunc(getoption(mprint)); 8691 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 8692 options nomprint; 8693 %local isConnected; 8694 %etls_serverConnected(serverId=&handleName); 8695 options &savemprint; 8696 %if &isConnected %then 8697 signoff &handleName ;; 8698 %mend etls_signoff; 8699 8700 /****************************************************************************** 8701 * Macro: * 8702 * etls_getHandle- Retrieves the handle for a remote connection from the * 8703 * status table. * 8704 * * 8705 * Parameters: * 8706 * statusTable - Table containing status information. * 8707 * handleVariable- Name of variable holding the handles to the remote * 8708 * connections. * 8709 * row - Row to retrieve the information from. * 8710 ******************************************************************************/ 249 The SAS System 12:24 Tuesday, January 12, 2016 8711 %macro etls_getHandle(statusTable=, handleVariable=, row=); 8712 %let etls_dsid = %sysfunc(open(&statusTable)); 8713 %if (&etls_dsid = 0) %then 8714 %put %sysfunc(sysmsg()); 8715 %else 8716 %do; 8717 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 8718 %if (&rc ne 0) %then 8719 %put %sysfunc(sysmsg()); 8720 %else 8721 %do; 8722 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 8723 %if (&etls_varnum > 0) %then 8724 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 8725 %else 8726 %put %sysfunc(sysmsg()); 8727 %end; 8728 %let rc = %sysfunc(close(&etls_dsid)); 8729 %end; 8730 %mend etls_getHandle; 8731 8732 /****************************************************************************** 8733 * Macro: * 8734 * etls_freeHandle- Update the status of a remote connection in the * 8735 * status table and optionally signoff the connection. * 8736 * Can update the ending time of the task if an end time * 8737 * is desired. * 8738 * * 8739 * Parameters: * 8740 * statusTable - Table containing status information. * 8741 * statusVariable- Variable in status table that holds the status of * 8742 * the connection. * 8743 * handleVariable- Variable in status table that holds the names of * 8744 * the connection handles. * 8745 * handleName - Name of handle to access the remote connection. * 8746 * statusSetting- Value to set the status variable to once the * 8747 * process is complete, value must be quoted if this is * 8748 * character variable. * 8749 * endTimeVariable- Variable that contains the end time for the * 8750 * processes in the status table. * 8751 * startTimeVariable- Variable that contains the start time for the * 8752 * processes in the status table. * 8753 * signoff- Indicates whether this macro should signoff the * 8754 * connection to a remote, a value of 1 indicates a signoff * 8755 * should be made. * 8756 * returnCodeVariable- Variable in the status table that contains the * 8757 * return code for the individual processes. * 8758 * returnCodeMacroVariable- Macro variable holding the value for the * 8759 * processes return code. * 8760 * setMainJobRC- Indicates whether this macro should update the main * 8761 * job_rc for the outer process. * 8762 * statusUnknownReturnCode- Numeric value to set the status to if the * 8763 * status of the process cannot be determined. * 8764 ******************************************************************************/ 8765 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 8766 handleName=, statusSetting="Finished", 8767 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 8768 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 250 The SAS System 12:24 Tuesday, January 12, 2016 8769 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 8770 8771 %if ("&statusTable" ne "") %then 8772 %do; 8773 %local etls_rcMacroVarExisted; 8774 %let etls_rcMacroVarExisted = 0; 8775 %if ("&returnCodeMacroVariable" ne "") %then 8776 %do; 8777 proc sql noprint; 8778 select '1' into: etls_rcMacroVarExisted from dictionary.macros 8779 where name=upcase("&returnCodeMacroVariable"); 8780 quit; 8781 8782 %rcSet(&sqlrc); 8783 %if (&etls_rcMacroVarExisted = 0) %then 8784 %do; 8785 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 8786 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 8787 %end; 8788 %if (&setMainJobRC eq 1) %then 8789 %rcSet(&&&returnCodeMacroVariable); 8790 %end; 8791 %else 8792 %do; 8793 %let returnCodeMacroVariable=etls_rcmacvar; 8794 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 8795 %end; 8796 8797 %local etls_startTimeMacroVarExisted; 8798 %let etls_startTimeMacroVarExisted = 0; 8799 %if ("&startTimeMacroVariable" ne "") %then 8800 %do; 8801 proc sql noprint; 8802 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 8803 where name=upcase("&startTimeMacroVariable"); 8804 quit; 8805 8806 %rcSet(&sqlrc); 8807 %if (&etls_startTimeMacroVarExisted = 0) %then 8808 %do; 8809 %put WARNING: Start time from inner job not found. No value will be set.; 8810 %let &startTimeMacroVariable=; 8811 %end; 8812 %end; 8813 8814 %local etls_endTimeMacroVarExisted; 8815 %let etls_endTimeMacroVarExisted = 0; 8816 %if ("&endTimeMacroVariable" ne "") %then 8817 %do; 8818 proc sql noprint; 8819 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 8820 where name=upcase("&endTimeMacroVariable"); 8821 quit; 8822 8823 %rcSet(&sqlrc); 8824 %if (&etls_endTimeMacroVarExisted = 0) %then 8825 %do; 8826 %put WARNING: End time from inner job not found. Setting end time to current time.; 251 The SAS System 12:24 Tuesday, January 12, 2016 8827 %let &endTimeMacroVariable=%sysfunc(datetime()); 8828 %end; 8829 %end; 8830 8831 data &statusTable; 8832 modify &statusTable(where=(&handleVariable = &handleName)); 8833 %if ("&startTimeMacroVariable" ne "") %then 8834 %do; 8835 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 8836 %end; 8837 %if ("&endTimeVariable" ne "") %then 8838 %do; 8839 %if ("&endTimeMacroVariable" ne "") %then 8840 %do; 8841 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 8842 %end; 8843 %else 8844 &endTimeVariable = datetime();; 8845 %end; 8846 %if ("&returnCodeVariable" ne "") %then 8847 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 8848 %if ("&statusVariable" ne "") %then 8849 %do; 8850 if (symget("etls_rcMacroVarExisted") eq "0") then 8851 &statusVariable = "Unknown Status"; 8852 else 8853 &statusVariable = &statusSetting; 8854 %end; 8855 call symput('handle',&handleVariable); 8856 replace; 8857 stop; 8858 run; 8859 8860 %rcSet(&syserr); 8861 8862 %if (&signoff eq 1) %then 8863 %etls_signoff(handleName=&handle); 8864 %end; 8865 %mend etls_freeHandle; 8866 8867 /****************************************************************************** 8868 * Macro: * 8869 * etls_createHandle- Creates a handle name for a connect session and * 8870 * optionally signon to the session. * 8871 * * 8872 * Parameters: * 8873 * statusTable - Table that holds status of connections. * 8874 * statusVariable- Variable in status table that holds the status of * 8875 * the connection. * 8876 * handleVariable- Variable in status table that holds the names of * 8877 * the connection handles. * 8878 * handlePrefix- Prefix for the names of the handles, a number will * 8879 * be appended representing the row number in the table. * 8880 * workloadMacroVariable - Specification for the grid workload option. * 8881 * row - Row number in the status table to update. * 8882 * machineVariable- Variable in status table holding the name of * 8883 * machine running the task. * 8884 * statusSetting- Value to set the status variable to once the handle * 252 The SAS System 12:24 Tuesday, January 12, 2016 8885 * connection is made, value must be quoted if this is * 8886 * character variable. * 8887 * signon - A value of 1 will execute the signon statement. * 8888 * useGrid - A value of 1 will attempt to use a grid for the signon. * 8889 * log - Path to a log file for the signon. * 8890 * output - Path to an output file for the signon. * 8891 * gridRC- Macro variable to capture the return code of the grid * 8892 * signon. * 8893 * cmacvar - Macro variable to capture the status of the signon. * 8894 * additionalSignonOptions- Any additional options for the signon * 8895 * statement. * 8896 * signonRetries- Integer value of signons to try before quiting. * 8897 * The wait between tries starts at 5 seconds, * 8898 * increments by 5 seconds. * 8899 ******************************************************************************/ 8900 %macro etls_createHandle(statusTable=, statusVariable=, 8901 handleVariable=, handlePrefix=rmt, 8902 workloadMacroVariable=, row=, machineVariable=, 8903 statusSetting="Running", startTimeVariable=startTime, 8904 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 8905 additionalSignonOptions=, signonRetries= ); 8906 8907 %local remoteSessionId; 8908 %let remoteSessionId = &handlePrefix.&row; 8909 %let &cmacvar = 1; 8910 %local etls_machineId; 8911 %if (&signon eq 1) %then 8912 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 8913 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 8914 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 8915 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 8916 %else %let &cmacvar=0; 8917 8918 data &statusTable; 8919 retain ptr &row; 8920 modify &statusTable point = ptr; 8921 &handleVariable = "&remoteSessionId"; 8922 %if (&signon eq 1) %then 8923 &machineVariable = "&etls_machineId";; 8924 %if (&&&cmacvar ne 0) %then 8925 %do; 8926 &statusVariable = "Failed Signon"; 8927 %end; 8928 %else 8929 &statusVariable = &statusSetting;; 8930 %if (&startTimeVariable ne ) %then 8931 &startTimeVariable = datetime();; 8932 replace; 8933 stop; 8934 run; 8935 8936 %rcSet(&syserr); 8937 %mend etls_createHandle; 8938 8939 /****************************************************************************** 8940 * Macro: * 8941 * etls_waitfor- Executes a waitfor statement based on the status * 8942 * setting of processes in the status table. Will * 253 The SAS System 12:24 Tuesday, January 12, 2016 8943 * optionally perform a etls_freeHandle call if the process * 8944 * has completed. * 8945 * * 8946 * Parameters: * 8947 * statusTable - Table containing status information. * 8948 * statusVariable- Variable in status table that holds the status of * 8949 * the connection. * 8950 * runningStatusSetting- Value that indicates that the process is * 8951 * running, value must be quoted if this is * 8952 * character variable. * 8953 * handleVariable- Variable in status table that holds the names of * 8954 * the connection handles. * 8955 * completeStatusSetting- Value to set the status variable to once * 8956 * the process is complete, value must be quoted * 8957 * if this is character variable. * 8958 * endTimeVariable- Variable that contains the end time for the * 8959 * processes in the status table. * 8960 * startTimeVariable- Variable that contains the start time for the * 8961 * processes in the status table. * 8962 * waitType- Type of waitfor to perform; valid values are , * 8963 * _ANY_, or _ALL_. * 8964 * signoff- Indicates whether this macro should signoff the * 8965 * connection to a remote, a value of 1 indicates a signoff * 8966 * should be made. * 8967 * returnCodeVariable- Variable in the status table that contains the * 8968 * return code for the individual processes. * 8969 * returnCodeMacroVariable- Macro variable holding the value for the * 8970 * processes return code. * 8971 * statusUnknownReturnCode- Numeric value to set the status to if the * 8972 * status of the process cannot be determined. * 8973 ******************************************************************************/ 8974 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 8975 completeStatusSetting="Finished", endTimeVariable=endTime, 8976 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 8977 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 8978 8979 proc sql noprint; 8980 select count(*) into :etls_rows 8981 from &statusTable where &statusVariable = &runningStatusSetting; 8982 %let etls_rows = &etls_rows; 8983 %if (&etls_rows gt 0) %then 8984 %do; 8985 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 8986 from &statusTable where &statusVariable = &runningStatusSetting; 8987 %end; 8988 quit; 8989 8990 %rcSet(&sqlrc); 8991 8992 %if (&etls_rows gt 0) %then 8993 %do; 8994 waitfor &waitType 8995 %do i=1 %to &etls_rows; 8996 &&etlsHandles&i 8997 %end; 8998 ; 8999 %end; 9000 254 The SAS System 12:24 Tuesday, January 12, 2016 9001 %local useDefaultRCMacVar; 9002 %if ("&returnCodeMacroVariable" eq "") %then 9003 %let useDefaultRCMacVar=Y; 9004 9005 %do i=1 %to &etls_rows; 9006 9007 %if ("&useDefaultRCMacVar"="Y") %then 9008 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 9009 9010 waitfor &&etlsHandles&i timeout=1; 9011 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 9012 %do; 9013 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 9014 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 9015 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 9016 startTimeVariable=&startTimeVariable, signoff=&signoff, 9017 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 9018 statusUnknownReturnCode=&statusUnknownReturnCode, 9019 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 9020 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 9021 %put NOTE: Process &&etlsHandles&i. has completed.; 9022 %end; 9023 %else %if (&SYSRC ne -1) %then /* process status unknown */ 9024 %do; 9025 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 9026 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 9027 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 9028 startTimeVariable=&startTimeVariable, signoff=&signoff, 9029 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 9030 statusUnknownReturnCode=&statusUnknownReturnCode, 9030 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 9031 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 9032 %end; 9033 %end; 9034 %mend etls_waitfor; 9035 9036 /****************************************************************************** 9037 * Macro: * 9038 * etls_getProcessesRunning- Gets the number of processes running by * 9039 * querying the status table. * 9040 * * 9041 * Parameters: * 9042 * statusTable - Table containing status information. * 9043 * statusVariable- Variable in status table that holds the status of * 9044 * the connection. * 9045 * processCountMacro- Macro variable to contain the value of the * 9046 * number of processes running. Macro variable must * 9047 * be localized before calling this macro. * 9048 * statusSetting- Value that indicates that the process is running, * 9049 * value must be quoted if this is character variable. * 9050 ******************************************************************************/ 9051 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 9052 statusSetting="Running"); 9053 9054 proc sql noprint; 9055 select count(*) into: &processCountMacro 9056 from &statusTable where &statusVariable = &statusSetting; 9057 quit; 255 The SAS System 12:24 Tuesday, January 12, 2016 9058 9059 %rcSet(&sqlrc); 9060 %mend etls_getProcessesRunning; 9061 9062 /*============================================================================* 9063 * Step: SAS Extract A50D7W6R.AR003022 * 9064 * Transform: Extract * 9065 * Description: * 9066 * * 9067 * Source Table: TTRANSACCOES - ODSBESA.TTRANSACCOES A5NJAD6Z.BJ0000AN * 9068 * Target Table: Extract Target - work.W6CPT1UL A50D7W6R.AY0032DJ * 9069 *============================================================================*/ 9070 9071 /* Access the data for ODSBESA */ 9072 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 9072 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 9073 %rcSet(&syslibrc); 9074 9075 %let SYSLAST = %nrquote(ODSBESA.TTRANSACCOES); 9076 9077 %let transformID = %quote(A50D7W6R.AR003022); 9078 9079 %let trans_rc = 0; 9080 9081 proc datasets lib = work nolist nowarn memtype = (data view); 9082 delete W6CPT1UL; 9083 quit; 9084 9085 proc sql; 9086 create table work.W6CPT1UL as 9087 select IDENT length = 4 label = 'IDENT', 9088 CDCLIENTE length = 9 label = 'CDCLIENTE', 9089 CDCONTRATOREL length = 16 label = 'CDCONTRATOREL', 9090 CDBALCAOMIS length = 9 label = 'CDBALCAOMIS', 9091 CDMOEDA length = 3 label = 'CDMOEDA', 9092 MTTRANSLC length = 8 label = 'MTTRANSLC', 9093 DTVALOR length = 8 label = 'DTVALOR', 9094 CDCONTRATO length = 16 label = 'CDCONTRATO' 9095 from &SYSLAST 9096 where DTVALOR >= INTNX( 'DTMONTH' , &dataParam. , 0 , 'B' ) and MTTRANSLC<=40000 and 9096 ! CDMOEDA='AOA' and CDPRODUTO='LEVN' AND INCONTCONTAB='A'; 9097 quit; 9098 9099 %let SYSLAST = work.W6CPT1UL; 9100 9101 %rcSet(&sqlrc); 9102 9103 /*============================================================================* 9104 * Step: Join Carregamento A50D7W6R.AR003023 * 9105 * Transform: SQL Join (Version 2) * 9106 * Description: * 9107 * * 9108 * Source Tables: Extract Target - work.W6CPT1UL A50D7W6R.AY0032DJ * 9109 * TCARREGAMENTO - ODSBESA.TCARREGAMENTO A5NJAD6Z.BJ00008K * 9110 * Target Table: SQL Target - work.W6CPSWEB A50D7W6R.AY0032DK * 9111 *============================================================================*/ 9112 9113 %let transformID = %quote(A50D7W6R.AR003023); 256 The SAS System 12:24 Tuesday, January 12, 2016 9114 9115 %let trans_rc = 0; 9116 9117 proc datasets lib = work nolist nowarn memtype = (data view); 9118 delete W6CPSWEB; 9119 quit; 9120 9121 proc sql; 9122 create table work.W6CPSWEB as 9123 select 9124 W6CPT1UL.CDCLIENTE length = 9 9125 format = $9. 9126 informat = $9. 9127 label = 'CDCLIENTE', 9128 W6CPT1UL.CDCONTRATOREL length = 16 9129 format = $16. 9130 informat = $16. 9131 label = 'CDCONTRATOREL', 9132 W6CPT1UL.CDBALCAOMIS length = 9 9133 format = $9. 9134 informat = $9. 9135 label = 'CDBALCAOMIS', 9136 W6CPT1UL.CDMOEDA length = 3 9137 format = $3. 9138 informat = $3. 9139 label = 'CDMOEDA', 9140 W6CPT1UL.MTTRANSLC length = 8 9141 format = 20.3 9142 informat = 20.3 9143 label = 'MTTRANSLC', 9144 W6CPT1UL.IDENT length = 4 9145 format = $4. 9146 informat = $4. 9147 label = 'IDENT', 9148 W6CPT1UL.DTVALOR length = 8 9149 format = DATETIME20. 9150 informat = DATETIME20. 9151 label = 'DTVALOR', 9152 W6CPT1UL.CDCONTRATO length = 16 9153 format = $16. 9154 informat = $16. 9155 label = 'CDCONTRATO' 9156 from 9157 work.W6CPT1UL, 9158 ODSBESA.TCARREGAMENTO 9159 where 9160 W6CPT1UL.IDENT = TCARREGAMENTO.IDENT 9161 and W6CPT1UL.DTVALOR <= TCARREGAMENTO.DTCARREG 9162 ; 9163 quit; 9164 9165 %rcSet(&sqlrc); 9166 9167 %macro etls_completeTarget(); 9168 %mend etls_completeTarget; 9169 %etls_completeTarget; 9170 9171 /*============================================================================* 257 The SAS System 12:24 Tuesday, January 12, 2016 9172 * Step: Join Produto, Contrato A50D7W6R.AR003024 * 9173 * Transform: SQL Join (Version 2) * 9174 * Description: * 9175 * * 9176 * Source Tables: SQL Target - work.W6CPSWEB A50D7W6R.AY0032DK * 9177 * TCONTRATO - ODSBESA.TCONTRATO A5NJAD6Z.BJ00008V * 9178 * TPRODUTO - ODSBESA.TPRODUTO A5NJAD6Z.BJ00009P * 9179 * Target Table: SQL Target - work.W6LM8FPT A50D7W6R.AY0032DL * 9180 *============================================================================*/ 9181 9182 %let transformID = %quote(A50D7W6R.AR003024); 9183 9184 %let trans_rc = 0; 9185 9186 proc datasets lib = work nolist nowarn memtype = (data view); 9187 delete W6LM8FPT; 9188 quit; 9189 9190 proc sql; 9191 create table work.W6LM8FPT as 9192 select 9193 W6CPSWEB.CDCLIENTE length = 9 9194 format = $9. 9195 informat = $9. 9196 label = 'CDCLIENTE', 9197 W6CPSWEB.CDCONTRATOREL length = 16 9198 format = $16. 9199 informat = $16. 9200 label = 'CDCONTRATOREL', 9201 W6CPSWEB.CDBALCAOMIS length = 9 9202 format = $9. 9203 informat = $9. 9204 label = 'CDBALCAOMIS', 9205 W6CPSWEB.CDMOEDA length = 3 9206 format = $3. 9207 informat = $3. 9208 label = 'CDMOEDA', 9209 W6CPSWEB.MTTRANSLC length = 8 9210 format = 20.3 9211 informat = 20.3 9212 label = 'MTTRANSLC', 9213 W6CPSWEB.IDENT length = 4 9214 format = $4. 9215 informat = $4. 9216 label = 'IDENT', 9217 TPRODUTO.LIPRODUTO length = 80 9218 format = $80. 9219 informat = $80. 9220 label = 'LIPRODUTO', 9221 200 as COMISSAO length = 8 9222 format = 3. 9223 informat = 3. 9224 label = 'COMISSAO', 9225 put(datepart(&dataparam),yymmdd10.) as DTPROC length = 10 9226 format = $10. 9227 informat = $10. 9228 label = 'DTPROC', 9229 W6CPSWEB.DTVALOR length = 8 258 The SAS System 12:24 Tuesday, January 12, 2016 9230 format = DATETIME20. 9231 informat = DATETIME20. 9232 label = 'DTVALOR', 9233 W6CPSWEB.CDCONTRATO length = 16 9234 format = $16. 9235 informat = $16. 9236 label = 'CDCONTRATO' 9237 from 9238 work.W6CPSWEB, 9239 ODSBESA.TCONTRATO, 9240 ODSBESA.TPRODUTO 9241 where 9242 W6CPSWEB.CDCONTRATOREL = TCONTRATO.CDCONTRATO 9243 and W6CPSWEB.CDMOEDA = TCONTRATO.CDMOEDA 9244 and TCONTRATO.CDPRODUTO = TPRODUTO.CDPRODUTO 9245 and &dataparam. BETWEEN TCONTRATO.DTCHANGE and TCONTRATO.DTENDCHANGE 9246 ; 9247 quit; 9248 9249 %rcSet(&sqlrc); 9250 9251 %macro etls_completeTarget(); 9252 %mend etls_completeTarget; 9253 %etls_completeTarget; 9254 9255 /*============================================================================* 9256 * Step: Join Cliente, TipoCliente A50D7W6R.AR003027 * 9257 * Transform: SQL Join (Version 2) * 9258 * Description: * 9259 * * 9260 * Source Tables: SQL Target - work.W6LM8FPT A50D7W6R.AY0032DL * 9261 * TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 9262 * TTIPOCLI - ODSBESA.TTIPOCLI A5NJAD6Z.BJ0000AB * 9263 * Target Table: SQL Target - work.W6MPUESH A50D7W6R.AY0032DM * 9264 *============================================================================*/ 9265 9266 %let transformID = %quote(A50D7W6R.AR003027); 9267 9268 %let trans_rc = 0; 9269 9270 proc datasets lib = work nolist nowarn memtype = (data view); 9271 delete W6MPUESH; 9272 quit; 9273 9274 proc sql; 9275 create view work.W6MPUESH as 9276 select distinct 9277 W6LM8FPT.CDCLIENTE length = 9 9278 format = $9. 9279 informat = $9. 9280 label = 'CDCLIENTE', 9281 W6LM8FPT.CDCONTRATOREL length = 16 9282 format = $16. 9283 informat = $16. 9284 label = 'CDCONTRATOREL', 9285 W6LM8FPT.CDMOEDA length = 3 9286 format = $3. 9287 informat = $3. 259 The SAS System 12:24 Tuesday, January 12, 2016 9288 label = 'CDMOEDA', 9289 sum( W6LM8FPT.MTTRANSLC) as MTTRANSLC length = 8 9290 format = 20.3 9291 informat = 20.3 9292 label = 'MTTRANSLC', 9293 W6LM8FPT.CDCONTRATO length = 16 9294 format = $16. 9295 informat = $16. 9296 label = 'CDCONTRATO', 9297 W6LM8FPT.IDENT length = 4 9298 format = $4. 9299 informat = $4. 9300 label = 'IDENT', 9301 W6LM8FPT.LIPRODUTO length = 80 9302 format = $80. 9303 informat = $80. 9304 label = 'LIPRODUTO', 9305 W6LM8FPT.COMISSAO length = 8 9306 format = 3. 9307 informat = 3. 9308 label = 'COMISSAO', 9309 W6LM8FPT.DTPROC length = 10 9310 format = $10. 9311 informat = $10. 9312 label = 'DTPROC', 9313 case TCLIENTE.CDBALCAO 9314 when "951" 9315 then 0 9316 else 1.4 9317 end as IMPOSTO length = 3 9318 format = 3.1 9319 informat = 3.1 9320 label = 'CDTPCLIENTE', 9321 case TCLIENTE.CDBALCAO 9322 when "001" 9323 then "Private" 9324 when "026" 9325 then "Private" 9326 else "Não Private" 9327 end as TIPOCLIENTE length = 15 9328 format = $15. 9329 informat = $15. 9330 label = 'TIPOCLIENTE', 9331 W6LM8FPT.DTVALOR length = 8 9332 format = DATETIME20. 9333 informat = DATETIME20. 9334 label = 'DTVALOR', 9335 TCLIENTE.CDBALCAO length = 3 9336 format = $3. 9337 informat = $3. 9338 label = 'CDBALCAO' 9339 from 9340 work.W6LM8FPT, 9341 ODSBESA.TCLIENTE, 9342 ODSBESA.TTIPOCLI 9343 where 9344 W6LM8FPT.CDCLIENTE = TCLIENTE.CDCLIENTE 9345 and TCLIENTE.CDTPCLIENTE = TTIPOCLI.CDTPCLIENTE 260 The SAS System 12:24 Tuesday, January 12, 2016 9346 and &dataparam. BETWEEN TCLIENTE.DTCHANGE and TCLIENTE.DTENDCHANGE 9347 and TCLIENTE.CDCLIENTE <> '00000000' 9348 and TCLIENTE.CDBALCAO <> '009' 9349 group by 9350 DTPROC, 9351 DTVALOR, 9352 CDCONTRATOREL, 9353 LIPRODUTO, 9354 CDBALCAO, 9355 CDMOEDA, 9356 CDCONTRATO, 9357 W6LM8FPT.CDCLIENTE, 9358 W6LM8FPT.IDENT, 9359 W6LM8FPT.CDCONTRATOREL, 9360 W6LM8FPT.CDMOEDA, 9361 W6LM8FPT.LIPRODUTO, 9362 W6LM8FPT.CDCONTRATO, 9363 W6LM8FPT.DTVALOR, 9364 W6LM8FPT.DTPROC 9365 ; 9366 quit; 9367 9368 %rcSet(&sqlrc); 9369 9370 /*============================================================================* 9371 * Step: DEL_BY_DATE A50D7W6R.AR003025 * 9372 * Transform: DEL_BY_DATE * 9373 * Description: * 9374 * * 9375 * Source Table: SQL Target - work.W6MPUESH A50D7W6R.AY0032DM * 9376 * Target Table: DEL_BY_DATE - work.W6MQDI6B A50D7W6R.AY0032DN * 9377 *============================================================================*/ 9378 9379 %let SYSLAST = %nrquote(work.W6MPUESH); 9380 9381 %let transformID = %quote(A50D7W6R.AR003025); 9382 9383 %let trans_rc = 0; 9384 9385 /* Source table(s)/view(s) */ 9386 %let _INPUT1 = work.W6MPUESH; 9387 9388 /* Target table/view(s) */ 9389 %let _OUTPUT = work.W6MQDI6B; 9390 %let _OUTPUT1 = work.W6MQDI6B; 9391 9392 /* Delete target table(s) */ 9393 proc datasets lib=work nolist nowarn memtype = (data view); 9394 delete W6MQDI6B; 9395 quit; 9396 9397 /* Options */ 9398 %let data_col = %nrquote(DTPROC); 9399 %let rel_table = %nrquote(GLBBESA.M_ODS_DW146); 9400 %let data_apagar = %nrquote(&dataparam); 9401 9402 /* List of target columns to keep */ 9403 %let keep = DTVALOR CDCLIENTE CDCONTRATOREL CDMOEDA MTTRANSLC IDENT 261 The SAS System 12:24 Tuesday, January 12, 2016 9404 LIPRODUTO COMISSAO DTPROC IMPOSTO TIPOCLIENTE CDCONTRATO 9405 CDBALCAO; 9406 9407 %macro connect_oracle(schema); 9408 9409 connect to ORACLE 9410 ( 9411 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 9412 PATH = &ORACLE_CTB_SID 9413 USER = &ORACLE_CTB_USER 9414 PASSWORD = &ORACLE_CTB_PASSWORD 9415 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 9416 PATH = &ORACLE_DM_SID 9417 USER = &ORACLE_DM_USER 9418 PASSWORD = &ORACLE_DM_PASSWORD 9419 %END; 9420 ) 9421 9422 9423 %mend connect_oracle; 9424 9425 %macro tab_oracle(tabela); 9426 %let schema=%scan(&tabela,1); 9427 %IF %UPCASE(&schema) = GLBBESA 9428 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 9429 %ELSE %DO; &tabela %END; 9430 9431 9432 %mend tab_oracle; 9433 9434 9435 9436 9437 9438 /* Converte data DateTime em Data */ 9439 data _null_; 9440 format a Datetime.; 9441 a = &data_apagar; 9442 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 9443 run; 9444 9445 9446 9447 proc sql; 9448 %connect_oracle(%scan(&rel_table,1)); 9449 9450 execute( 9451 delete from %tab_oracle(&rel_table) 9452 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 9453 9454 disconnect from ORACLE; 9455 quit; 9456 9457 9458 proc sql; 9459 create view &_OUTPUT1 as 9460 select * 9461 from &_INPUT1; 262 The SAS System 12:24 Tuesday, January 12, 2016 9462 quit; 9463 9464 9465 9466 9467 9468 %rcSet(&syserr); 9469 %rcSet(&sysrc); 9470 %rcSet(&sqlrc); 9471 9472 /*============================================================================* 9473 * Step: Table Loader A50D7W6R.AR003026 * 9474 * Transform: Table Loader (Version 2) * 9475 * Description: * 9476 * * 9477 * Source Table: DEL_BY_DATE - work.W6MQDI6B A50D7W6R.AY0032DN * 9478 * Target Table: M_ODS_DW146 - GLBBESA.M_ODS_DW146 A5NJAD6Z.BJ0012KY * 9479 *============================================================================*/ 9480 9481 /* Access the data for GLBBESA */ 9482 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 9482 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 9483 %rcSet(&syslibrc); 9484 9485 %let SYSLAST = %nrquote(work.W6MQDI6B); 9486 9487 %let transformID = %quote(A50D7W6R.AR003026); 9488 9489 %let trans_rc = 0; 9490 9491 %global etls_tableExist; 9492 %global etls_numIndex; 9493 %global etls_lastTable; 9494 %let etls_tableExist = -1; 9495 %let etls_numIndex = -1; 9496 %let etls_lastTable = &SYSLAST; 9497 9498 /*---- Define load data macro ----*/ 9499 %macro etls_loader; 9500 9501 %let SYSOPT = ; 9502 9503 /*---- Map the columns ----*/ 9504 proc datasets lib = work nolist nowarn memtype = (data view); 9505 delete mapped; 9506 quit; 9507 9508 %put %str(NOTE: Mapping columns ...); 9509 proc sql; 9510 create view work.mapped as 9511 select IDENT length = 4, 9512 DTPROC length = 10, 9513 DTVALOR length = 8, 9514 CDCLIENTE length = 9, 9515 CDCONTRATOREL length = 16, 9516 LIPRODUTO length = 80, 9517 CDBALCAO length = 9 format = $9. informat = $9., 9518 CDMOEDA length = 3, 263 The SAS System 12:24 Tuesday, January 12, 2016 9519 CDCONTRATO length = 16, 9520 MTTRANSLC length = 8, 9521 COMISSAO length = 8 format = 11. informat = 11., 9522 IMPOSTO length = 8 format = 5.2 informat = 5.2, 9523 TIPOCLIENTE as TPCLIENTE length = 15 9524 from &etls_lastTable; 9525 quit; 9526 9527 %let SYSLAST = work.mapped; 9528 9529 %let etls_lastTable = &SYSLAST; 9530 %let SYSOPT = ; 9531 9532 /* Determine if the target table exists */ 9533 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW146, DATA)) or 9534 %sysfunc(exist(GLBBESA.M_ODS_DW146, VIEW))); 9535 9536 /*---- Create a new table ----*/ 9537 %if (&etls_tableExist eq 0) %then 9538 %do; /* if table does not exist */ 9539 9540 %put %str(NOTE: Creating table ...); 9541 9542 data GLBBESA.M_ODS_DW146 9543 (dbnull = ( 9544 IDENT = YES 9545 DTPROC = YES 9546 DTVALOR = YES 9547 CDCLIENTE = YES 9548 CDCONTRATOREL = YES 9549 LIPRODUTO = YES 9550 CDBALCAO = YES 9551 CDMOEDA = YES 9552 CDCONTRATO = YES 9553 MTTRANSLC = YES 9554 COMISSAO = YES 9555 IMPOSTO = YES 9556 TPCLIENTE = YES)); 9557 attrib IDENT length = $4 format = $4. informat = $4. 9558 label = 'IDENT'; 9559 attrib DTPROC length = $10 format = $10. informat = $10. 9560 label = 'DTPROC'; 9561 attrib DTVALOR length = 8 format = DATETIME20. informat = DATETIME20. 9562 label = 'DTVALOR'; 9563 attrib CDCLIENTE length = $9 format = $9. informat = $9. 9564 label = 'CDCLIENTE'; 9565 attrib CDCONTRATOREL length = $16 format = $16. informat = $16. 9566 label = 'CDCONTRATOREL'; 9567 attrib LIPRODUTO length = $80 format = $80. informat = $80. 9568 label = 'LIPRODUTO'; 9569 attrib CDBALCAO length = $9 format = $9. informat = $9. 9570 label = 'CDBALCAO'; 9571 attrib CDMOEDA length = $3 format = $3. informat = $3. 9572 label = 'CDMOEDA'; 9573 attrib CDCONTRATO length = $16 format = $16. informat = $16. 9574 label = 'CDCONTRATO'; 9575 attrib MTTRANSLC length = 8 format = 20.3 informat = 20.3 9576 label = 'MTTRANSLC'; 264 The SAS System 12:24 Tuesday, January 12, 2016 9577 attrib COMISSAO length = 8 format = 11. informat = 11. 9578 label = 'COMISSAO'; 9579 attrib IMPOSTO length = 8 format = 5.2 informat = 5.2 9580 label = 'IMPOSTO'; 9581 attrib TPCLIENTE length = $15 format = $15. informat = $15. 9582 label = 'TPCLIENTE'; 9583 stop; 9584 run; 9585 9586 %rcSet(&syserr); 9587 9588 %end; /* if table does not exist */ 9589 9590 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 9591 9592 /*---- Append new data ----*/ 9593 %put %str(NOTE: Appending data ...); 9594 9595 proc append base = GLBBESA.M_ODS_DW146 9596 data = &etls_lastTable (&SYSOPT) force; 9597 run; 9598 9599 %rcSet(&syserr); 9600 9601 proc datasets lib = work nolist nowarn memtype = (data view); 9602 delete mapped; 9603 quit; 9604 9605 %mend etls_loader; 9606 %etls_loader; 9607 9608 %sysrput job_rc&handleName = &job_rc; 9609 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 9610 9611 %mend etls_jobW6O7ZET8; 9612 9613 %etls_jobW6O7ZET8; 9614 9615 endrsubmit; 9616 9617 %mend etls_processToLoopW6O7ZESY; 9618 9619 %local etls_controlTable etls_statusTable etls_controlName 9620 etls_processesRunning etls_maxProcesses etls_parameterTable 9621 etls_additionalSignonOptions etls_signonRetries; 9622 %let etls_controlName = L54_; 9623 %let etls_statusTable = work.W6MR01SB; 9624 %let etls_parameterTable = work.W6O7ZET7; 9625 %let etls_workload = ; 9626 %let etls_additionalSignonOptions = ; 9627 %let etls_signonRetries = 3; 9628 %let &etls_controlName = 0; 9629 %let etls_controlTable = work.W6MR01OE; 9630 9631 %put %str(NOTE: Creating status table...); 9632 data &etls_statusTable 9633 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 9634 etls_status etls_jobRC DTFIM 265 The SAS System 12:24 Tuesday, January 12, 2016 9635 ); 9636 attrib etls_handleName length = $32 9637 label = 'Name of handle to remote session'; 9638 attrib etls_machineId length = $32 9639 label = 'Name of machine executing the task'; 9640 attrib etls_startTime length = 8 format = nldatmap. 9641 label = 'Start time of task'; 9642 attrib etls_endTime length = 8 format = nldatmap. 9643 label = 'End time of task'; 9644 attrib etls_status length = $32 9645 label = 'Current status of task'; 9646 attrib etls_jobRC length = 8 9647 label = 'Return code of task'; 9648 set &etls_controlTable; 9649 run; 9650 9651 %rcSet(&syserr); 9652 9653 %put %str(NOTE: Creating parameter table...); 9654 proc sql; 9655 create table &etls_parameterTable as 9656 select DTFIM as dataParam 9657 from &etls_controlTable; 9658 quit; 9659 9660 %rcSet(&sqlrc); 9661 9662 /* Get the number of times to iterate from the number of rows in the source */ 9663 /* table */ 9664 proc sql noprint; 9665 select count(*) into :&etls_controlName._max from &etls_statusTable; 9666 %let &etls_controlName._max = &&&etls_controlName._max; 9667 quit; 9668 9669 %rcSet(&sqlrc); 9670 9671 %let etls_gridInstalled =; 9672 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 9673 9674 %if (%str(&etls_gridInstalled) ne %str()) %then 9675 %do; 9676 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 9677 %if (&etls_maxProcesses = 0) %then 9678 %do; 9679 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 9680 processes to SYSNCPU value.); 9681 %let etls_maxProcesses = &SYSNCPU; 9682 %end; 9683 %end; 9684 %else 9685 %do; 9686 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 9687 processes to SYSNCPU value.); 9688 %let etls_maxProcesses = &SYSNCPU; 9689 %end; 9690 9691 %if (&etls_maxProcesses > 0) %then 9692 %do; 266 The SAS System 12:24 Tuesday, January 12, 2016 9693 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 9694 9695 %let etls_lastLoopPtr = &&&etls_controlName; 9696 9697 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 9698 processCountMacro=etls_processesRunning, statusSetting="Running"); 9699 9700 %do %while(&etls_processesRunning lt &&&etls_controlName._max 9701 and &etls_processesRunning lt &etls_maxProcesses 9702 and &&&etls_controlName lt &&&etls_controlName._max); 9703 9704 %let &etls_controlName = %eval(&&&etls_controlName+1); 9705 9706 %global etls_signonStatus; 9707 %let etls_logOutputPath = &DIR_PRJ_LOG.; 9708 9709 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 9710 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 9711 row=&&&etls_controlName, machineVariable=etls_machineId, 9712 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 9713 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 9714 9715 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 9716 processCountMacro=etls_processesRunning, statusSetting="Running"); 9717 9718 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 9719 %etls_processToLoopW6O7ZESY(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 9720 handleName=%etls_getHandle(statusTable=&etls_statusTable, 9721 handleVariable=etls_handleName, row=&&&etls_controlName)); 9722 %else 9723 %do; /* if signon error, set iterator to max to force loop to stop. */ 9724 %let &etls_controlName = &&&etls_controlName._max; 9725 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 9726 %end; 9727 %end; 9728 9729 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 9730 runningStatusSetting="Running", handleVariable=etls_handleName, 9731 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 9732 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 9733 returnCodeVariable=etls_jobRC, 9734 statusUnknownReturnCode=.); 9735 9736 %end; 9737 9738 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 9739 runningStatusSetting="Running", handleVariable=etls_handleName, 9740 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 9741 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 9742 returnCodeVariable=etls_jobRC, 9743 statusUnknownReturnCode=.); 9744 9745 %end; 9746 9747 proc datasets lib = work nolist nowarn memtype = (data view); 9748 delete W6O7ZET7; 9749 quit; 9750 267 The SAS System 12:24 Tuesday, January 12, 2016 9751 %mend etls_loopW6O7ZESO; 9752 9753 %etls_loopW6O7ZESO; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_LOOPW6O7ZESO): data work.W6MR01SB (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZESO): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6MR01OE MPRINT(ETLS_LOOPW6O7ZESO): set work.W6MR01OE; MPRINT(ETLS_LOOPW6O7ZESO): run; NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W6MR01OE. NOTE: The data set WORK.W6MR01SB has 1 observations and 7 variables. NOTE: Compressing data set WORK.W6MR01SB 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.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 2 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZESO): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZESO): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZET7 SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6MR01OE MPRINT(ETLS_LOOPW6O7ZESO): create table work.W6O7ZET7 as select DTFIM as dataParam from work.W6MR01OE; NOTE: Compression was disabled for data set WORK.W6O7ZET7 because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZET7 created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZESO): quit; NOTE: PROCEDURE SQL used (Total process time): 268 The SAS System 12:24 Tuesday, January 12, 2016 real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZESO): ; MPRINT(ETLS_LOOPW6O7ZESO): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_LOOPW6O7ZESO): select count(*) into :L54__max from work.W6MR01SB; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZESO): quit; 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 226k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZESO): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds 269 The SAS System 12:24 Tuesday, January 12, 2016 Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZESO): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6MR01SB where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZESO): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ 270 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable L54__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L54_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L54_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable GRIDRC resolves to L54_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L54_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. 271 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L54_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.08 seconds cpu time 0.07 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_workABDB00000128_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.12 seconds user cpu time 0.05 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 107 Involuntary Context Switches 3 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_workABDB00000128_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L54_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 0.96 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds Memory 223k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 24 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_CREATEHANDLE): data work.W6MR01SB; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_CREATEHANDLE): modify work.W6MR01SB point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L54_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L54_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus 272 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W6MR01SB has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 309k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZESO): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6MR01SB where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 273 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZESO): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZET7 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZET7 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZET7 MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZET7"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 274 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L54_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZET7 MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZET7, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable dataParam with statement:%syslput dataParam= 1764460800 / remote = L54_1; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZESY): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L54_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L54_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L54_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZESY): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L54_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L54_1.lst" ; 272 The SAS System 12:29 Tuesday, January 12, 2016 NOTE: Background remote submit to L54_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6MR01SB where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W6MR01SB where etls_status = "Running"; 284 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 NOTE: Remote signoff from L54_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 25.46 seconds user cpu time 10.44 seconds system cpu time 1.12 seconds Memory 14701k Page Faults 0 Page Reclaims 797 Page Swaps 0 Voluntary Context Switches 12573 Involuntary Context Switches 272 Block Input Operations 1 Block Output Operations 15 NOTE: Remote signoff from L54_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L54_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL54_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 SYMBOLGEN: && resolves to &. 285 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL54_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL54_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL54_1"); MPRINT(ETLS_FREEHANDLE): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL54_1 SYMBOLGEN: Macro variable JOB_RCL54_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L54_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L54_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L54_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 286 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L54_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L54_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L54_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_FREEHANDLE): data work.W6MR01SB; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L54_1" MPRINT(ETLS_FREEHANDLE): modify work.W6MR01SB(where=(etls_handleName = "L54_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L54_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L54_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L54_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L54_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L54_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L54_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL54_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL54_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; 287 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W6MR01SB. WHERE etls_handleName='L54_1'; NOTE: The data set WORK.W6MR01SB has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L54_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L54_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 288 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L54_1 NOTE: Process L54_1 has completed. MPRINT(ETLS_LOOPW6O7ZESO): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L54_ SYMBOLGEN: Macro variable L54__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6MR01SB MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6MR01SB SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6MR01SB where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZESO): ; MPRINT(ETLS_LOOPW6O7ZESO): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZESO): delete W6O7ZET7; MPRINT(ETLS_LOOPW6O7ZESO): quit; NOTE: Deleting WORK.W6O7ZET7 (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds 289 The SAS System 12:24 Tuesday, January 12, 2016 system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 9754 9755 /*============================================================================* 9756 * Step: Loop End A50D7W6R.B6001AB0 * 9757 * Transform: Loop End * 9758 * Description: * 9759 *============================================================================*/ 9760 9761 /*============================================================================* 9762 * Step: Loop A50D7W6R.B6001AAU * 9763 * Transform: Loop * 9764 * Description: * 9765 * * 9766 * Source Table: SAS Splitter - work.W6A47T2D A50D7W6R.AY0032D9 * 9767 * Target Table: Status Table - work.W6A47T4N A50D7W6R.AY0032DA * 9768 *============================================================================*/ 9769 9770 %let SYSLAST = %nrquote(work.W6A47T2D); 9771 9772 %let transformID = %quote(A50D7W6R.B6001AAU); 9773 9774 %let trans_rc = 0; 9775 9776 %macro genSASCommand; 9777 %local noobjserver; 9778 %if "&sysscp"="OS" %then %let noobjserver=; 9779 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 9780 %else %let noobjserver=%quote(-noobjectserver); 9781 options sascmd = "!sascmd &noobjserver"; 9782 %mend genSASCommand; 9783 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 9784 9785 %macro etls_tsLevel(macroName=, featureName=); 9786 data _null_; 9787 call symput("¯oName",tslvl("&featureName")); 9788 run; 9789 %mend etls_tsLevel; 9790 9791 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 9792 gridRC=rc, useGrid=1, 9793 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 9794 log=, output=, additionalSignonOptions=, signonRetries=3); 9795 290 The SAS System 12:24 Tuesday, January 12, 2016 9796 %let etls_gridInstalled =; 9797 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 9798 9799 %if (&useGrid = 1) %then 9800 %do; 9801 %if ("&etls_gridInstalled" ne "") %then 9802 %do; 9803 %if (&gridRC eq ) %then 9804 %let gridRC = &handleName.RC ; 9805 9806 %global &gridRC; 9807 %let workload = ; 9808 %if (&workloadMacroVariable ne ) %then 9809 %do; 9810 data _null_; 9811 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 9812 run; 9813 %end; 9814 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 9815 %end; 9816 %else 9817 %put %str(NOTE: Grid service functions are not installed.); 9818 %end; 9819 9820 %local sleeptime sleepIncreaseAmount tryCount; 9821 %let sleepIncreaseAmount=5; 9822 %let sleeptime=5; 9823 %let tryCount=1; 9824 %let &cmacvar=1; 9825 9826 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 9827 data _null_; 9828 signon &handleName cmacvar=&cmacvar 9829 %if ("&log" ne "") %then 9830 log=&log; 9831 %if ("&output" ne "") %then 9832 output=&output; 9833 %if ("&additionalSignonOptions" ne "") %then 9834 &additionalSignonOptions; 9835 ;run; 9836 9837 %if ("&machineIdMacroVariable" ne "") %then 9838 %do; 9839 %if ("&etls_gridInstalled" ne "") %then 9840 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 9841 %else 9842 %put %str(NOTE: Grid service functions are not installed.); 9843 %end; 9844 9845 %if "&&&cmacvar" eq "1" %then 9846 %do; 9847 %if &tryCount lt %eval(&signonRetries+1) %then 9848 %do; 9849 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 9850 %let rc=%sysfunc(sleep(&sleeptime,1)); 9851 %end; 9852 %else %if &signonRetries gt 0 %then 9853 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 291 The SAS System 12:24 Tuesday, January 12, 2016 9854 9855 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 9856 %let tryCount=%eval(&tryCount+1); 9857 %end; 9858 %end; 9859 %rcSet(&syserr); 9860 9861 %mend etls_signon; 9862 9863 %macro etls_serverConnected(serverId=,macvarname=isConnected); 9864 %let &macvarname=0; 9865 %local search_str none_str savenotes; 9866 9867 /* setup information for listtask output */ 9868 /* listtask output on OS/390 differs */ 9869 %if %bquote(&sysscp) eq OS %then 9870 %do; 9871 %let search_str=Remote submit for; 9872 %let token=5; 9873 %end; 9874 %else 9875 %do; 9876 %let search_str=--------------; 9877 %let token=1; 9878 %end; 9879 9880 /* Issue listtask within PROC PRINTTO - send output to file */ 9881 filename __tmptxt TEMP; 9882 %let savenotes=%sysfunc(getoption(notes)); 9883 options nonotes; 9884 9885 proc printto log=__tmptxt new; 9886 run; 9887 9888 options notes; 9889 listtask; 9890 proc printto; 9891 run; 9892 9893 options nonotes; 9894 9895 /* read in the output from listtask */ 9896 %let dsname=_null_; 9897 data _null_(keep=Session); 9898 length line $256 sessionId $60; 9899 infile __tmptxt length=len; 9900 input @1 line $varying. len; 9901 9902 if line=:'There are no' then 9903 stop; 9904 /* look for the search string and scan for server name */ 9905 if index(line,"&search_str") then 9906 do; 9907 sessionId=scan(line,&token," "); 9908 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 9909 if sessionId=upcase(symget("serverId")) then 9910 do; 9911 call symput("&macvarname","1"); 292 The SAS System 12:24 Tuesday, January 12, 2016 9912 stop; 9913 end; 9914 end; 9915 run; 9916 filename __tmptxt clear; 9917 options &savenotes; 9918 %mend etls_serverConnected; 9919 9920 %macro etls_signoff(handleName=rmt); 9921 %local savemprint; 9922 %let savemprint=%sysfunc(getoption(mprint)); 9923 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 9924 options nomprint; 9925 %local isConnected; 9926 %etls_serverConnected(serverId=&handleName); 9927 options &savemprint; 9928 %if &isConnected %then 9929 signoff &handleName ;; 9930 %mend etls_signoff; 9931 9932 %macro etls_getHandle(statusTable=, handleVariable=, row=); 9933 %let etls_dsid = %sysfunc(open(&statusTable)); 9934 %if (&etls_dsid = 0) %then 9935 %put %sysfunc(sysmsg()); 9936 %else 9937 %do; 9938 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 9939 %if (&rc ne 0) %then 9940 %put %sysfunc(sysmsg()); 9941 %else 9942 %do; 9943 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 9944 %if (&etls_varnum > 0) %then 9945 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 9946 %else 9947 %put %sysfunc(sysmsg()); 9948 %end; 9949 %let rc = %sysfunc(close(&etls_dsid)); 9950 %end; 9951 %mend etls_getHandle; 9952 9953 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 9954 handleName=, statusSetting="Finished", 9955 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 9956 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 9957 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 9958 9959 %if ("&statusTable" ne "") %then 9960 %do; 9961 %local etls_rcMacroVarExisted; 9962 %let etls_rcMacroVarExisted = 0; 9963 %if ("&returnCodeMacroVariable" ne "") %then 9964 %do; 9965 proc sql noprint; 9966 select '1' into: etls_rcMacroVarExisted from dictionary.macros 9967 where name=upcase("&returnCodeMacroVariable"); 9968 quit; 9969 293 The SAS System 12:24 Tuesday, January 12, 2016 9970 %rcSet(&sqlrc); 9971 %if (&etls_rcMacroVarExisted = 0) %then 9972 %do; 9973 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 9974 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 9975 %end; 9976 %if (&setMainJobRC eq 1) %then 9977 %rcSet(&&&returnCodeMacroVariable); 9978 %end; 9979 %else 9980 %do; 9981 %let returnCodeMacroVariable=etls_rcmacvar; 9982 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 9983 %end; 9984 9985 %local etls_startTimeMacroVarExisted; 9986 %let etls_startTimeMacroVarExisted = 0; 9987 %if ("&startTimeMacroVariable" ne "") %then 9988 %do; 9989 proc sql noprint; 9990 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 9991 where name=upcase("&startTimeMacroVariable"); 9992 quit; 9993 9994 %rcSet(&sqlrc); 9995 %if (&etls_startTimeMacroVarExisted = 0) %then 9996 %do; 9997 %put WARNING: Start time from inner job not found. No value will be set.; 9998 %let &startTimeMacroVariable=; 9999 %end; 10000 %end; 10001 10002 %local etls_endTimeMacroVarExisted; 10003 %let etls_endTimeMacroVarExisted = 0; 10004 %if ("&endTimeMacroVariable" ne "") %then 10005 %do; 10006 proc sql noprint; 10007 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 10008 where name=upcase("&endTimeMacroVariable"); 10009 quit; 10010 10011 %rcSet(&sqlrc); 10012 %if (&etls_endTimeMacroVarExisted = 0) %then 10013 %do; 10014 %put WARNING: End time from inner job not found. Setting end time to current time.; 10015 %let &endTimeMacroVariable=%sysfunc(datetime()); 10016 %end; 10017 %end; 10018 10019 data &statusTable; 10020 modify &statusTable(where=(&handleVariable = &handleName)); 10021 %if ("&startTimeMacroVariable" ne "") %then 10022 %do; 10023 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 10024 %end; 10025 %if ("&endTimeVariable" ne "") %then 10026 %do; 10027 %if ("&endTimeMacroVariable" ne "") %then 294 The SAS System 12:24 Tuesday, January 12, 2016 10028 %do; 10029 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 10030 %end; 10031 %else 10032 &endTimeVariable = datetime();; 10033 %end; 10034 %if ("&returnCodeVariable" ne "") %then 10035 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 10036 %if ("&statusVariable" ne "") %then 10037 %do; 10038 if (symget("etls_rcMacroVarExisted") eq "0") then 10039 &statusVariable = "Unknown Status"; 10040 else 10041 &statusVariable = &statusSetting; 10042 %end; 10043 call symput('handle',&handleVariable); 10044 replace; 10045 stop; 10046 run; 10047 10048 %rcSet(&syserr); 10049 10050 %if (&signoff eq 1) %then 10051 %etls_signoff(handleName=&handle); 10052 %end; 10053 %mend etls_freeHandle; 10054 10055 %macro etls_createHandle(statusTable=, statusVariable=, 10056 handleVariable=, handlePrefix=rmt, 10057 workloadMacroVariable=, row=, machineVariable=, 10058 statusSetting="Running", startTimeVariable=startTime, 10059 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 10060 additionalSignonOptions=, signonRetries= ); 10061 10062 %local remoteSessionId; 10063 %let remoteSessionId = &handlePrefix.&row; 10064 %let &cmacvar = 1; 10065 %local etls_machineId; 10066 %if (&signon eq 1) %then 10067 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 10068 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 10069 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 10070 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 10071 %else %let &cmacvar=0; 10072 10073 data &statusTable; 10074 retain ptr &row; 10075 modify &statusTable point = ptr; 10076 &handleVariable = "&remoteSessionId"; 10077 %if (&signon eq 1) %then 10078 &machineVariable = "&etls_machineId";; 10079 %if (&&&cmacvar ne 0) %then 10080 %do; 10081 &statusVariable = "Failed Signon"; 10082 %end; 10083 %else 10084 &statusVariable = &statusSetting;; 10085 %if (&startTimeVariable ne ) %then 295 The SAS System 12:24 Tuesday, January 12, 2016 10086 &startTimeVariable = datetime();; 10087 replace; 10088 stop; 10089 run; 10090 10091 %rcSet(&syserr); 10092 %mend etls_createHandle; 10093 10094 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 10095 completeStatusSetting="Finished", endTimeVariable=endTime, 10096 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 10097 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 10098 10099 proc sql noprint; 10100 select count(*) into :etls_rows 10101 from &statusTable where &statusVariable = &runningStatusSetting; 10102 %let etls_rows = &etls_rows; 10103 %if (&etls_rows gt 0) %then 10104 %do; 10105 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 10106 from &statusTable where &statusVariable = &runningStatusSetting; 10107 %end; 10108 quit; 10109 10110 %rcSet(&sqlrc); 10111 10112 %if (&etls_rows gt 0) %then 10113 %do; 10114 waitfor &waitType 10115 %do i=1 %to &etls_rows; 10116 &&etlsHandles&i 10117 %end; 10118 ; 10119 %end; 10120 10121 %local useDefaultRCMacVar; 10122 %if ("&returnCodeMacroVariable" eq "") %then 10123 %let useDefaultRCMacVar=Y; 10124 10125 %do i=1 %to &etls_rows; 10126 10127 %if ("&useDefaultRCMacVar"="Y") %then 10128 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 10129 10130 waitfor &&etlsHandles&i timeout=1; 10131 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 10132 %do; 10133 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 10134 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 10135 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 10136 startTimeVariable=&startTimeVariable, signoff=&signoff, 10137 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 10138 statusUnknownReturnCode=&statusUnknownReturnCode, 10139 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 10140 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 10141 %put NOTE: Process &&etlsHandles&i. has completed.; 10142 %end; 10143 %else %if (&SYSRC ne -1) %then /* process status unknown */ 296 The SAS System 12:24 Tuesday, January 12, 2016 10144 %do; 10145 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 10146 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 10147 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 10148 startTimeVariable=&startTimeVariable, signoff=&signoff, 10149 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 10150 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 10151 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 10152 %end; 10153 %end; 10154 %mend etls_waitfor; 10155 10156 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 10157 statusSetting="Running"); 10158 10159 proc sql noprint; 10160 select count(*) into: &processCountMacro 10161 from &statusTable where &statusVariable = &statusSetting; 10162 quit; 10163 10164 %rcSet(&sqlrc); 10165 %mend etls_getProcessesRunning; 10166 10167 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 10168 %let ¶meterVariableMacro = ; 10169 %let dsid = %sysfunc(open(¶meterTable)); 10170 %if (&dsid gt 0) %then 10171 %do; 10172 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 10173 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 10174 %end; 10175 %let dsid = %sysfunc(close(&dsid)); 10176 %end; 10177 %else 10178 %put %sysfunc(sysmsg()); 10179 %rcSet(&syserr); 10180 %mend etls_getParameterNames; 10181 10182 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 10183 data _null_; 10184 length vname $256 vtype $1 value $3200; 10185 dsid = open("¶meterTable"); 10186 if (dsid > 0) then 10187 do; 10188 do _i = 1 to &row; 10189 fetchrc = fetch(dsid); 10190 end; 10191 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 10192 vname = varname(dsid,_i); 10193 vtype = vartype(dsid,_i); 10194 if (fetchrc = 0) then 10195 do; 10196 if (vtype = 'C') then 10197 do; 10198 value = getvarc(dsid,_i); 10199 value = tranwrd(value,"%","%%"); 10200 value = tranwrd(value,"(","%("); 10201 value = tranwrd(value,")","%)"); 297 The SAS System 12:24 Tuesday, January 12, 2016 10202 value = tranwrd(value,'"','%"'); 10203 end; 10204 else 10205 value = left(put(getvarn(dsid,_i),best32.)); 10206 end; /* fetchrc = 0 */ 10207 10208 put ; 10209 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 10210 do; 10211 value='%str('||trim(value)||')'; 10212 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 10213 end; 10214 %if %str(&handlename) ne %str() %then 10215 %do; 10216 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 10217 %end; 10218 %else 10219 %do; 10220 value = '%let '||trim(vname)||'= '||trim(value)||';'; 10221 %end; 10222 10223 put "NOTE: Setting macro variable " vname "with statement:" value ; 10224 call execute(value); 10225 end; /* do i= */ 10226 dsid = close(dsid); 10227 end; /* dsid > 0 */ 10228 else 10229 do; 10230 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 10231 abort; 10232 end; 10233 stop; 10234 run; 10235 10236 %rcSet(&syserr); 10237 %mend etls_getParameters; 10238 10239 %macro etls_loopW6O7ZETI; 10240 %local etls_filePrefix; 10241 %let etls_filePrefix = ; 10242 10243 %macro etls_processToLoopW6O7ZETS(parameterTable=, row=, handleName=rmt); 10244 %etls_getParameters(parameterTable=¶meterTable, row=&row, 10245 startingColumnNumber=1, handleName=&handleName); 10246 %let etls_previousFilePrefix = &etls_filePrefix; 10247 %local etls_filePrefix; 10248 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 10249 %syslput &etls_controlName = &row / remote = &handleName; 10250 %syslput handleName = &handleName / remote = &handleName; 10251 10252 /* Setup to pass macros to remote session */ 10253 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 10254 10255 rsubmit &handleName wait = no sysrputsync = yes persist = no 10256 log = "&etls_logOutputPath./&etls_filePrefix..log" 10257 output = "&etls_logOutputPath./&etls_filePrefix..lst" 10258 ; 10259 298 The SAS System 12:24 Tuesday, January 12, 2016 10260 %macro etls_jobW6O7ZEU2; 10261 10262 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 10263 10264 /****************************************************************************** 10265 * Job: RPODSDW126 A50D7W6R.AQ000R09 * 10266 * Description: * 10267 * * 10268 * Repository: me_besa A0000001.A50D7W6R * 10269 * Server: besa A5NJAD6Z.AT000001 * 10270 * * 10271 * Source Tables: TSEGMENTOCLI - ODSBESA.TSEGMENTOCLI A5NJAD6Z.BJ00009Y * 10272 * TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 10273 * Target Table: M_ODS_DW126 - GLBBESA.M_ODS_DW126 A5NJAD6Z.BJ000OPD * 10274 * * 10275 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 10276 * Generated by: s-bametasasd1\dvbesa * 10277 * Version: 9.1.20060626.51875 * 10278 ******************************************************************************/ 10279 10280 /* Create metadata macro variables */ 10281 %let IOMServer = %nrquote(besa); 10282 %let metaPort = %nrquote(8561); 10283 %let metaServer = %nrquote(s-bametasasd1); 10284 %let metaRepository = %nrquote(me_besa); 10285 10286 /* Set metadata options */ 10287 options metaport = &metaPort 10288 metaserver = "&metaServer" 10289 metarepository = "&metaRepository"; 10290 10291 %let jobID = %quote(A50D7W6R.AQ000R09); 10292 10293 /* Setup to capture return codes */ 10294 %global job_rc trans_rc sqlrc; 10295 %let job_rc = 0; 10296 %let trans_rc = 0; 10297 %let sqlrc = 0; 10298 %global syserr; 10299 10300 %macro rcSet(error); 10301 %if (&error gt &trans_rc) %then 10302 %let trans_rc = &error; 10303 %if (&error gt &job_rc) %then 10304 %let job_rc = &error; 10305 %mend rcSet; 10306 10307 %macro rcSetDS(error); 10308 if &error gt input(symget('trans_rc'),12.) then 10309 call symput('trans_rc',trim(left(put(&error,12.)))); 10310 if &error gt input(symget('job_rc'),12.) then 10311 call symput('job_rc',trim(left(put(&error,12.)))); 10312 %mend rcSetDS; 10313 10314 %global etls_debug; 10315 %macro etls_setDebug; 10316 %if %str(&etls_debug) ne 0 %then 10317 OPTIONS MPRINT%str(;); 299 The SAS System 12:24 Tuesday, January 12, 2016 10318 %mend; 10319 %etls_setDebug; 10320 10321 %macro genSASCommand; 10322 %local noobjserver; 10323 %if "&sysscp"="OS" %then %let noobjserver=; 10324 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 10325 %else %let noobjserver=%quote(-noobjectserver); 10326 options sascmd = "!sascmd &noobjserver"; 10327 %mend genSASCommand; 10328 %genSASCommand; 10329 10330 /****************************************************************************** 10331 * Macro: * 10332 * etls_tsLevel- Executes a data step using the tslvl function to * 10333 * determine if a feature is installed. * 10334 * * 10335 * Parameters: * 10336 * macroName- Name of macro to hold the value returned from the * 10337 * function call, a blank value indicates the feature is not * 10338 * installed. * 10339 * featureName - Name of feature to test for installation status. * 10340 ******************************************************************************/ 10341 %macro etls_tsLevel(macroName=, featureName=); 10342 data _null_; 10343 call symput("¯oName",tslvl("&featureName")); 10344 run; 10345 %mend etls_tsLevel; 10346 10347 /****************************************************************************** 10348 * Macro: * 10349 * etls_signon - Executes a signon to a remote machine. * 10350 * * 10351 * Parameters: * 10352 * handleName - Name of handle to access the remote connection. * 10353 * cmacvar - Macro variable to capture the status of the signon. * 10354 * gridRC- Macro variable to capture the return code of the grid * 10355 * signon. * 10356 * useGrid- A value of 1 will attempt to use a grid for the signon. * 10357 * If the grid functions are not installed then a local signon * 10358 * is performed. * 10359 * machineIdMacroVariable- Name of macro variable to capture the name * 10360 * of the machine used for a grid signon. * 10361 * workloadMacroVariable- Name of macro variable that specifies the * 10362 * workload to use for a grid signon. * 10363 * log - Path to a log file for the signon. * 10364 * output - Path to an output file for the signon. * 10365 * additionalSignonOptions- Any additional options for the signon * 10366 * statement. * 10367 * signonRetries- Integer value of signons to try before quiting. * 10368 * The wait between tries starts at 5 seconds, * 10369 * increments by 5 seconds. * 10370 ******************************************************************************/ 10371 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 10372 gridRC=rc, useGrid=1, 10373 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 10374 log=, output=, additionalSignonOptions=, signonRetries=3); 10375 300 The SAS System 12:24 Tuesday, January 12, 2016 10376 %let etls_gridInstalled =; 10377 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 10378 10379 %if (&useGrid = 1) %then 10380 %do; 10381 %if ("&etls_gridInstalled" ne "") %then 10382 %do; 10383 %if (&gridRC eq ) %then 10384 %let gridRC = &handleName.RC ; 10385 10386 %global &gridRC; 10387 %let workload = ; 10388 %if (&workloadMacroVariable ne ) %then 10389 %do; 10390 data _null_; 10391 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 10392 run; 10393 %end; 10394 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 10395 %end; 10396 %else 10397 %put %str(NOTE: Grid service functions are not installed.); 10398 %end; 10399 10400 %local sleeptime sleepIncreaseAmount tryCount; 10401 %let sleepIncreaseAmount=5; 10402 %let sleeptime=5; 10403 %let tryCount=1; 10404 %let &cmacvar=1; 10405 10406 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 10407 data _null_; 10408 signon &handleName cmacvar=&cmacvar 10409 %if ("&log" ne "") %then 10410 log=&log; 10411 %if ("&output" ne "") %then 10412 output=&output; 10413 %if ("&additionalSignonOptions" ne "") %then 10414 &additionalSignonOptions; 10415 ;run; 10416 10417 %if ("&machineIdMacroVariable" ne "") %then 10418 %do; 10419 %if ("&etls_gridInstalled" ne "") %then 10420 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 10421 %else 10422 %put %str(NOTE: Grid service functions are not installed.); 10423 %end; 10424 10425 %if "&&&cmacvar" eq "1" %then 10426 %do; 10427 %if &tryCount lt %eval(&signonRetries+1) %then 10428 %do; 10429 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 10430 %let rc=%sysfunc(sleep(&sleeptime,1)); 10431 %end; 10432 %else %if &signonRetries gt 0 %then 10433 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 301 The SAS System 12:24 Tuesday, January 12, 2016 10434 10435 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 10436 %let tryCount=%eval(&tryCount+1); 10437 %end; 10438 %end; 10439 %rcSet(&syserr); 10440 10441 %mend etls_signon; 10442 10443 /****************************************************************************** 10444 * Macro: * 10445 * etls_serverConnected- Tests to see if a connection to a remote * 10446 * exists. * 10447 * * 10448 * Parameters: * 10449 * serverId - Handle to the remote to test. * 10450 * macvarname- Name of macro variable to hold the return value of the * 10451 * status. Will equal 1 if the connection exists, 0 * 10452 * otherwise. Macro variable must be localized before * 10453 * calling this macro. * 10454 ******************************************************************************/ 10455 %macro etls_serverConnected(serverId=,macvarname=isConnected); 10456 %let &macvarname=0; 10457 %local search_str none_str savenotes; 10458 10459 /* setup information for listtask output */ 10460 /* listtask output on OS/390 differs */ 10461 %if %bquote(&sysscp) eq OS %then 10462 %do; 10463 %let search_str=Remote submit for; 10464 %let token=5; 10465 %end; 10466 %else 10467 %do; 10468 %let search_str=--------------; 10469 %let token=1; 10470 %end; 10471 10472 /* Issue listtask within PROC PRINTTO - send output to file */ 10473 filename __tmptxt TEMP; 10474 %let savenotes=%sysfunc(getoption(notes)); 10475 options nonotes; 10476 10477 proc printto log=__tmptxt new; 10478 run; 10479 10480 options notes; 10481 listtask; 10482 proc printto; 10483 run; 10484 10485 options nonotes; 10486 10487 /* read in the output from listtask */ 10488 %let dsname=_null_; 10489 data _null_(keep=Session); 10490 length line $256 sessionId $60; 10491 infile __tmptxt length=len; 302 The SAS System 12:24 Tuesday, January 12, 2016 10492 input @1 line $varying. len; 10493 10494 if line=:'There are no' then 10495 stop; 10496 /* look for the search string and scan for server name */ 10497 if index(line,"&search_str") then 10498 do; 10499 sessionId=scan(line,&token," "); 10500 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 10501 if sessionId=upcase(symget("serverId")) then 10502 do; 10503 call symput("&macvarname","1"); 10504 stop; 10505 end; 10506 end; 10507 run; 10508 filename __tmptxt clear; 10509 options &savenotes; 10510 %mend etls_serverConnected; 10511 10512 /****************************************************************************** 10513 * Macro: * 10514 * etls_signoff- Executes a signoff for a remote session, if a * 10515 * connection still exists. * 10516 * * 10517 * Parameters: * 10518 * handleName - Handle to remote session. * 10519 ******************************************************************************/ 10520 %macro etls_signoff(handleName=rmt); 10521 %local savemprint; 10522 %let savemprint=%sysfunc(getoption(mprint)); 10523 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 10524 options nomprint; 10525 %local isConnected; 10526 %etls_serverConnected(serverId=&handleName); 10527 options &savemprint; 10528 %if &isConnected %then 10529 signoff &handleName ;; 10530 %mend etls_signoff; 10531 10532 /****************************************************************************** 10533 * Macro: * 10534 * etls_getHandle- Retrieves the handle for a remote connection from the * 10535 * status table. * 10536 * * 10537 * Parameters: * 10538 * statusTable - Table containing status information. * 10539 * handleVariable- Name of variable holding the handles to the remote * 10540 * connections. * 10541 * row - Row to retrieve the information from. * 10542 ******************************************************************************/ 10543 %macro etls_getHandle(statusTable=, handleVariable=, row=); 10544 %let etls_dsid = %sysfunc(open(&statusTable)); 10545 %if (&etls_dsid = 0) %then 10546 %put %sysfunc(sysmsg()); 10547 %else 10548 %do; 10549 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 303 The SAS System 12:24 Tuesday, January 12, 2016 10550 %if (&rc ne 0) %then 10551 %put %sysfunc(sysmsg()); 10552 %else 10553 %do; 10554 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 10555 %if (&etls_varnum > 0) %then 10556 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 10557 %else 10558 %put %sysfunc(sysmsg()); 10559 %end; 10560 %let rc = %sysfunc(close(&etls_dsid)); 10561 %end; 10562 %mend etls_getHandle; 10563 10564 /****************************************************************************** 10565 * Macro: * 10566 * etls_freeHandle- Update the status of a remote connection in the * 10567 * status table and optionally signoff the connection. * 10568 * Can update the ending time of the task if an end time * 10569 * is desired. * 10570 * * 10571 * Parameters: * 10572 * statusTable - Table containing status information. * 10573 * statusVariable- Variable in status table that holds the status of * 10574 * the connection. * 10575 * handleVariable- Variable in status table that holds the names of * 10576 * the connection handles. * 10577 * handleName - Name of handle to access the remote connection. * 10578 * statusSetting- Value to set the status variable to once the * 10579 * process is complete, value must be quoted if this is * 10580 * character variable. * 10581 * endTimeVariable- Variable that contains the end time for the * 10582 * processes in the status table. * 10583 * startTimeVariable- Variable that contains the start time for the * 10584 * processes in the status table. * 10585 * signoff- Indicates whether this macro should signoff the * 10586 * connection to a remote, a value of 1 indicates a signoff * 10587 * should be made. * 10588 * returnCodeVariable- Variable in the status table that contains the * 10589 * return code for the individual processes. * 10590 * returnCodeMacroVariable- Macro variable holding the value for the * 10591 * processes return code. * 10592 * setMainJobRC- Indicates whether this macro should update the main * 10593 * job_rc for the outer process. * 10594 * statusUnknownReturnCode- Numeric value to set the status to if the * 10595 * status of the process cannot be determined. * 10596 ******************************************************************************/ 10597 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 10598 handleName=, statusSetting="Finished", 10599 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 10600 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 10601 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 10602 10603 %if ("&statusTable" ne "") %then 10604 %do; 10605 %local etls_rcMacroVarExisted; 10606 %let etls_rcMacroVarExisted = 0; 10607 %if ("&returnCodeMacroVariable" ne "") %then 304 The SAS System 12:24 Tuesday, January 12, 2016 10608 %do; 10609 proc sql noprint; 10610 select '1' into: etls_rcMacroVarExisted from dictionary.macros 10611 where name=upcase("&returnCodeMacroVariable"); 10612 quit; 10613 10614 %rcSet(&sqlrc); 10615 %if (&etls_rcMacroVarExisted = 0) %then 10616 %do; 10617 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 10618 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 10619 %end; 10620 %if (&setMainJobRC eq 1) %then 10621 %rcSet(&&&returnCodeMacroVariable); 10622 %end; 10623 %else 10624 %do; 10625 %let returnCodeMacroVariable=etls_rcmacvar; 10626 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 10627 %end; 10628 10629 %local etls_startTimeMacroVarExisted; 10630 %let etls_startTimeMacroVarExisted = 0; 10631 %if ("&startTimeMacroVariable" ne "") %then 10632 %do; 10633 proc sql noprint; 10634 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 10635 where name=upcase("&startTimeMacroVariable"); 10636 quit; 10637 10638 %rcSet(&sqlrc); 10639 %if (&etls_startTimeMacroVarExisted = 0) %then 10640 %do; 10641 %put WARNING: Start time from inner job not found. No value will be set.; 10642 %let &startTimeMacroVariable=; 10643 %end; 10644 %end; 10645 10646 %local etls_endTimeMacroVarExisted; 10647 %let etls_endTimeMacroVarExisted = 0; 10648 %if ("&endTimeMacroVariable" ne "") %then 10649 %do; 10650 proc sql noprint; 10651 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 10652 where name=upcase("&endTimeMacroVariable"); 10653 quit; 10654 10655 %rcSet(&sqlrc); 10656 %if (&etls_endTimeMacroVarExisted = 0) %then 10657 %do; 10658 %put WARNING: End time from inner job not found. Setting end time to current time.; 10659 %let &endTimeMacroVariable=%sysfunc(datetime()); 10660 %end; 10661 %end; 10662 10663 data &statusTable; 10664 modify &statusTable(where=(&handleVariable = &handleName)); 10665 %if ("&startTimeMacroVariable" ne "") %then 305 The SAS System 12:24 Tuesday, January 12, 2016 10666 %do; 10667 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 10668 %end; 10669 %if ("&endTimeVariable" ne "") %then 10670 %do; 10671 %if ("&endTimeMacroVariable" ne "") %then 10672 %do; 10673 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 10674 %end; 10675 %else 10676 &endTimeVariable = datetime();; 10677 %end; 10678 %if ("&returnCodeVariable" ne "") %then 10679 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 10680 %if ("&statusVariable" ne "") %then 10681 %do; 10682 if (symget("etls_rcMacroVarExisted") eq "0") then 10683 &statusVariable = "Unknown Status"; 10684 else 10685 &statusVariable = &statusSetting; 10686 %end; 10687 call symput('handle',&handleVariable); 10688 replace; 10689 stop; 10690 run; 10691 10692 %rcSet(&syserr); 10693 10694 %if (&signoff eq 1) %then 10695 %etls_signoff(handleName=&handle); 10696 %end; 10697 %mend etls_freeHandle; 10698 10699 /****************************************************************************** 10700 * Macro: * 10701 * etls_createHandle- Creates a handle name for a connect session and * 10702 * optionally signon to the session. * 10703 * * 10704 * Parameters: * 10705 * statusTable - Table that holds status of connections. * 10706 * statusVariable- Variable in status table that holds the status of * 10707 * the connection. * 10708 * handleVariable- Variable in status table that holds the names of * 10709 * the connection handles. * 10710 * handlePrefix- Prefix for the names of the handles, a number will * 10711 * be appended representing the row number in the table. * 10712 * workloadMacroVariable - Specification for the grid workload option. * 10713 * row - Row number in the status table to update. * 10714 * machineVariable- Variable in status table holding the name of * 10715 * machine running the task. * 10716 * statusSetting- Value to set the status variable to once the handle * 10717 * connection is made, value must be quoted if this is * 10718 * character variable. * 10719 * signon - A value of 1 will execute the signon statement. * 10720 * useGrid - A value of 1 will attempt to use a grid for the signon. * 10721 * log - Path to a log file for the signon. * 10722 * output - Path to an output file for the signon. * 10723 * gridRC- Macro variable to capture the return code of the grid * 306 The SAS System 12:24 Tuesday, January 12, 2016 10724 * signon. * 10725 * cmacvar - Macro variable to capture the status of the signon. * 10726 * additionalSignonOptions- Any additional options for the signon * 10727 * statement. * 10728 * signonRetries- Integer value of signons to try before quiting. * 10729 * The wait between tries starts at 5 seconds, * 10730 * increments by 5 seconds. * 10731 ******************************************************************************/ 10732 %macro etls_createHandle(statusTable=, statusVariable=, 10733 handleVariable=, handlePrefix=rmt, 10734 workloadMacroVariable=, row=, machineVariable=, 10735 statusSetting="Running", startTimeVariable=startTime, 10736 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 10737 additionalSignonOptions=, signonRetries= ); 10738 10739 %local remoteSessionId; 10740 %let remoteSessionId = &handlePrefix.&row; 10741 %let &cmacvar = 1; 10742 %local etls_machineId; 10743 %if (&signon eq 1) %then 10744 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 10745 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 10746 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 10747 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 10748 %else %let &cmacvar=0; 10749 10750 data &statusTable; 10751 retain ptr &row; 10752 modify &statusTable point = ptr; 10753 &handleVariable = "&remoteSessionId"; 10754 %if (&signon eq 1) %then 10755 &machineVariable = "&etls_machineId";; 10756 %if (&&&cmacvar ne 0) %then 10757 %do; 10758 &statusVariable = "Failed Signon"; 10759 %end; 10760 %else 10761 &statusVariable = &statusSetting;; 10762 %if (&startTimeVariable ne ) %then 10763 &startTimeVariable = datetime();; 10764 replace; 10765 stop; 10766 run; 10767 10768 %rcSet(&syserr); 10769 %mend etls_createHandle; 10770 10771 /****************************************************************************** 10772 * Macro: * 10773 * etls_waitfor- Executes a waitfor statement based on the status * 10774 * setting of processes in the status table. Will * 10775 * optionally perform a etls_freeHandle call if the process * 10776 * has completed. * 10777 * * 10778 * Parameters: * 10779 * statusTable - Table containing status information. * 10780 * statusVariable- Variable in status table that holds the status of * 10781 * the connection. * 307 The SAS System 12:24 Tuesday, January 12, 2016 10782 * runningStatusSetting- Value that indicates that the process is * 10783 * running, value must be quoted if this is * 10784 * character variable. * 10785 * handleVariable- Variable in status table that holds the names of * 10786 * the connection handles. * 10787 * completeStatusSetting- Value to set the status variable to once * 10788 * the process is complete, value must be quoted * 10789 * if this is character variable. * 10790 * endTimeVariable- Variable that contains the end time for the * 10791 * processes in the status table. * 10792 * startTimeVariable- Variable that contains the start time for the * 10793 * processes in the status table. * 10794 * waitType- Type of waitfor to perform; valid values are , * 10795 * _ANY_, or _ALL_. * 10796 * signoff- Indicates whether this macro should signoff the * 10797 * connection to a remote, a value of 1 indicates a signoff * 10798 * should be made. * 10799 * returnCodeVariable- Variable in the status table that contains the * 10800 * return code for the individual processes. * 10801 * returnCodeMacroVariable- Macro variable holding the value for the * 10802 * processes return code. * 10803 * statusUnknownReturnCode- Numeric value to set the status to if the * 10804 * status of the process cannot be determined. * 10805 ******************************************************************************/ 10806 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 10807 completeStatusSetting="Finished", endTimeVariable=endTime, 10808 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 10809 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 10810 10811 proc sql noprint; 10812 select count(*) into :etls_rows 10813 from &statusTable where &statusVariable = &runningStatusSetting; 10814 %let etls_rows = &etls_rows; 10815 %if (&etls_rows gt 0) %then 10816 %do; 10817 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 10818 from &statusTable where &statusVariable = &runningStatusSetting; 10819 %end; 10820 quit; 10821 10822 %rcSet(&sqlrc); 10823 10824 %if (&etls_rows gt 0) %then 10825 %do; 10826 waitfor &waitType 10827 %do i=1 %to &etls_rows; 10828 &&etlsHandles&i 10829 %end; 10830 ; 10831 %end; 10832 10833 %local useDefaultRCMacVar; 10834 %if ("&returnCodeMacroVariable" eq "") %then 10835 %let useDefaultRCMacVar=Y; 10836 10837 %do i=1 %to &etls_rows; 10838 10839 %if ("&useDefaultRCMacVar"="Y") %then 308 The SAS System 12:24 Tuesday, January 12, 2016 10840 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 10841 10842 waitfor &&etlsHandles&i timeout=1; 10843 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 10844 %do; 10845 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 10846 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 10847 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 10848 startTimeVariable=&startTimeVariable, signoff=&signoff, 10849 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 10850 statusUnknownReturnCode=&statusUnknownReturnCode, 10851 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 10852 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 10853 %put NOTE: Process &&etlsHandles&i. has completed.; 10854 %end; 10855 %else %if (&SYSRC ne -1) %then /* process status unknown */ 10856 %do; 10857 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 10858 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 10859 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 10860 startTimeVariable=&startTimeVariable, signoff=&signoff, 10861 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 10862 statusUnknownReturnCode=&statusUnknownReturnCode, 10862 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 10863 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 10864 %end; 10865 %end; 10866 %mend etls_waitfor; 10867 10868 /****************************************************************************** 10869 * Macro: * 10870 * etls_getProcessesRunning- Gets the number of processes running by * 10871 * querying the status table. * 10872 * * 10873 * Parameters: * 10874 * statusTable - Table containing status information. * 10875 * statusVariable- Variable in status table that holds the status of * 10876 * the connection. * 10877 * processCountMacro- Macro variable to contain the value of the * 10878 * number of processes running. Macro variable must * 10879 * be localized before calling this macro. * 10880 * statusSetting- Value that indicates that the process is running, * 10881 * value must be quoted if this is character variable. * 10882 ******************************************************************************/ 10883 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 10884 statusSetting="Running"); 10885 10886 proc sql noprint; 10887 select count(*) into: &processCountMacro 10888 from &statusTable where &statusVariable = &statusSetting; 10889 quit; 10890 10891 %rcSet(&sqlrc); 10892 %mend etls_getProcessesRunning; 10893 10894 /*============================================================================* 10895 * Step: SAS Extract A50D7W6R.AR002F9G * 10896 * Transform: Extract * 309 The SAS System 12:24 Tuesday, January 12, 2016 10897 * Description: * 10898 * * 10899 * Source Table: TCLIENTE - ODSBESA.TCLIENTE A5NJAD6Z.BJ00008Q * 10900 * Target Table: Extract Target - work.W69PR0DQ A50D7W6R.AY002JAA * 10901 *============================================================================*/ 10902 10903 /* Access the data for ODSBESA */ 10904 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 10904 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 10905 %rcSet(&syslibrc); 10906 10907 %let SYSLAST = %nrquote(ODSBESA.TCLIENTE); 10908 10909 %let transformID = %quote(A50D7W6R.AR002F9G); 10910 10911 %let trans_rc = 0; 10912 10913 proc datasets lib = work nolist nowarn memtype = (data view); 10914 delete W69PR0DQ; 10915 quit; 10916 10917 proc sql; 10918 create view work.W69PR0DQ as 10919 select IDENT length = 4 label = 'IDENT', 10920 CDCLIENTE length = 9 label = 'CDCLIENTE', 10921 CDTPCLIENTE length = 1 label = 'CDTPCLIENTE', 10922 CDSITCLIENTE length = 1 label = 'CDSITCLIENTE', 10923 CDCATEGCLIENTE length = 10 label = 'CDCATEGCLIENTE', 10924 CDSEGMENTOCLI length = 9 label = 'CDSEGMENTOCLI', 10925 CDGESTORCONTA length = 9 label = 'CDGESTORCONTA', 10926 CDBALCAO length = 3 label = 'CDBALCAO' 10927 from &SYSLAST 10928 where IDENT = %MT_IDENT & DTCHANGE <= &DataParam & DTENDCHANGE >= &DataParam; 10929 quit; 10930 10931 %let SYSLAST = work.W69PR0DQ; 10932 10933 %rcSet(&sqlrc); 10934 10935 /*============================================================================* 10936 * Step: SQL Join A50D7W6R.AR002F9H * 10937 * Transform: SQL Join (Version 2) * 10938 * Description: * 10939 * * 10940 * Source Tables: Extract Target - work.W69PR0DQ A50D7W6R.AY002JAA * 10941 * TSEGMENTOCLI - ODSBESA.TSEGMENTOCLI A5NJAD6Z.BJ00009Y * 10942 * Target Table: SQL Target - work.W69PR0KB A50D7W6R.AY002JAB * 10943 *============================================================================*/ 10944 10945 %let transformID = %quote(A50D7W6R.AR002F9H); 10946 10947 %let trans_rc = 0; 10948 10949 proc datasets lib = work nolist nowarn memtype = (data view); 10950 delete W69PR0KB; 10951 quit; 10952 10953 proc sql; 310 The SAS System 12:24 Tuesday, January 12, 2016 10954 create view work.W69PR0KB as 10955 select 10956 W69PR0DQ.IDENT length = 4 10957 format = $4. 10958 informat = $4. 10959 label = 'IDENT', 10960 W69PR0DQ.CDCLIENTE length = 9 10961 format = $9. 10962 informat = $9. 10963 label = 'CDCLIENTE', 10964 W69PR0DQ.CDTPCLIENTE length = 1 10965 format = $1. 10966 informat = $1. 10967 label = 'CDTPCLIENTE', 10968 W69PR0DQ.CDSITCLIENTE length = 1 10969 format = $1. 10970 informat = $1. 10971 label = 'CDSITCLIENTE', 10972 W69PR0DQ.CDCATEGCLIENTE length = 10 10973 format = $10. 10974 informat = $10. 10975 label = 'CDCATEGCLIENTE', 10976 W69PR0DQ.CDSEGMENTOCLI length = 9 10977 format = $9. 10978 informat = $9. 10979 label = 'CDSEGMENTOCLI', 10980 W69PR0DQ.CDGESTORCONTA length = 9 10981 format = $9. 10982 informat = $9. 10983 label = 'CDGESTORCONTA', 10984 W69PR0DQ.CDBALCAO length = 3 10985 format = $3. 10986 informat = $3. 10987 label = 'CDBALCAO', 10988 TSEGMENTOCLI.LISEGMENTOCLI length = 80 10989 format = $80. 10990 informat = $80. 10991 label = 'LISEGMENTOCLI' 10992 from 10993 work.W69PR0DQ left join 10994 ODSBESA.TSEGMENTOCLI 10995 on 10996 ( 10997 W69PR0DQ.IDENT = TSEGMENTOCLI.IDENT 10998 and W69PR0DQ.CDSEGMENTOCLI = TSEGMENTOCLI.CDSEGMENTOCLI 10999 ) 11000 ; 11001 quit; 11002 11003 %rcSet(&sqlrc); 11004 11005 /*============================================================================* 11006 * Step: DEL_BY_DATE A50D7W6R.AR002F9I * 11007 * Transform: DEL_BY_DATE * 11008 * Description: * 11009 * * 11010 * Source Table: SQL Target - work.W69PR0KB A50D7W6R.AY002JAB * 11011 * Target Table: DEL_BY_DATE - work.W6FWYAS0 A50D7W6R.AY002JAC * 311 The SAS System 12:24 Tuesday, January 12, 2016 11012 *============================================================================*/ 11013 11014 %let SYSLAST = %nrquote(work.W69PR0KB); 11015 11016 %let transformID = %quote(A50D7W6R.AR002F9I); 11017 11018 %let trans_rc = 0; 11019 11020 /* Source table(s)/view(s) */ 11021 %let _INPUT1 = work.W69PR0KB; 11022 11023 /* Target table/view(s) */ 11024 %let _OUTPUT = work.W6FWYAS0; 11025 %let _OUTPUT1 = work.W6FWYAS0; 11026 11027 /* Delete target table(s) */ 11028 proc datasets lib=work nolist nowarn memtype = (data view); 11029 delete W6FWYAS0; 11030 quit; 11031 11032 /* Options */ 11033 %let data_col = %nrquote(DTPROC); 11034 %let rel_table = %nrquote(GLBBESA.M_ODS_DW126); 11035 %let data_apagar = %nrquote(&Dataparam); 11036 11037 /* List of target columns to keep */ 11038 %let keep = IDENT CDCLIENTE CDTPCLIENTE CDSITCLIENTE CDCATEGCLIENTE 11039 CDSEGMENTOCLI CDGESTORCONTA CDBALCAO LISEGMENTOCLI; 11040 11041 %macro connect_oracle(schema); 11042 11043 connect to ORACLE 11044 ( 11045 %IF %UPCASE(&schema)= CTBBESA %THEN %DO; 11046 PATH = &ORACLE_CTB_SID 11047 USER = &ORACLE_CTB_USER 11048 PASSWORD = &ORACLE_CTB_PASSWORD 11049 %END; %ELSE %IF %UPCASE(&schema)= GLBBESA %THEN %DO; 11050 PATH = &ORACLE_DM_SID 11051 USER = &ORACLE_DM_USER 11052 PASSWORD = &ORACLE_DM_PASSWORD 11053 %END; 11054 ) 11055 11056 11057 %mend connect_oracle; 11058 11059 %macro tab_oracle(tabela); 11060 %let schema=%scan(&tabela,1); 11061 %IF %UPCASE(&schema) = GLBBESA 11062 %THEN %DO; %sysfunc(cats(DMBESA,.,%scan(&tabela,2))) %END; 11063 %ELSE %DO; &tabela %END; 11064 11065 11066 %mend tab_oracle; 11067 11068 11069 312 The SAS System 12:24 Tuesday, January 12, 2016 11070 11071 11072 /* Converte data DateTime em Data */ 11073 data _null_; 11074 format a Datetime.; 11075 a = &data_apagar; 11076 call symput("data_apagarN",put(datepart(a),YYMMDD10.)); 11077 run; 11078 11079 11080 11081 proc sql; 11082 %connect_oracle(%scan(&rel_table,1)); 11083 11084 execute( 11085 delete from %tab_oracle(&rel_table) 11086 where &data_col = %bquote(')&data_apagarN%bquote(')) by oracle; 11087 11088 disconnect from ORACLE; 11089 quit; 11090 11091 11092 proc sql; 11093 create view &_OUTPUT1 as 11094 select * 11095 from &_INPUT1; 11096 quit; 11097 11098 11099 11100 11101 11102 %rcSet(&syserr); 11103 %rcSet(&sysrc); 11104 %rcSet(&sqlrc); 11105 11106 /*============================================================================* 11107 * Step: Table Loader A50D7W6R.AR002F9J * 11108 * Transform: Table Loader (Version 2) * 11109 * Description: * 11110 * * 11111 * Source Table: DEL_BY_DATE - work.W6FWYAS0 A50D7W6R.AY002JAC * 11112 * Target Table: M_ODS_DW126 - GLBBESA.M_ODS_DW126 A5NJAD6Z.BJ000OPD * 11113 *============================================================================*/ 11114 11115 /* Access the data for GLBBESA */ 11116 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 11116 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 11117 %rcSet(&syslibrc); 11118 11119 %let SYSLAST = %nrquote(work.W6FWYAS0); 11120 11121 %let transformID = %quote(A50D7W6R.AR002F9J); 11122 11123 %let trans_rc = 0; 11124 11125 %global etls_tableExist; 11126 %global etls_numIndex; 313 The SAS System 12:24 Tuesday, January 12, 2016 11127 %global etls_lastTable; 11128 %let etls_tableExist = -1; 11129 %let etls_numIndex = -1; 11130 %let etls_lastTable = &SYSLAST; 11131 11132 /*---- Define load data macro ----*/ 11133 %macro etls_loader; 11134 11135 %let SYSOPT = ; 11136 11137 /*---- Map the columns ----*/ 11138 proc datasets lib = work nolist nowarn memtype = (data view); 11139 delete mapped; 11140 quit; 11141 11142 %put %str(NOTE: Mapping columns ...); 11143 proc sql; 11144 create view work.mapped as 11145 select IDENT length = 4, 11146 (put(datepart(&dataparam),yymmdd10.)) as DTPROC length = 10 format = $10. informat = $10., 11147 CDCLIENTE length = 9, 11148 LISEGMENTOCLI length = 80, 11149 CDSITCLIENTE length = 1, 11150 CDTPCLIENTE length = 1, 11151 CDCATEGCLIENTE length = 10, 11152 CDBALCAO length = 3, 11153 CDGESTORCONTA length = 9, 11154 CDSEGMENTOCLI length = 9 11155 from &etls_lastTable; 11156 quit; 11157 11158 %let SYSLAST = work.mapped; 11159 11160 %let etls_lastTable = &SYSLAST; 11161 %let SYSOPT = ; 11162 11163 /* Determine if the target table exists */ 11164 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW126, DATA)) or 11165 %sysfunc(exist(GLBBESA.M_ODS_DW126, VIEW))); 11166 11167 /*---- Create a new table ----*/ 11168 %if (&etls_tableExist eq 0) %then 11169 %do; /* if table does not exist */ 11170 11171 %put %str(NOTE: Creating table ...); 11172 11173 data GLBBESA.M_ODS_DW126 11174 (dbnull = ( 11175 IDENT = YES 11176 DTPROC = YES 11177 CDCLIENTE = YES 11178 LISEGMENTOCLI = YES 11179 CDSITCLIENTE = YES 11180 CDTPCLIENTE = YES 11181 CDCATEGCLIENTE = YES 11182 CDBALCAO = YES 11183 CDGESTORCONTA = YES 11184 CDSEGMENTOCLI = YES)); 314 The SAS System 12:24 Tuesday, January 12, 2016 11185 attrib IDENT length = $4 format = $4. informat = $4. 11186 label = 'IDENT'; 11187 attrib DTPROC length = $10 format = $10. informat = $10. 11188 label = 'DTPROC'; 11189 attrib CDCLIENTE length = $9 format = $9. informat = $9. 11190 label = 'CDCLIENTE'; 11191 attrib LISEGMENTOCLI length = $80 format = $80. informat = $80. 11192 label = 'LISEGMENTOCLI'; 11193 attrib CDSITCLIENTE length = $1 format = $1. informat = $1. 11194 label = 'CDSITCLIENTE'; 11195 attrib CDTPCLIENTE length = $1 format = $1. informat = $1. 11196 label = 'CDTPCLIENTE'; 11197 attrib CDCATEGCLIENTE length = $10 format = $10. informat = $10. 11198 label = 'CDCATEGCLIENTE'; 11199 attrib CDBALCAO length = $3 format = $3. informat = $3. 11200 label = 'CDBALCAO'; 11201 attrib CDGESTORCONTA length = $9 format = $9. informat = $9. 11202 label = 'CDGESTORCONTA'; 11203 attrib CDSEGMENTOCLI length = $9 format = $9. informat = $9. 11204 label = 'CDSEGMENTOCLI'; 11205 stop; 11206 run; 11207 11208 %rcSet(&syserr); 11209 11210 %end; /* if table does not exist */ 11211 11212 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 11213 11214 /*---- Append new data ----*/ 11215 %put %str(NOTE: Appending data ...); 11216 11217 proc append base = GLBBESA.M_ODS_DW126 11218 data = &etls_lastTable (&SYSOPT) force; 11219 run; 11220 11221 %rcSet(&syserr); 11222 11223 proc datasets lib = work nolist nowarn memtype = (data view); 11224 delete mapped; 11225 quit; 11226 11227 %mend etls_loader; 11228 %etls_loader; 11229 11230 %sysrput job_rc&handleName = &job_rc; 11231 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 11232 11233 %mend etls_jobW6O7ZEU2; 11234 11235 %etls_jobW6O7ZEU2; 11236 11237 endrsubmit; 11238 11239 %mend etls_processToLoopW6O7ZETS; 11240 11241 %local etls_controlTable etls_statusTable etls_controlName 11242 etls_processesRunning etls_maxProcesses etls_parameterTable 315 The SAS System 12:24 Tuesday, January 12, 2016 11243 etls_additionalSignonOptions etls_signonRetries; 11244 %let etls_controlName = L19_; 11245 %let etls_statusTable = work.W6A47T4N; 11246 %let etls_parameterTable = work.W6O7ZETG; 11247 %let etls_workload = ; 11248 %let etls_additionalSignonOptions = ; 11249 %let etls_signonRetries = 3; 11250 %let &etls_controlName = 0; 11251 %let etls_controlTable = work.W6A47T2D; 11252 11253 %put %str(NOTE: Creating status table...); 11254 data &etls_statusTable 11255 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 11256 etls_status etls_jobRC DTFIM 11257 ); 11258 attrib etls_handleName length = $32 11259 label = 'Name of handle to remote session'; 11260 attrib etls_machineId length = $32 11261 label = 'Name of machine executing the task'; 11262 attrib etls_startTime length = 8 format = nldatmap. 11263 label = 'Start time of task'; 11264 attrib etls_endTime length = 8 format = nldatmap. 11265 label = 'End time of task'; 11266 attrib etls_status length = $32 11267 label = 'Current status of task'; 11268 attrib etls_jobRC length = 8 11269 label = 'Return code of task'; 11270 set &etls_controlTable; 11271 run; 11272 11273 %rcSet(&syserr); 11274 11275 %put %str(NOTE: Creating parameter table...); 11276 proc sql; 11277 create table &etls_parameterTable as 11278 select DTFIM as DataParam 11279 from &etls_controlTable; 11280 quit; 11281 11282 %rcSet(&sqlrc); 11283 11284 /* Get the number of times to iterate from the number of rows in the source */ 11285 /* table */ 11286 proc sql noprint; 11287 select count(*) into :&etls_controlName._max from &etls_statusTable; 11288 %let &etls_controlName._max = &&&etls_controlName._max; 11289 quit; 11290 11291 %rcSet(&sqlrc); 11292 11293 %let etls_gridInstalled =; 11294 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 11295 11296 %if (%str(&etls_gridInstalled) ne %str()) %then 11297 %do; 11298 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 11299 %if (&etls_maxProcesses = 0) %then 11300 %do; 316 The SAS System 12:24 Tuesday, January 12, 2016 11301 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 11302 processes to SYSNCPU value.); 11303 %let etls_maxProcesses = &SYSNCPU; 11304 %end; 11305 %end; 11306 %else 11307 %do; 11308 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 11309 processes to SYSNCPU value.); 11310 %let etls_maxProcesses = &SYSNCPU; 11311 %end; 11312 11313 %if (&etls_maxProcesses > 0) %then 11314 %do; 11315 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 11316 11317 %let etls_lastLoopPtr = &&&etls_controlName; 11318 11319 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 11320 processCountMacro=etls_processesRunning, statusSetting="Running"); 11321 11322 %do %while(&etls_processesRunning lt &&&etls_controlName._max 11323 and &etls_processesRunning lt &etls_maxProcesses 11324 and &&&etls_controlName lt &&&etls_controlName._max); 11325 11326 %let &etls_controlName = %eval(&&&etls_controlName+1); 11327 11328 %global etls_signonStatus; 11329 %let etls_logOutputPath = &DIR_PRJ_LOG.; 11330 11331 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 11332 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 11333 row=&&&etls_controlName, machineVariable=etls_machineId, 11334 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 11335 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 11336 11337 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 11338 processCountMacro=etls_processesRunning, statusSetting="Running"); 11339 11340 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 11341 %etls_processToLoopW6O7ZETS(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 11342 handleName=%etls_getHandle(statusTable=&etls_statusTable, 11343 handleVariable=etls_handleName, row=&&&etls_controlName)); 11344 %else 11345 %do; /* if signon error, set iterator to max to force loop to stop. */ 11346 %let &etls_controlName = &&&etls_controlName._max; 11347 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 11348 %end; 11349 %end; 11350 11351 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 11352 runningStatusSetting="Running", handleVariable=etls_handleName, 11353 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 11354 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 11355 returnCodeVariable=etls_jobRC, 11356 statusUnknownReturnCode=.); 11357 11358 %end; 317 The SAS System 12:24 Tuesday, January 12, 2016 11359 11360 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 11361 runningStatusSetting="Running", handleVariable=etls_handleName, 11362 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 11363 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 11364 returnCodeVariable=etls_jobRC, 11365 statusUnknownReturnCode=.); 11366 11367 %end; 11368 11369 proc datasets lib = work nolist nowarn memtype = (data view); 11370 delete W6O7ZETG; 11371 quit; 11372 11373 %mend etls_loopW6O7ZETI; 11374 11375 %etls_loopW6O7ZETI; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_LOOPW6O7ZETI): data work.W6A47T4N (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZETI): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6A47T2D MPRINT(ETLS_LOOPW6O7ZETI): set work.W6A47T2D; MPRINT(ETLS_LOOPW6O7ZETI): run; NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W6A47T2D. NOTE: The data set WORK.W6A47T4N has 1 observations and 7 variables. NOTE: Compressing data set WORK.W6A47T4N 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.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 2 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 318 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETI): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZETI): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZETG SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W6A47T2D MPRINT(ETLS_LOOPW6O7ZETI): create table work.W6O7ZETG as select DTFIM as DataParam from work.W6A47T2D; NOTE: Compression was disabled for data set WORK.W6O7ZETG because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZETG created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZETI): quit; 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 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETI): ; MPRINT(ETLS_LOOPW6O7ZETI): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_LOOPW6O7ZETI): select count(*) into :L19__max from work.W6A47T4N; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZETI): quit; 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 226k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 319 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETI): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZETI): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6A47T4N where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 320 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZETI): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L19_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L19_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 321 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable GRIDRC resolves to L19_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L19_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L19_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.09 seconds cpu time 0.08 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_work3B360000012B_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.15 seconds user cpu time 0.05 seconds system cpu time 0.03 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 95 Involuntary Context Switches 4 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_work3B360000012B_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L19_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.05 seconds user cpu time 0.00 seconds system cpu time 0.02 seconds Memory 223k Page Faults 0 Page Reclaims 13 Page Swaps 0 Voluntary Context Switches 26 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N 322 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_CREATEHANDLE): data work.W6A47T4N; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_CREATEHANDLE): modify work.W6A47T4N point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L19_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L19_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W6A47T4N has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 309k Page Faults 0 Page Reclaims 1 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZETI): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W6A47T4N where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds 323 The SAS System 12:24 Tuesday, January 12, 2016 user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZETI): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZETG SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETG SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETG MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZETG"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; 324 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L19_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETG MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZETG, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable DataParam with statement:%syslput DataParam= 1764460800 / remote = L19_1; NOTE: DATA statement used (Total process time): real time 0.01 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZETS): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable ROW resolves to 1 325 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L19_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L19_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L19_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZETS): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L19_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L19_1.lst" ; 322 The SAS System 12:30 Tuesday, January 12, 2016 NOTE: Background remote submit to L19_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 333 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6A47T4N where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W6A47T4N where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; 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 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 NOTE: Remote signoff from L19_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 12.92 seconds user cpu time 2.52 seconds system cpu time 0.86 seconds Memory 17886k Page Faults 9 Page Reclaims 775 Page Swaps 0 Voluntary Context Switches 11671 Involuntary Context Switches 156 Block Input Operations 1 Block Output Operations 11 NOTE: Remote signoff from L19_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 334 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L19_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL19_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL19_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL19_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL19_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL19_1 SYMBOLGEN: Macro variable JOB_RCL19_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 335 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L19_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L19_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L19_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L19_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L19_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L19_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_FREEHANDLE): data work.W6A47T4N; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N 336 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L19_1" MPRINT(ETLS_FREEHANDLE): modify work.W6A47T4N(where=(etls_handleName = "L19_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L19_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L19_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L19_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L19_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L19_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L19_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL19_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL19_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W6A47T4N. WHERE etls_handleName='L19_1'; NOTE: The data set WORK.W6A47T4N has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L19_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). 337 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L19_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L19_1 NOTE: Process L19_1 has completed. MPRINT(ETLS_LOOPW6O7ZETI): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L19_ SYMBOLGEN: Macro variable L19__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W6A47T4N MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W6A47T4N SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W6A47T4N where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 338 The SAS System 12:24 Tuesday, January 12, 2016 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZETI): ; MPRINT(ETLS_LOOPW6O7ZETI): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZETI): delete W6O7ZETG; MPRINT(ETLS_LOOPW6O7ZETI): quit; NOTE: Deleting WORK.W6O7ZETG (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 11376 11377 /*============================================================================* 11378 * Step: Loop End A50D7W6R.B6001AAV * 11379 * Transform: Loop End * 11380 * Description: * 11381 *============================================================================*/ 11382 11383 /*============================================================================* 11384 * Step: Loop A50D7W6R.B6001AAS * 11385 * Transform: Loop * 11386 * Description: * 11387 * * 11388 * Source Table: SAS Splitter - work.W68XKUHP A50D7W6R.AY0032D6 * 11389 * Target Table: Status Table - work.W68XKUM2 A50D7W6R.AY0032D7 * 11390 *============================================================================*/ 11391 11392 %let SYSLAST = %nrquote(work.W68XKUHP); 11393 11394 %let transformID = %quote(A50D7W6R.B6001AAS); 11395 11396 %let trans_rc = 0; 11397 11398 %macro genSASCommand; 11399 %local noobjserver; 11400 %if "&sysscp"="OS" %then %let noobjserver=; 339 The SAS System 12:24 Tuesday, January 12, 2016 11401 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 11402 %else %let noobjserver=%quote(-noobjectserver); 11403 options sascmd = "!sascmd &noobjserver"; 11404 %mend genSASCommand; 11405 %genSASCommand; SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF SYMBOLGEN: Macro variable NOOBJSERVER resolves to -noobjectserver SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. MPRINT(GENSASCOMMAND): options sascmd = "!sascmd -noobjectserver"; 11406 11407 %macro etls_tsLevel(macroName=, featureName=); 11408 data _null_; 11409 call symput("¯oName",tslvl("&featureName")); 11410 run; 11411 %mend etls_tsLevel; 11412 11413 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 11414 gridRC=rc, useGrid=1, 11415 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 11416 log=, output=, additionalSignonOptions=, signonRetries=3); 11417 11418 %let etls_gridInstalled =; 11419 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 11420 11421 %if (&useGrid = 1) %then 11422 %do; 11423 %if ("&etls_gridInstalled" ne "") %then 11424 %do; 11425 %if (&gridRC eq ) %then 11426 %let gridRC = &handleName.RC ; 11427 11428 %global &gridRC; 11429 %let workload = ; 11430 %if (&workloadMacroVariable ne ) %then 11431 %do; 11432 data _null_; 11433 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 11434 run; 11435 %end; 11436 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 11437 %end; 11438 %else 11439 %put %str(NOTE: Grid service functions are not installed.); 11440 %end; 11441 11442 %local sleeptime sleepIncreaseAmount tryCount; 11443 %let sleepIncreaseAmount=5; 11444 %let sleeptime=5; 11445 %let tryCount=1; 11446 %let &cmacvar=1; 11447 11448 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 11449 data _null_; 11450 signon &handleName cmacvar=&cmacvar 11451 %if ("&log" ne "") %then 11452 log=&log; 11453 %if ("&output" ne "") %then 340 The SAS System 12:24 Tuesday, January 12, 2016 11454 output=&output; 11455 %if ("&additionalSignonOptions" ne "") %then 11456 &additionalSignonOptions; 11457 ;run; 11458 11459 %if ("&machineIdMacroVariable" ne "") %then 11460 %do; 11461 %if ("&etls_gridInstalled" ne "") %then 11462 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 11463 %else 11464 %put %str(NOTE: Grid service functions are not installed.); 11465 %end; 11466 11467 %if "&&&cmacvar" eq "1" %then 11468 %do; 11469 %if &tryCount lt %eval(&signonRetries+1) %then 11470 %do; 11471 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 11472 %let rc=%sysfunc(sleep(&sleeptime,1)); 11473 %end; 11474 %else %if &signonRetries gt 0 %then 11475 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 11476 11477 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 11478 %let tryCount=%eval(&tryCount+1); 11479 %end; 11480 %end; 11481 %rcSet(&syserr); 11482 11483 %mend etls_signon; 11484 11485 %macro etls_serverConnected(serverId=,macvarname=isConnected); 11486 %let &macvarname=0; 11487 %local search_str none_str savenotes; 11488 11489 /* setup information for listtask output */ 11490 /* listtask output on OS/390 differs */ 11491 %if %bquote(&sysscp) eq OS %then 11492 %do; 11493 %let search_str=Remote submit for; 11494 %let token=5; 11495 %end; 11496 %else 11497 %do; 11498 %let search_str=--------------; 11499 %let token=1; 11500 %end; 11501 11502 /* Issue listtask within PROC PRINTTO - send output to file */ 11503 filename __tmptxt TEMP; 11504 %let savenotes=%sysfunc(getoption(notes)); 11505 options nonotes; 11506 11507 proc printto log=__tmptxt new; 11508 run; 11509 11510 options notes; 11511 listtask; 341 The SAS System 12:24 Tuesday, January 12, 2016 11512 proc printto; 11513 run; 11514 11515 options nonotes; 11516 11517 /* read in the output from listtask */ 11518 %let dsname=_null_; 11519 data _null_(keep=Session); 11520 length line $256 sessionId $60; 11521 infile __tmptxt length=len; 11522 input @1 line $varying. len; 11523 11524 if line=:'There are no' then 11525 stop; 11526 /* look for the search string and scan for server name */ 11527 if index(line,"&search_str") then 11528 do; 11529 sessionId=scan(line,&token," "); 11530 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 11531 if sessionId=upcase(symget("serverId")) then 11532 do; 11533 call symput("&macvarname","1"); 11534 stop; 11535 end; 11536 end; 11537 run; 11538 filename __tmptxt clear; 11539 options &savenotes; 11540 %mend etls_serverConnected; 11541 11542 %macro etls_signoff(handleName=rmt); 11543 %local savemprint; 11544 %let savemprint=%sysfunc(getoption(mprint)); 11545 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 11546 options nomprint; 11547 %local isConnected; 11548 %etls_serverConnected(serverId=&handleName); 11549 options &savemprint; 11550 %if &isConnected %then 11551 signoff &handleName ;; 11552 %mend etls_signoff; 11553 11554 %macro etls_getHandle(statusTable=, handleVariable=, row=); 11555 %let etls_dsid = %sysfunc(open(&statusTable)); 11556 %if (&etls_dsid = 0) %then 11557 %put %sysfunc(sysmsg()); 11558 %else 11559 %do; 11560 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 11561 %if (&rc ne 0) %then 11562 %put %sysfunc(sysmsg()); 11563 %else 11564 %do; 11565 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 11566 %if (&etls_varnum > 0) %then 11567 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 11568 %else 11569 %put %sysfunc(sysmsg()); 342 The SAS System 12:24 Tuesday, January 12, 2016 11570 %end; 11571 %let rc = %sysfunc(close(&etls_dsid)); 11572 %end; 11573 %mend etls_getHandle; 11574 11575 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 11576 handleName=, statusSetting="Finished", 11577 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 11578 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 11579 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 11580 11581 %if ("&statusTable" ne "") %then 11582 %do; 11583 %local etls_rcMacroVarExisted; 11584 %let etls_rcMacroVarExisted = 0; 11585 %if ("&returnCodeMacroVariable" ne "") %then 11586 %do; 11587 proc sql noprint; 11588 select '1' into: etls_rcMacroVarExisted from dictionary.macros 11589 where name=upcase("&returnCodeMacroVariable"); 11590 quit; 11591 11592 %rcSet(&sqlrc); 11593 %if (&etls_rcMacroVarExisted = 0) %then 11594 %do; 11595 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 11596 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 11597 %end; 11598 %if (&setMainJobRC eq 1) %then 11599 %rcSet(&&&returnCodeMacroVariable); 11600 %end; 11601 %else 11602 %do; 11603 %let returnCodeMacroVariable=etls_rcmacvar; 11604 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 11605 %end; 11606 11607 %local etls_startTimeMacroVarExisted; 11608 %let etls_startTimeMacroVarExisted = 0; 11609 %if ("&startTimeMacroVariable" ne "") %then 11610 %do; 11611 proc sql noprint; 11612 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 11613 where name=upcase("&startTimeMacroVariable"); 11614 quit; 11615 11616 %rcSet(&sqlrc); 11617 %if (&etls_startTimeMacroVarExisted = 0) %then 11618 %do; 11619 %put WARNING: Start time from inner job not found. No value will be set.; 11620 %let &startTimeMacroVariable=; 11621 %end; 11622 %end; 11623 11624 %local etls_endTimeMacroVarExisted; 11625 %let etls_endTimeMacroVarExisted = 0; 11626 %if ("&endTimeMacroVariable" ne "") %then 11627 %do; 343 The SAS System 12:24 Tuesday, January 12, 2016 11628 proc sql noprint; 11629 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 11630 where name=upcase("&endTimeMacroVariable"); 11631 quit; 11632 11633 %rcSet(&sqlrc); 11634 %if (&etls_endTimeMacroVarExisted = 0) %then 11635 %do; 11636 %put WARNING: End time from inner job not found. Setting end time to current time.; 11637 %let &endTimeMacroVariable=%sysfunc(datetime()); 11638 %end; 11639 %end; 11640 11641 data &statusTable; 11642 modify &statusTable(where=(&handleVariable = &handleName)); 11643 %if ("&startTimeMacroVariable" ne "") %then 11644 %do; 11645 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 11646 %end; 11647 %if ("&endTimeVariable" ne "") %then 11648 %do; 11649 %if ("&endTimeMacroVariable" ne "") %then 11650 %do; 11651 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 11652 %end; 11653 %else 11654 &endTimeVariable = datetime();; 11655 %end; 11656 %if ("&returnCodeVariable" ne "") %then 11657 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 11658 %if ("&statusVariable" ne "") %then 11659 %do; 11660 if (symget("etls_rcMacroVarExisted") eq "0") then 11661 &statusVariable = "Unknown Status"; 11662 else 11663 &statusVariable = &statusSetting; 11664 %end; 11665 call symput('handle',&handleVariable); 11666 replace; 11667 stop; 11668 run; 11669 11670 %rcSet(&syserr); 11671 11672 %if (&signoff eq 1) %then 11673 %etls_signoff(handleName=&handle); 11674 %end; 11675 %mend etls_freeHandle; 11676 11677 %macro etls_createHandle(statusTable=, statusVariable=, 11678 handleVariable=, handlePrefix=rmt, 11679 workloadMacroVariable=, row=, machineVariable=, 11680 statusSetting="Running", startTimeVariable=startTime, 11681 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 11682 additionalSignonOptions=, signonRetries= ); 11683 11684 %local remoteSessionId; 11685 %let remoteSessionId = &handlePrefix.&row; 344 The SAS System 12:24 Tuesday, January 12, 2016 11686 %let &cmacvar = 1; 11687 %local etls_machineId; 11688 %if (&signon eq 1) %then 11689 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 11690 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 11691 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 11692 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 11693 %else %let &cmacvar=0; 11694 11695 data &statusTable; 11696 retain ptr &row; 11697 modify &statusTable point = ptr; 11698 &handleVariable = "&remoteSessionId"; 11699 %if (&signon eq 1) %then 11700 &machineVariable = "&etls_machineId";; 11701 %if (&&&cmacvar ne 0) %then 11702 %do; 11703 &statusVariable = "Failed Signon"; 11704 %end; 11705 %else 11706 &statusVariable = &statusSetting;; 11707 %if (&startTimeVariable ne ) %then 11708 &startTimeVariable = datetime();; 11709 replace; 11710 stop; 11711 run; 11712 11713 %rcSet(&syserr); 11714 %mend etls_createHandle; 11715 11716 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 11717 completeStatusSetting="Finished", endTimeVariable=endTime, 11718 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 11719 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 11720 11721 proc sql noprint; 11722 select count(*) into :etls_rows 11723 from &statusTable where &statusVariable = &runningStatusSetting; 11724 %let etls_rows = &etls_rows; 11725 %if (&etls_rows gt 0) %then 11726 %do; 11727 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 11728 from &statusTable where &statusVariable = &runningStatusSetting; 11729 %end; 11730 quit; 11731 11732 %rcSet(&sqlrc); 11733 11734 %if (&etls_rows gt 0) %then 11735 %do; 11736 waitfor &waitType 11737 %do i=1 %to &etls_rows; 11738 &&etlsHandles&i 11739 %end; 11740 ; 11741 %end; 11742 11743 %local useDefaultRCMacVar; 345 The SAS System 12:24 Tuesday, January 12, 2016 11744 %if ("&returnCodeMacroVariable" eq "") %then 11745 %let useDefaultRCMacVar=Y; 11746 11747 %do i=1 %to &etls_rows; 11748 11749 %if ("&useDefaultRCMacVar"="Y") %then 11750 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 11751 11752 waitfor &&etlsHandles&i timeout=1; 11753 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 11754 %do; 11755 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 11756 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 11757 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 11758 startTimeVariable=&startTimeVariable, signoff=&signoff, 11759 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 11760 statusUnknownReturnCode=&statusUnknownReturnCode, 11761 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 11762 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 11763 %put NOTE: Process &&etlsHandles&i. has completed.; 11764 %end; 11765 %else %if (&SYSRC ne -1) %then /* process status unknown */ 11766 %do; 11767 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 11768 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 11769 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 11770 startTimeVariable=&startTimeVariable, signoff=&signoff, 11771 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 11772 statusUnknownReturnCode=&statusUnknownReturnCode, startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 11773 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 11774 %end; 11775 %end; 11776 %mend etls_waitfor; 11777 11778 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 11779 statusSetting="Running"); 11780 11781 proc sql noprint; 11782 select count(*) into: &processCountMacro 11783 from &statusTable where &statusVariable = &statusSetting; 11784 quit; 11785 11786 %rcSet(&sqlrc); 11787 %mend etls_getProcessesRunning; 11788 11789 %macro etls_getParameterNames(parameterTable=, parameterVariableMacro=, startingColumnNumber=1); 11790 %let ¶meterVariableMacro = ; 11791 %let dsid = %sysfunc(open(¶meterTable)); 11792 %if (&dsid gt 0) %then 11793 %do; 11794 %do i=&startingColumnNumber %to %sysfunc(attrn(&dsid,nvars)); 11795 %let ¶meterVariableMacro = &&¶meterVariableMacro %sysfunc(varname(&dsid,&i)); 11796 %end; 11797 %let dsid = %sysfunc(close(&dsid)); 11798 %end; 11799 %else 11800 %put %sysfunc(sysmsg()); 11801 %rcSet(&syserr); 346 The SAS System 12:24 Tuesday, January 12, 2016 11802 %mend etls_getParameterNames; 11803 11804 %macro etls_getParameters(parameterTable=, row=, startingColumnNumber=1 , handleName=); 11805 data _null_; 11806 length vname $256 vtype $1 value $3200; 11807 dsid = open("¶meterTable"); 11808 if (dsid > 0) then 11809 do; 11810 do _i = 1 to &row; 11811 fetchrc = fetch(dsid); 11812 end; 11813 do _i=&startingColumnNumber to attrn(dsid,'nvars'); 11814 vname = varname(dsid,_i); 11815 vtype = vartype(dsid,_i); 11816 if (fetchrc = 0) then 11817 do; 11818 if (vtype = 'C') then 11819 do; 11820 value = getvarc(dsid,_i); 11821 value = tranwrd(value,"%","%%"); 11822 value = tranwrd(value,"(","%("); 11823 value = tranwrd(value,")","%)"); 11824 value = tranwrd(value,'"','%"'); 11825 end; 11826 else 11827 value = left(put(getvarn(dsid,_i),best32.)); 11828 end; /* fetchrc = 0 */ 11829 11830 put ; 11831 if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then 11832 do; 11833 value='%str('||trim(value)||')'; 11834 put "NOTE: Special characters encountered; References may require: %nrbquote(%)UNQUOTE(&" vname+(-1)').'; 11835 end; 11836 %if %str(&handlename) ne %str() %then 11837 %do; 11838 value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = &handleName;"; 11839 %end; 11840 %else 11841 %do; 11842 value = '%let '||trim(vname)||'= '||trim(value)||';'; 11843 %end; 11844 11845 put "NOTE: Setting macro variable " vname "with statement:" value ; 11846 call execute(value); 11847 end; /* do i= */ 11848 dsid = close(dsid); 11849 end; /* dsid > 0 */ 11850 else 11851 do; 11852 put "ERROR" ": Parameter table, ¶meterTable, could not be opened."; 11853 abort; 11854 end; 11855 stop; 11856 run; 11857 11858 %rcSet(&syserr); 11859 %mend etls_getParameters; 347 The SAS System 12:24 Tuesday, January 12, 2016 11860 11861 %macro etls_loopW6O7ZETH; 11862 %local etls_filePrefix; 11863 %let etls_filePrefix = ; 11864 11865 %macro etls_processToLoopW6O7ZETR(parameterTable=, row=, handleName=rmt); 11866 %etls_getParameters(parameterTable=¶meterTable, row=&row, 11867 startingColumnNumber=1, handleName=&handleName); 11868 %let etls_previousFilePrefix = &etls_filePrefix; 11869 %local etls_filePrefix; 11870 %let etls_filePrefix = &etls_previousFilePrefix.&handleName; 11871 %syslput &etls_controlName = &row / remote = &handleName; 11872 %syslput handleName = &handleName / remote = &handleName; 11873 11874 /* Setup to pass macros to remote session */ 11875 %syslput etls_filePrefix = &etls_filePrefix / remote = &handleName; 11876 11877 rsubmit &handleName wait = no sysrputsync = yes persist = no 11878 log = "&etls_logOutputPath./&etls_filePrefix..log" 11879 output = "&etls_logOutputPath./&etls_filePrefix..lst" 11880 ; 11881 11882 %macro etls_jobW6O7ZEU1; 11883 11884 %sysrput etls_startTime_&handleName = %sysfunc(datetime()); 11885 11886 /****************************************************************************** 11887 * Job: RPODSDW333 A50D7W6R.AQ000Q8S * 11888 * Description: * 11889 * * 11890 * Repository: me_besa A0000001.A50D7W6R * 11891 * Server: besa A5NJAD6Z.AT000001 * 11892 * * 11893 * Source Tables: D_CTB_PAIS - CTBBESA.D_CTB_PAIS A5NJAD6Z.BJ000025 * 11894 * D_GLB_CARREGAMENTO - A5NJAD6Z.BJ00006K * 11895 * GLBBESA.D_GLB_CARREGAMENTO * 11896 * TCARTAO_MOVIMENTO - A5NJAD6Z.BJ000NXC * 11897 * ODSBESA.TCARTAO_MOVIMENTO * 11898 * Target Table: M_ODS_DW333 - GLBBESA.M_ODS_DW333 A5NJAD6Z.BJ000NXB * 11899 * * 11900 * Generated on: Segunda-feira, 11 de Janeiro de 2016 17H19m GMT+01:00 * 11901 * Generated by: s-bametasasd1\dvbesa * 11902 * Version: 9.1.20060626.51875 * 11903 ******************************************************************************/ 11904 11905 /* Create metadata macro variables */ 11906 %let IOMServer = %nrquote(besa); 11907 %let metaPort = %nrquote(8561); 11908 %let metaServer = %nrquote(s-bametasasd1); 11909 %let metaRepository = %nrquote(me_besa); 11910 11911 /* Set metadata options */ 11912 options metaport = &metaPort 11913 metaserver = "&metaServer" 11914 metarepository = "&metaRepository"; 11915 11916 %let jobID = %quote(A50D7W6R.AQ000Q8S); 11917 348 The SAS System 12:24 Tuesday, January 12, 2016 11918 /* Setup to capture return codes */ 11919 %global job_rc trans_rc sqlrc; 11920 %let job_rc = 0; 11921 %let trans_rc = 0; 11922 %let sqlrc = 0; 11923 %global syserr; 11924 11925 %macro rcSet(error); 11926 %if (&error gt &trans_rc) %then 11927 %let trans_rc = &error; 11928 %if (&error gt &job_rc) %then 11929 %let job_rc = &error; 11930 %mend rcSet; 11931 11932 %macro rcSetDS(error); 11933 if &error gt input(symget('trans_rc'),12.) then 11934 call symput('trans_rc',trim(left(put(&error,12.)))); 11935 if &error gt input(symget('job_rc'),12.) then 11936 call symput('job_rc',trim(left(put(&error,12.)))); 11937 %mend rcSetDS; 11938 11939 %global etls_debug; 11940 %macro etls_setDebug; 11941 %if %str(&etls_debug) ne 0 %then 11942 OPTIONS MPRINT%str(;); 11943 %mend; 11944 %etls_setDebug; 11945 11946 %macro genSASCommand; 11947 %local noobjserver; 11948 %if "&sysscp"="OS" %then %let noobjserver=; 11949 %else %if "&sysscp"="VMS_AXP" %then %let noobjserver=%quote(/noobjectserver); 11950 %else %let noobjserver=%quote(-noobjectserver); 11951 options sascmd = "!sascmd &noobjserver"; 11952 %mend genSASCommand; 11953 %genSASCommand; 11954 11955 /****************************************************************************** 11956 * Macro: * 11957 * etls_tsLevel- Executes a data step using the tslvl function to * 11958 * determine if a feature is installed. * 11959 * * 11960 * Parameters: * 11961 * macroName- Name of macro to hold the value returned from the * 11962 * function call, a blank value indicates the feature is not * 11963 * installed. * 11964 * featureName - Name of feature to test for installation status. * 11965 ******************************************************************************/ 11966 %macro etls_tsLevel(macroName=, featureName=); 11967 data _null_; 11968 call symput("¯oName",tslvl("&featureName")); 11969 run; 11970 %mend etls_tsLevel; 11971 11972 /****************************************************************************** 11973 * Macro: * 11974 * etls_signon - Executes a signon to a remote machine. * 11975 * * 349 The SAS System 12:24 Tuesday, January 12, 2016 11976 * Parameters: * 11977 * handleName - Name of handle to access the remote connection. * 11978 * cmacvar - Macro variable to capture the status of the signon. * 11979 * gridRC- Macro variable to capture the return code of the grid * 11980 * signon. * 11981 * useGrid- A value of 1 will attempt to use a grid for the signon. * 11982 * If the grid functions are not installed then a local signon * 11983 * is performed. * 11984 * machineIdMacroVariable- Name of macro variable to capture the name * 11985 * of the machine used for a grid signon. * 11986 * workloadMacroVariable- Name of macro variable that specifies the * 11987 * workload to use for a grid signon. * 11988 * log - Path to a log file for the signon. * 11989 * output - Path to an output file for the signon. * 11990 * additionalSignonOptions- Any additional options for the signon * 11991 * statement. * 11992 * signonRetries- Integer value of signons to try before quiting. * 11993 * The wait between tries starts at 5 seconds, * 11994 * increments by 5 seconds. * 11995 ******************************************************************************/ 11996 %macro etls_signon(handleName=etlsRemote, cmacvar=etls_signonStatus, 11997 gridRC=rc, useGrid=1, 11998 machineIdMacroVariable=etls_machineId, workloadMacroVariable=, 11999 log=, output=, additionalSignonOptions=, signonRetries=3); 12000 12001 %let etls_gridInstalled =; 12002 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsvc); 12003 12004 %if (&useGrid = 1) %then 12005 %do; 12006 %if ("&etls_gridInstalled" ne "") %then 12007 %do; 12008 %if (&gridRC eq ) %then 12009 %let gridRC = &handleName.RC ; 12010 12011 %global &gridRC; 12012 %let workload = ; 12013 %if (&workloadMacroVariable ne ) %then 12014 %do; 12015 data _null_; 12016 call symput('workload',';workload = '||symget("&workloadMacroVariable")); 12017 run; 12018 %end; 12019 %let &gridRC = %sysfunc(grdsvc_enable("&handleName","resource = besa &workload ")); 12020 %end; 12021 %else 12022 %put %str(NOTE: Grid service functions are not installed.); 12023 %end; 12024 12025 %local sleeptime sleepIncreaseAmount tryCount; 12026 %let sleepIncreaseAmount=5; 12027 %let sleeptime=5; 12028 %let tryCount=1; 12029 %let &cmacvar=1; 12030 12031 %do %until((&&&cmacvar ne 1) or (&tryCount gt %eval(&signonRetries+1))); 12032 data _null_; 12033 signon &handleName cmacvar=&cmacvar 350 The SAS System 12:24 Tuesday, January 12, 2016 12034 %if ("&log" ne "") %then 12035 log=&log; 12036 %if ("&output" ne "") %then 12037 output=&output; 12038 %if ("&additionalSignonOptions" ne "") %then 12039 &additionalSignonOptions; 12040 ;run; 12041 12042 %if ("&machineIdMacroVariable" ne "") %then 12043 %do; 12044 %if ("&etls_gridInstalled" ne "") %then 12045 %let &machineIdmacroVariable = %sysfunc(grdsvc_getname(&handleName)); 12046 %else 12047 %put %str(NOTE: Grid service functions are not installed.); 12048 %end; 12049 12050 %if "&&&cmacvar" eq "1" %then 12051 %do; 12052 %if &tryCount lt %eval(&signonRetries+1) %then 12053 %do; 12054 %put NOTE: Signon attempt #&tryCount failed. Retrying in &sleeptime seconds.; 12055 %let rc=%sysfunc(sleep(&sleeptime,1)); 12056 %end; 12057 %else %if &signonRetries gt 0 %then 12058 %put ERROR%QUOTE(:) Final signon attempt, #&tryCount, failed.; 12059 12060 %let sleeptime=%sysevalf(&sleeptime+&sleepIncreaseAmount,int); /* increase sleeptime by factor */ 12061 %let tryCount=%eval(&tryCount+1); 12062 %end; 12063 %end; 12064 %rcSet(&syserr); 12065 12066 %mend etls_signon; 12067 12068 /****************************************************************************** 12069 * Macro: * 12070 * etls_serverConnected- Tests to see if a connection to a remote * 12071 * exists. * 12072 * * 12073 * Parameters: * 12074 * serverId - Handle to the remote to test. * 12075 * macvarname- Name of macro variable to hold the return value of the * 12076 * status. Will equal 1 if the connection exists, 0 * 12077 * otherwise. Macro variable must be localized before * 12078 * calling this macro. * 12079 ******************************************************************************/ 12080 %macro etls_serverConnected(serverId=,macvarname=isConnected); 12081 %let &macvarname=0; 12082 %local search_str none_str savenotes; 12083 12084 /* setup information for listtask output */ 12085 /* listtask output on OS/390 differs */ 12086 %if %bquote(&sysscp) eq OS %then 12087 %do; 12088 %let search_str=Remote submit for; 12089 %let token=5; 12090 %end; 12091 %else 351 The SAS System 12:24 Tuesday, January 12, 2016 12092 %do; 12093 %let search_str=--------------; 12094 %let token=1; 12095 %end; 12096 12097 /* Issue listtask within PROC PRINTTO - send output to file */ 12098 filename __tmptxt TEMP; 12099 %let savenotes=%sysfunc(getoption(notes)); 12100 options nonotes; 12101 12102 proc printto log=__tmptxt new; 12103 run; 12104 12105 options notes; 12106 listtask; 12107 proc printto; 12108 run; 12109 12110 options nonotes; 12111 12112 /* read in the output from listtask */ 12113 %let dsname=_null_; 12114 data _null_(keep=Session); 12115 length line $256 sessionId $60; 12116 infile __tmptxt length=len; 12117 input @1 line $varying. len; 12118 12119 if line=:'There are no' then 12120 stop; 12121 /* look for the search string and scan for server name */ 12122 if index(line,"&search_str") then 12123 do; 12124 sessionId=scan(line,&token," "); 12125 sessionId=upcase(trim(left(tranwrd(sessionId,'"',' ')))); 12126 if sessionId=upcase(symget("serverId")) then 12127 do; 12128 call symput("&macvarname","1"); 12129 stop; 12130 end; 12131 end; 12132 run; 12133 filename __tmptxt clear; 12134 options &savenotes; 12135 %mend etls_serverConnected; 12136 12137 /****************************************************************************** 12138 * Macro: * 12139 * etls_signoff- Executes a signoff for a remote session, if a * 12140 * connection still exists. * 12141 * * 12142 * Parameters: * 12143 * handleName - Handle to remote session. * 12144 ******************************************************************************/ 12145 %macro etls_signoff(handleName=rmt); 12146 %local savemprint; 12147 %let savemprint=%sysfunc(getoption(mprint)); 12148 %put %str(NOTE: Testing connection with etls_serverConnected macro %(mprint off%).); 12149 options nomprint; 352 The SAS System 12:24 Tuesday, January 12, 2016 12150 %local isConnected; 12151 %etls_serverConnected(serverId=&handleName); 12152 options &savemprint; 12153 %if &isConnected %then 12154 signoff &handleName ;; 12155 %mend etls_signoff; 12156 12157 /****************************************************************************** 12158 * Macro: * 12159 * etls_getHandle- Retrieves the handle for a remote connection from the * 12160 * status table. * 12161 * * 12162 * Parameters: * 12163 * statusTable - Table containing status information. * 12164 * handleVariable- Name of variable holding the handles to the remote * 12165 * connections. * 12166 * row - Row to retrieve the information from. * 12167 ******************************************************************************/ 12168 %macro etls_getHandle(statusTable=, handleVariable=, row=); 12169 %let etls_dsid = %sysfunc(open(&statusTable)); 12170 %if (&etls_dsid = 0) %then 12171 %put %sysfunc(sysmsg()); 12172 %else 12173 %do; 12174 %let rc = %sysfunc(fetchobs(&etls_dsid, &row)); 12175 %if (&rc ne 0) %then 12176 %put %sysfunc(sysmsg()); 12177 %else 12178 %do; 12179 %let etls_varnum = %sysfunc(varnum(&etls_dsid,&handleVariable)); 12180 %if (&etls_varnum > 0) %then 12181 %sysfunc(getvarc(&etls_dsid,&etls_varnum)); 12182 %else 12183 %put %sysfunc(sysmsg()); 12184 %end; 12185 %let rc = %sysfunc(close(&etls_dsid)); 12186 %end; 12187 %mend etls_getHandle; 12188 12189 /****************************************************************************** 12190 * Macro: * 12191 * etls_freeHandle- Update the status of a remote connection in the * 12192 * status table and optionally signoff the connection. * 12193 * Can update the ending time of the task if an end time * 12194 * is desired. * 12195 * * 12196 * Parameters: * 12197 * statusTable - Table containing status information. * 12198 * statusVariable- Variable in status table that holds the status of * 12199 * the connection. * 12200 * handleVariable- Variable in status table that holds the names of * 12201 * the connection handles. * 12202 * handleName - Name of handle to access the remote connection. * 12203 * statusSetting- Value to set the status variable to once the * 12204 * process is complete, value must be quoted if this is * 12205 * character variable. * 12206 * endTimeVariable- Variable that contains the end time for the * 12207 * processes in the status table. * 353 The SAS System 12:24 Tuesday, January 12, 2016 12208 * startTimeVariable- Variable that contains the start time for the * 12209 * processes in the status table. * 12210 * signoff- Indicates whether this macro should signoff the * 12211 * connection to a remote, a value of 1 indicates a signoff * 12212 * should be made. * 12213 * returnCodeVariable- Variable in the status table that contains the * 12214 * return code for the individual processes. * 12215 * returnCodeMacroVariable- Macro variable holding the value for the * 12216 * processes return code. * 12217 * setMainJobRC- Indicates whether this macro should update the main * 12218 * job_rc for the outer process. * 12219 * statusUnknownReturnCode- Numeric value to set the status to if the * 12220 * status of the process cannot be determined. * 12221 ******************************************************************************/ 12222 %macro etls_freeHandle(statusTable=, statusVariable=, handleVariable=, 12223 handleName=, statusSetting="Finished", 12224 endTimeVariable=endTime, startTimeVariable=startTime, signoff=1, 12225 returnCodeVariable=, returnCodeMacroVariable=, setMainJobRC=1, 12226 statusUnknownReturnCode=., startTimeMacroVariable=, endTimeMacroVariable= ); 12227 12228 %if ("&statusTable" ne "") %then 12229 %do; 12230 %local etls_rcMacroVarExisted; 12231 %let etls_rcMacroVarExisted = 0; 12232 %if ("&returnCodeMacroVariable" ne "") %then 12233 %do; 12234 proc sql noprint; 12235 select '1' into: etls_rcMacroVarExisted from dictionary.macros 12236 where name=upcase("&returnCodeMacroVariable"); 12237 quit; 12238 12239 %rcSet(&sqlrc); 12240 %if (&etls_rcMacroVarExisted = 0) %then 12241 %do; 12242 %put WARNING: Return code from inner job not found. Setting status to Unknown.; 12243 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 12244 %end; 12245 %if (&setMainJobRC eq 1) %then 12246 %rcSet(&&&returnCodeMacroVariable); 12247 %end; 12248 %else 12249 %do; 12250 %let returnCodeMacroVariable=etls_rcmacvar; 12251 %let &returnCodeMacroVariable=&statusUnknownReturnCode; 12252 %end; 12253 12254 %local etls_startTimeMacroVarExisted; 12255 %let etls_startTimeMacroVarExisted = 0; 12256 %if ("&startTimeMacroVariable" ne "") %then 12257 %do; 12258 proc sql noprint; 12259 select '1' into: etls_startTimeMacroVarExisted from dictionary.macros 12260 where name=upcase("&startTimeMacroVariable"); 12261 quit; 12262 12263 %rcSet(&sqlrc); 12264 %if (&etls_startTimeMacroVarExisted = 0) %then 12265 %do; 354 The SAS System 12:24 Tuesday, January 12, 2016 12266 %put WARNING: Start time from inner job not found. No value will be set.; 12267 %let &startTimeMacroVariable=; 12268 %end; 12269 %end; 12270 12271 %local etls_endTimeMacroVarExisted; 12272 %let etls_endTimeMacroVarExisted = 0; 12273 %if ("&endTimeMacroVariable" ne "") %then 12274 %do; 12275 proc sql noprint; 12276 select '1' into: etls_endTimeMacroVarExisted from dictionary.macros 12277 where name=upcase("&endTimeMacroVariable"); 12278 quit; 12279 12280 %rcSet(&sqlrc); 12281 %if (&etls_endTimeMacroVarExisted = 0) %then 12282 %do; 12283 %put WARNING: End time from inner job not found. Setting end time to current time.; 12284 %let &endTimeMacroVariable=%sysfunc(datetime()); 12285 %end; 12286 %end; 12287 12288 data &statusTable; 12289 modify &statusTable(where=(&handleVariable = &handleName)); 12290 %if ("&startTimeMacroVariable" ne "") %then 12291 %do; 12292 &startTimeVariable = input(symget("&startTimeMacroVariable"),32.);; 12293 %end; 12294 %if ("&endTimeVariable" ne "") %then 12295 %do; 12296 %if ("&endTimeMacroVariable" ne "") %then 12297 %do; 12298 &endTimeVariable = input(symget("&endTimeMacroVariable"),32.);; 12299 %end; 12300 %else 12301 &endTimeVariable = datetime();; 12302 %end; 12303 %if ("&returnCodeVariable" ne "") %then 12304 &returnCodeVariable = input(symget("&returnCodeMacroVariable"),32.);; 12305 %if ("&statusVariable" ne "") %then 12306 %do; 12307 if (symget("etls_rcMacroVarExisted") eq "0") then 12308 &statusVariable = "Unknown Status"; 12309 else 12310 &statusVariable = &statusSetting; 12311 %end; 12312 call symput('handle',&handleVariable); 12313 replace; 12314 stop; 12315 run; 12316 12317 %rcSet(&syserr); 12318 12319 %if (&signoff eq 1) %then 12320 %etls_signoff(handleName=&handle); 12321 %end; 12322 %mend etls_freeHandle; 12323 355 The SAS System 12:24 Tuesday, January 12, 2016 12324 /****************************************************************************** 12325 * Macro: * 12326 * etls_createHandle- Creates a handle name for a connect session and * 12327 * optionally signon to the session. * 12328 * * 12329 * Parameters: * 12330 * statusTable - Table that holds status of connections. * 12331 * statusVariable- Variable in status table that holds the status of * 12332 * the connection. * 12333 * handleVariable- Variable in status table that holds the names of * 12334 * the connection handles. * 12335 * handlePrefix- Prefix for the names of the handles, a number will * 12336 * be appended representing the row number in the table. * 12337 * workloadMacroVariable - Specification for the grid workload option. * 12338 * row - Row number in the status table to update. * 12339 * machineVariable- Variable in status table holding the name of * 12340 * machine running the task. * 12341 * statusSetting- Value to set the status variable to once the handle * 12342 * connection is made, value must be quoted if this is * 12343 * character variable. * 12344 * signon - A value of 1 will execute the signon statement. * 12345 * useGrid - A value of 1 will attempt to use a grid for the signon. * 12346 * log - Path to a log file for the signon. * 12347 * output - Path to an output file for the signon. * 12348 * gridRC- Macro variable to capture the return code of the grid * 12349 * signon. * 12350 * cmacvar - Macro variable to capture the status of the signon. * 12351 * additionalSignonOptions- Any additional options for the signon * 12352 * statement. * 12353 * signonRetries- Integer value of signons to try before quiting. * 12354 * The wait between tries starts at 5 seconds, * 12355 * increments by 5 seconds. * 12356 ******************************************************************************/ 12357 %macro etls_createHandle(statusTable=, statusVariable=, 12358 handleVariable=, handlePrefix=rmt, 12359 workloadMacroVariable=, row=, machineVariable=, 12360 statusSetting="Running", startTimeVariable=startTime, 12361 signon=1, useGrid=1, log=, output=, gridRC=, cmacvar=etls_signonStatus, 12362 additionalSignonOptions=, signonRetries= ); 12363 12364 %local remoteSessionId; 12365 %let remoteSessionId = &handlePrefix.&row; 12366 %let &cmacvar = 1; 12367 %local etls_machineId; 12368 %if (&signon eq 1) %then 12369 %etls_signon(handleName=&remoteSessionId, useGrid=&useGrid, 12370 machineIdMacroVariable=etls_machineId, workloadMacroVariable=&workloadMacroVariable, 12371 log=&log, output=&output, cmacvar=&cmacvar, gridRC=&gridRC, 12372 additionalSignonOptions=&additionalSignonOptions,signonRetries=&signonRetries); 12373 %else %let &cmacvar=0; 12374 12375 data &statusTable; 12376 retain ptr &row; 12377 modify &statusTable point = ptr; 12378 &handleVariable = "&remoteSessionId"; 12379 %if (&signon eq 1) %then 12380 &machineVariable = "&etls_machineId";; 12381 %if (&&&cmacvar ne 0) %then 356 The SAS System 12:24 Tuesday, January 12, 2016 12382 %do; 12383 &statusVariable = "Failed Signon"; 12384 %end; 12385 %else 12386 &statusVariable = &statusSetting;; 12387 %if (&startTimeVariable ne ) %then 12388 &startTimeVariable = datetime();; 12389 replace; 12390 stop; 12391 run; 12392 12393 %rcSet(&syserr); 12394 %mend etls_createHandle; 12395 12396 /****************************************************************************** 12397 * Macro: * 12398 * etls_waitfor- Executes a waitfor statement based on the status * 12399 * setting of processes in the status table. Will * 12400 * optionally perform a etls_freeHandle call if the process * 12401 * has completed. * 12402 * * 12403 * Parameters: * 12404 * statusTable - Table containing status information. * 12405 * statusVariable- Variable in status table that holds the status of * 12406 * the connection. * 12407 * runningStatusSetting- Value that indicates that the process is * 12408 * running, value must be quoted if this is * 12409 * character variable. * 12410 * handleVariable- Variable in status table that holds the names of * 12411 * the connection handles. * 12412 * completeStatusSetting- Value to set the status variable to once * 12413 * the process is complete, value must be quoted * 12414 * if this is character variable. * 12415 * endTimeVariable- Variable that contains the end time for the * 12416 * processes in the status table. * 12417 * startTimeVariable- Variable that contains the start time for the * 12418 * processes in the status table. * 12419 * waitType- Type of waitfor to perform; valid values are , * 12420 * _ANY_, or _ALL_. * 12421 * signoff- Indicates whether this macro should signoff the * 12422 * connection to a remote, a value of 1 indicates a signoff * 12423 * should be made. * 12424 * returnCodeVariable- Variable in the status table that contains the * 12425 * return code for the individual processes. * 12426 * returnCodeMacroVariable- Macro variable holding the value for the * 12427 * processes return code. * 12428 * statusUnknownReturnCode- Numeric value to set the status to if the * 12429 * status of the process cannot be determined. * 12430 ******************************************************************************/ 12431 %macro etls_waitfor(statusTable=, statusVariable=, runningStatusSetting="Running", handleVariable=, 12432 completeStatusSetting="Finished", endTimeVariable=endTime, 12433 startTimeVariable=startTime, waitType=_ANY_, signoff=1, 12434 returnCodeVariable=, returnCodeMacroVariable=, statusUnknownReturnCode=.); 12435 12436 proc sql noprint; 12437 select count(*) into :etls_rows 12438 from &statusTable where &statusVariable = &runningStatusSetting; 12439 %let etls_rows = &etls_rows; 357 The SAS System 12:24 Tuesday, January 12, 2016 12440 %if (&etls_rows gt 0) %then 12441 %do; 12442 select &handleVariable into :etlsHandles1 - :etlsHandles&etls_rows 12443 from &statusTable where &statusVariable = &runningStatusSetting; 12444 %end; 12445 quit; 12446 12447 %rcSet(&sqlrc); 12448 12449 %if (&etls_rows gt 0) %then 12450 %do; 12451 waitfor &waitType 12452 %do i=1 %to &etls_rows; 12453 &&etlsHandles&i 12454 %end; 12455 ; 12456 %end; 12457 12458 %local useDefaultRCMacVar; 12459 %if ("&returnCodeMacroVariable" eq "") %then 12460 %let useDefaultRCMacVar=Y; 12461 12462 %do i=1 %to &etls_rows; 12463 12464 %if ("&useDefaultRCMacVar"="Y") %then 12465 %let returnCodeMacroVariable=job_rc&&etlsHandles&i; 12466 12467 waitfor &&etlsHandles&i timeout=1; 12468 %if (&SYSRC eq 0) or (&SYSRC eq -2) %then /* process complete */ 12469 %do; 12470 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 12471 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 12472 statusSetting=&completeStatusSetting, endTimeVariable=&endTimeVariable, 12473 startTimeVariable=&startTimeVariable, signoff=&signoff, 12474 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 12475 statusUnknownReturnCode=&statusUnknownReturnCode, 12476 startTimeMacroVariable=etls_startTime_&&etlsHandles&i., 12477 endTimeMacroVariable=etls_endTime_&&etlsHandles&i. ); 12478 %put NOTE: Process &&etlsHandles&i. has completed.; 12479 %end; 12480 %else %if (&SYSRC ne -1) %then /* process status unknown */ 12481 %do; 12482 %etls_freeHandle(statusTable=&statusTable, statusVariable=&statusVariable, 12483 handleVariable=&handleVariable, handleName="&&etlsHandles&i", 12484 statusSetting="Unknown Status", endTimeVariable=&endTimeVariable, 12485 startTimeVariable=&startTimeVariable, signoff=&signoff, 12486 returnCodeVariable=&returnCodeVariable, returnCodeMacroVariable=&returnCodeMacroVariable, 12487 statusUnknownReturnCode=&statusUnknownReturnCode, 12487 ! startTimeMacroVariable=etls_startTime_&&etlsHandles&i ); 12488 %put NOTE: Cannot retrieve status from process &&etlsHandles&i..; 12489 %end; 12490 %end; 12491 %mend etls_waitfor; 12492 12493 /****************************************************************************** 12494 * Macro: * 12495 * etls_getProcessesRunning- Gets the number of processes running by * 12496 * querying the status table. * 358 The SAS System 12:24 Tuesday, January 12, 2016 12497 * * 12498 * Parameters: * 12499 * statusTable - Table containing status information. * 12500 * statusVariable- Variable in status table that holds the status of * 12501 * the connection. * 12502 * processCountMacro- Macro variable to contain the value of the * 12503 * number of processes running. Macro variable must * 12504 * be localized before calling this macro. * 12505 * statusSetting- Value that indicates that the process is running, * 12506 * value must be quoted if this is character variable. * 12507 ******************************************************************************/ 12508 %macro etls_getProcessesRunning(statusTable=, statusVariable=, processCountMacro=, 12509 statusSetting="Running"); 12510 12511 proc sql noprint; 12512 select count(*) into: &processCountMacro 12513 from &statusTable where &statusVariable = &statusSetting; 12514 quit; 12515 12516 %rcSet(&sqlrc); 12517 %mend etls_getProcessesRunning; 12518 12519 /*============================================================================* 12520 * Step: SAS Extract A50D7W6R.AR002WYR * 12521 * Transform: Extract * 12522 * Description: * 12523 * * 12524 * Source Table: TCARTAO_MOVIMENTO - A5NJAD6Z.BJ000NXC * 12525 * ODSBESA.TCARTAO_MOVIMENTO * 12526 * Target Table: Extract Target - work.W68UZRKQ A50D7W6R.AY002Z9Y * 12527 *============================================================================*/ 12528 12529 /* Access the data for ODSBESA */ 12530 LIBNAME ODSBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=ODSBESA USER=odsbesa 12530 ! PASSWORD="{sas001}b2RzYmVzYSMyMDEw" ; 12531 %rcSet(&syslibrc); 12532 12533 %let SYSLAST = %nrquote(ODSBESA.TCARTAO_MOVIMENTO); 12534 12535 %let transformID = %quote(A50D7W6R.AR002WYR); 12536 12537 %let trans_rc = 0; 12538 12539 proc datasets lib = work nolist nowarn memtype = (data view); 12540 delete W68UZRKQ; 12541 quit; 12542 12543 proc sql; 12544 create table work.W68UZRKQ as 12545 select IDENT length = 4, 12546 CDPAISCOMERCIANTE as CDPAIS length = 2, 12547 (SUM ( CASE WHEN CDMOVIMENTO IN ( 30 , 31 , 32 ) THEN 1 ELSE 0 END )) as NULEVANTAMENTOS length 12547 ! = 8, 12548 (SUM ( CASE WHEN CDMOVIMENTO IN ( 30 , 32 ) THEN 1 WHEN CDMOVIMENTO = 31 THEN -1 ELSE 0 END * 12548 ! MTTRANS_AOA )) as MTLEVANTAMENTOS length = 8, 12549 (SUM ( 0 ) /* não existem outras operações */) as NUOUTRASOPER length = 8, 12550 (SUM ( 0 ) /* não existem outras operações */) as MTOUTRASOPER length = 8, 12551 (SUM ( CASE WHEN CDMOVIMENTO IN ( 40 , 41 , 42 , 43 , 80 ) THEN 1 ELSE 0 END )) as NUCOMPRAS 359 The SAS System 12:24 Tuesday, January 12, 2016 12551 ! length = 8, 12552 (SUM ( CASE WHEN CDMOVIMENTO IN ( 40 , 42 , 80 ) THEN 1 WHEN CDMOVIMENTO IN ( 41 , 43 ) THEN -1 12552 ! ELSE 0 END * MTTRANS_AOA )) as MTCOMPRAS length = 8 12553 from &SYSLAST 12554 where DTTRANSACCAO BETWEEN INTNX ( 'DTMONTH' , &DataParam. , 0 ) AND INTNX ( 'DTMONTH' , 12554 ! &DataParam. , 0 , 'E' ) AND 12555 SUBSTR ( NUCARTAO , 1 , 6 ) IN ( '417981' , '417983' , '417984' , '417985') AND NUCARTAO 12555 ! NOT LIKE '403209%' AND 12556 CDMOVIMENTO IN ( 30 , 31 , 32 , 40 , 41 , 42 , 43 , 80 ) 12557 group by IDENT, CDPAIS; 12558 quit; 12559 12560 %let SYSLAST = work.W68UZRKQ; 12561 12562 %rcSet(&sqlrc); 12563 12564 /*============================================================================* 12565 * Step: SAS Extract A50D7W6R.AR002WYH * 12566 * Transform: Extract * 12567 * Description: * 12568 * * 12569 * Source Table: D_CTB_PAIS - CTBBESA.D_CTB_PAIS A5NJAD6Z.BJ000025 * 12570 * Target Table: Extract Target - work.W68VE001 A50D7W6R.AY002Z9O * 12571 *============================================================================*/ 12572 12573 /* Access the data for CTBBESA */ 12574 LIBNAME CTBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=CTBBESA USER=ctbbesa 12574 ! PASSWORD="{sas001}Y3RiYmVzYSMyMDEw" ; 12575 %rcSet(&syslibrc); 12576 12577 %let SYSLAST = %nrquote(CTBBESA.D_CTB_PAIS); 12578 12579 %let transformID = %quote(A50D7W6R.AR002WYH); 12580 12581 %let trans_rc = 0; 12582 12583 proc datasets lib = work nolist nowarn memtype = (data view); 12584 delete W68VE001; 12585 quit; 12586 12587 proc sql; 12588 create table work.W68VE001 as 12589 select IDENT length = 4 label = 'IDENT', 12590 CDPAIS length = 3 label = 'CDPAIS', 12591 CDPAISNUM length = 3 label = 'CDPAISNUM', 12592 LNPAIS length = 80 label = 'LNPAIS', 12593 CDPAISISO length = 3 label = 'CDPAISISO', 12594 CDZONAPAIS length = 1 label = 'CDZONAPAIS', 12595 INBLACKLIST length = 1 label = 'INBLACKLIST', 12596 DTUPDATE length = 8 label = 'DTUPDATE' 12597 from &SYSLAST; 12598 quit; 12599 12600 %let SYSLAST = work.W68VE001; 12601 12602 %rcSet(&sqlrc); 12603 12604 /*============================================================================* 360 The SAS System 12:24 Tuesday, January 12, 2016 12605 * Step: SQL Join A50D7W6R.AR002WYO * 12606 * Transform: SQL Join (Version 2) * 12607 * Description: * 12608 * * 12609 * Source Tables: Extract Target - work.W68UZRKQ A50D7W6R.AY002Z9Y * 12610 * Extract Target - work.W68VE001 A50D7W6R.AY002Z9O * 12611 * Target Table: SQL Target - work.W68V1Y64 A50D7W6R.AY002Z9Z * 12612 *============================================================================*/ 12613 12614 %let transformID = %quote(A50D7W6R.AR002WYO); 12615 12616 %let trans_rc = 0; 12617 12618 proc datasets lib = work nolist nowarn memtype = (data view); 12619 delete W68V1Y64; 12620 quit; 12621 12622 proc sql; 12623 create view work.W68V1Y64 as 12624 select 12625 W68UZRKQ.IDENT length = 4, 12626 W68VE001.CDPAISNUM length = 3, 12627 W68UZRKQ.CDPAIS length = 2, 12628 W68UZRKQ.NULEVANTAMENTOS length = 8, 12629 W68UZRKQ.MTLEVANTAMENTOS length = 8, 12630 W68UZRKQ.NUOUTRASOPER length = 8, 12631 W68UZRKQ.MTOUTRASOPER length = 8, 12632 W68UZRKQ.NUCOMPRAS length = 8, 12633 W68UZRKQ.MTCOMPRAS length = 8 12634 from 12635 work.W68UZRKQ left join 12636 work.W68VE001 12637 on 12638 ( 12639 W68UZRKQ.IDENT = W68VE001.IDENT 12640 and W68UZRKQ.CDPAIS = W68VE001.CDPAIS 12641 ) 12642 ; 12643 quit; 12644 12645 %rcSet(&sqlrc); 12646 12647 /*============================================================================* 12648 * Step: SAS Splitter A50D7W6R.AR002WYP * 12649 * Transform: SAS Splitter * 12650 * Description: * 12651 * * 12652 * Source Table: SQL Target - work.W68V1Y64 A50D7W6R.AY002Z9Z * 12653 * Target Tables: Splitter Target 1 - work.W68VFG18 A50D7W6R.AY002Z9W * 12654 * Splitter Target 2 - work.W68VFG1I A50D7W6R.AY002Z9U * 12655 * SAS Splitter - work.W68VFGTP A50D7W6R.AY002ZA0 * 12656 * SAS Splitter - work.W68VFGVG A50D7W6R.AY002Z9V * 12657 *============================================================================*/ 12658 12659 %let SYSLAST = %nrquote(work.W68V1Y64); 12660 12661 %let transformID = %quote(A50D7W6R.AR002WYP); 12662 361 The SAS System 12:24 Tuesday, January 12, 2016 12663 %let trans_rc = 0; 12664 12665 proc datasets lib=work nolist nowarn memtype = (data view); 12666 delete W68VFG18; 12667 delete W68VFG1I; 12668 delete W68VFGTP; 12669 delete W68VFGVG; 12670 quit; 12671 12672 data work.W68VFG18 12673 work.W68VFG1I 12674 work.W68VFGTP 12675 work.W68VFGVG; 12676 set &SYSLAST; 12677 output work.W68VFG18; 12678 output work.W68VFG1I; 12679 output work.W68VFGTP; 12680 output work.W68VFGVG; 12681 run; 12682 12683 %rcSet(&syserr); 12684 12685 /*============================================================================* 12686 * Step: Outras Oper A50D7W6R.AR002WYQ * 12687 * Transform: Extract * 12688 * Description: * 12689 * * 12690 * Source Table: SAS Splitter - work.W68VFGTP A50D7W6R.AY002ZA0 * 12691 * Target Table: Extract Target - work.W68VH20M A50D7W6R.AY002Z9R * 12692 *============================================================================*/ 12693 12694 %let SYSLAST = %nrquote(work.W68VFGTP); 12695 12696 %let transformID = %quote(A50D7W6R.AR002WYQ); 12697 12698 %let trans_rc = 0; 12699 12700 proc datasets lib = work nolist nowarn memtype = (data view); 12701 delete W68VH20M; 12702 quit; 12703 12704 proc sql; 12705 create view work.W68VH20M as 12706 select IDENT length = 4, 12707 ("OP") as TIPOINFORMACAO length = 2, 12708 CDPAISNUM length = 3, 12709 NUOUTRASOPER as CONTAGEM length = 8, 12710 MTOUTRASOPER as MONTANTE length = 8 12711 from &SYSLAST 12712 where NUOUTRASOPER > 0; 12713 quit; 12714 12715 %let SYSLAST = work.W68VH20M; 12716 12717 %rcSet(&sqlrc); 12718 12719 /*============================================================================* 12720 * Step: Compras A50D7W6R.AR002WYL * 362 The SAS System 12:24 Tuesday, January 12, 2016 12721 * Transform: Extract * 12722 * Description: * 12723 * * 12724 * Source Table: Splitter Target 1 - work.W68VFG18 A50D7W6R.AY002Z9W * 12725 * Target Table: Extract Target - work.W68VH216 A50D7W6R.AY002Z9S * 12726 *============================================================================*/ 12727 12728 %let SYSLAST = %nrquote(work.W68VFG18); 12729 12730 %let transformID = %quote(A50D7W6R.AR002WYL); 12731 12732 %let trans_rc = 0; 12733 12734 proc datasets lib = work nolist nowarn memtype = (data view); 12735 delete W68VH216; 12736 quit; 12737 12738 proc sql; 12739 create view work.W68VH216 as 12740 select IDENT length = 4, 12741 ("CP") as TIPOINFORMACAO length = 2, 12742 CDPAISNUM length = 3, 12743 NUCOMPRAS as CONTAGEM length = 8, 12744 MTCOMPRAS as MONTANTE length = 8 12745 from &SYSLAST 12746 where NUCOMPRAS > 0; 12747 quit; 12748 12749 %let SYSLAST = work.W68VH216; 12750 12751 %rcSet(&sqlrc); 12752 12753 /*============================================================================* 12754 * Step: Levantamentos A50D7W6R.AR002WYK * 12755 * Transform: Extract * 12756 * Description: * 12757 * * 12758 * Source Table: SAS Splitter - work.W68VFGVG A50D7W6R.AY002Z9V * 12759 * Target Table: Extract Target - work.W68VH082 A50D7W6R.AY002Z9Q * 12760 *============================================================================*/ 12761 12762 %let SYSLAST = %nrquote(work.W68VFGVG); 12763 12764 %let transformID = %quote(A50D7W6R.AR002WYK); 12765 12766 %let trans_rc = 0; 12767 12768 proc datasets lib = work nolist nowarn memtype = (data view); 12769 delete W68VH082; 12770 quit; 12771 12772 proc sql; 12773 create view work.W68VH082 as 12774 select IDENT length = 4, 12775 ("LV") as TIPOINFORMACAO length = 2, 12776 CDPAISNUM length = 3, 12777 NULEVANTAMENTOS as CONTAGEM length = 8, 12778 MTLEVANTAMENTOS as MONTANTE length = 8 363 The SAS System 12:24 Tuesday, January 12, 2016 12779 from &SYSLAST 12780 where NULEVANTAMENTOS > 0; 12781 quit; 12782 12783 %let SYSLAST = work.W68VH082; 12784 12785 %rcSet(&sqlrc); 12786 12787 /*============================================================================* 12788 * Step: Total ATMs A50D7W6R.AR002WYJ * 12789 * Transform: Extract * 12790 * Description: * 12791 * * 12792 * Source Table: Splitter Target 2 - work.W68VFG1I A50D7W6R.AY002Z9U * 12793 * Target Table: Extract Target - work.W68VFH74 A50D7W6R.AY002Z9P * 12794 *============================================================================*/ 12795 12796 %let SYSLAST = %nrquote(work.W68VFG1I); 12797 12798 %let transformID = %quote(A50D7W6R.AR002WYJ); 12799 12800 %let trans_rc = 0; 12801 12802 proc datasets lib = work nolist nowarn memtype = (data view); 12803 delete W68VFH74; 12804 quit; 12805 12806 proc sql; 12807 create view work.W68VFH74 as 12808 select distinct IDENT length = 4, 12809 ("AT") as TIPOINFORMACAO length = 2, 12810 ("") as CDPAISNUM length = 3, 12811 (0) as CONTAGEM length = 8, 12812 (.) as MONTANTE length = 8 12813 from &SYSLAST; 12814 quit; 12815 12816 %let SYSLAST = work.W68VFH74; 12817 12818 %rcSet(&sqlrc); 12819 12820 /*============================================================================* 12821 * Step: Append A50D7W6R.AR002WYI * 12822 * Transform: Append * 12823 * Description: * 12824 * * 12825 * Source Tables: Extract Target - work.W68VFH74 A50D7W6R.AY002Z9P * 12826 * Extract Target - work.W68VH082 A50D7W6R.AY002Z9Q * 12827 * Extract Target - work.W68VH20M A50D7W6R.AY002Z9R * 12828 * Extract Target - work.W68VH216 A50D7W6R.AY002Z9S * 12829 * Target Table: AppendWorkTableName - work.W68VH3PU A50D7W6R.AY002Z9T * 12830 *============================================================================*/ 12831 12832 %let transformID = %quote(A50D7W6R.AR002WYI); 12833 12834 %let trans_rc = 0; 12835 12836 proc datasets lib = work nolist nowarn memtype = (data view); 364 The SAS System 12:24 Tuesday, January 12, 2016 12837 delete W68VH3PU; 12838 quit; 12839 12840 data work.W68VH3PU / view=work.W68VH3PU; 12841 set work.W68VFH74 12842 work.W68VH082 12843 work.W68VH20M 12844 work.W68VH216; 12845 keep IDENT TIPOINFORMACAO CDPAISNUM CONTAGEM MONTANTE; 12846 run; 12847 12848 %rcSet(&syserr); 12849 12850 /*============================================================================* 12851 * Step: VERSIONAMENTO A50D7W6R.AR002WYM * 12852 * Transform: VERSIONAMENTO * 12853 * Description: * 12854 * * 12855 * Source Tables: D_GLB_CARREGAMENTO - A5NJAD6Z.BJ00006K * 12856 * GLBBESA.D_GLB_CARREGAMENTO * 12857 * AppendWorkTableName - work.W68VH3PU A50D7W6R.AY002Z9T * 12858 * Target Table: VERSIONAMENTO - work.W68V21JQ A50D7W6R.AY002Z9X * 12859 *============================================================================*/ 12860 12861 /* Access the data for GLBBESA */ 12862 LIBNAME GLBBESA ORACLE PATH=DWCPD1 PATH=DWCPD1 SCHEMA=DMBESA USER=dmbesa 12862 ! PASSWORD="{sas001}ZG1iZXNhIzIwMTA=" ; 12863 %rcSet(&syslibrc); 12864 12865 %let transformID = %quote(A50D7W6R.AR002WYM); 12866 12867 %let trans_rc = 0; 12868 12869 /* Source table(s)/view(s) */ 12870 %let _INPUT1 = GLBBESA.D_GLB_CARREGAMENTO; 12871 %let _INPUT0 = work.W68VH3PU; 12872 12873 /* Target table/view(s) */ 12874 %let _OUTPUT = work.W68V21JQ; 12875 %let _OUTPUT0 = work.W68V21JQ; 12876 12877 /* Delete target table(s) */ 12878 proc datasets lib=work nolist nowarn memtype = (data view); 12879 delete W68V21JQ; 12880 quit; 12881 12882 /* Options */ 12883 %let Relatorio = %nrquote(DW333); 12884 12885 /* List of target columns to keep */ 12886 %let keep = IDENT TIPOINFORMACAO CDPAISNUM CONTAGEM MONTANTE; 12887 12888 %let versaoaux=; 12889 %let data=%sysfunc(datepart(&DATAPARAM),YYMMDDN8.); 12890 12891 12892 proc sql; 12893 connect to oracle (PATH = &ORACLE_DM_SID USER = &ORACLE_DM_USER PASSWORD = &ORACLE_DM_PASSWORD); 365 The SAS System 12:24 Tuesday, January 12, 2016 12894 12895 select versao into :versaoaux 12896 from connection to oracle 12897 (select pk_func_auxiliares.F_UPDATE_VERSIONAMENTO(%bquote(')&RELATORIO%bquote('), 12897 ! to_date(%bquote(')&DATA%bquote('),'YYYYMMDD')) as versao from dual); 12898 12899 disconnect from oracle; 12900 12901 quit; 12902 12903 proc sql; 12904 create view &_OUTPUT0 as 12905 select * 12906 from &_INPUT0; 12907 quit; 12908 12909 12910 12911 %rcSet(&syserr); 12912 %rcSet(&sysrc); 12913 %rcSet(&sqlrc); 12914 12915 /*============================================================================* 12916 * Step: Table Loader A50D7W6R.AR002WYN * 12917 * Transform: Table Loader (Version 2) * 12918 * Description: * 12919 * * 12920 * Source Table: VERSIONAMENTO - work.W68V21JQ A50D7W6R.AY002Z9X * 12921 * Target Table: M_ODS_DW333 - GLBBESA.M_ODS_DW333 A5NJAD6Z.BJ000NXB * 12922 *============================================================================*/ 12923 12924 %let SYSLAST = %nrquote(work.W68V21JQ); 12925 12926 %let transformID = %quote(A50D7W6R.AR002WYN); 12927 12928 %let trans_rc = 0; 12929 12930 %global etls_tableExist; 12931 %global etls_numIndex; 12932 %global etls_lastTable; 12933 %let etls_tableExist = -1; 12934 %let etls_numIndex = -1; 12935 %let etls_lastTable = &SYSLAST; 12936 12937 /*---- Define load data macro ----*/ 12938 %macro etls_loader; 12939 12940 %let SYSOPT = ; 12941 12942 /*---- Map the columns ----*/ 12943 proc datasets lib = work nolist nowarn memtype = (data view); 12944 delete mapped; 12945 quit; 12946 12947 %put %str(NOTE: Mapping columns ...); 12948 proc sql; 12949 create view work.mapped as 12950 select IDENT length = 4 format = $4. informat = $4., 366 The SAS System 12:24 Tuesday, January 12, 2016 12951 (&DataParam) as DTPROC length = 8 format = DATETIME20. informat = DATETIME20., 12952 (&versaoaux) as VERSAO length = 8, 12953 TIPOINFORMACAO length = 2 format = $2. informat = $2., 12954 CDPAISNUM length = 3 format = $3. informat = $3., 12955 CONTAGEM length = 8 format = 9. informat = 9., 12956 MONTANTE length = 8 format = 24.3 informat = 24.3 12957 from &etls_lastTable; 12958 quit; 12959 12960 %let SYSLAST = work.mapped; 12961 12962 %let etls_lastTable = &SYSLAST; 12963 %let SYSOPT = ; 12964 12965 /* Determine if the target table exists */ 12966 %let etls_tableExist = %eval(%sysfunc(exist(GLBBESA.M_ODS_DW333, DATA)) or 12967 %sysfunc(exist(GLBBESA.M_ODS_DW333, VIEW))); 12968 12969 /*---- Create a new table ----*/ 12970 %if (&etls_tableExist eq 0) %then 12971 %do; /* if table does not exist */ 12972 12973 %put %str(NOTE: Creating table ...); 12974 12975 data GLBBESA.M_ODS_DW333 12976 (dbnull = ( 12977 IDENT = YES 12978 DTPROC = YES 12979 VERSAO = YES 12980 TIPOINFORMACAO = YES 12981 CDPAISNUM = YES 12982 CONTAGEM = YES 12983 MONTANTE = YES)); 12984 attrib IDENT length = $4 format = $4. informat = $4. 12985 label = 'IDENT'; 12986 attrib DTPROC length = 8 format = DATETIME20. informat = DATETIME20. 12987 label = 'DTPROC'; 12988 attrib VERSAO length = 8 12989 label = 'VERSAO'; 12990 attrib TIPOINFORMACAO length = $2 format = $2. informat = $2. 12991 label = 'TIPOINFORMACAO'; 12992 attrib CDPAISNUM length = $3 format = $3. informat = $3. 12993 label = 'CDPAISNUM'; 12994 attrib CONTAGEM length = 8 format = 9. informat = 9. 12995 label = 'CONTAGEM'; 12996 attrib MONTANTE length = 8 format = 24.3 informat = 24.3 12997 label = 'MONTANTE'; 12998 stop; 12999 run; 13000 13001 %rcSet(&syserr); 13002 13003 %end; /* if table does not exist */ 13004 13005 /* Loader CI Selections: 'ASIS','ASIS','ASIS','ASIS' */ 13006 13007 /*---- Append new data ----*/ 13008 %put %str(NOTE: Appending data ...); 367 The SAS System 12:24 Tuesday, January 12, 2016 13009 13010 proc append base = GLBBESA.M_ODS_DW333 13011 data = &etls_lastTable (&SYSOPT) force; 13012 run; 13013 13014 %rcSet(&syserr); 13015 13016 proc datasets lib = work nolist nowarn memtype = (data view); 13017 delete mapped; 13018 quit; 13019 13020 %mend etls_loader; 13021 %etls_loader; 13022 13023 %sysrput job_rc&handleName = &job_rc; 13024 %sysrput etls_endTime_&handleName = %sysfunc(datetime()); 13025 13026 %mend etls_jobW6O7ZEU1; 13027 13028 %etls_jobW6O7ZEU1; 13029 13030 endrsubmit; 13031 13032 %mend etls_processToLoopW6O7ZETR; 13033 13034 %local etls_controlTable etls_statusTable etls_controlName 13035 etls_processesRunning etls_maxProcesses etls_parameterTable 13036 etls_additionalSignonOptions etls_signonRetries; 13037 %let etls_controlName = L80_; 13038 %let etls_statusTable = work.W68XKUM2; 13039 %let etls_parameterTable = work.W6O7ZETU; 13040 %let etls_workload = ; 13041 %let etls_additionalSignonOptions = ; 13042 %let etls_signonRetries = 3; 13043 %let &etls_controlName = 0; 13044 %let etls_controlTable = work.W68XKUHP; 13045 13046 %put %str(NOTE: Creating status table...); 13047 data &etls_statusTable 13048 (keep = etls_handleName etls_machineId etls_startTime etls_endTime 13049 etls_status etls_jobRC DTFIM 13050 ); 13051 attrib etls_handleName length = $32 13052 label = 'Name of handle to remote session'; 13053 attrib etls_machineId length = $32 13054 label = 'Name of machine executing the task'; 13055 attrib etls_startTime length = 8 format = nldatmap. 13056 label = 'Start time of task'; 13057 attrib etls_endTime length = 8 format = nldatmap. 13058 label = 'End time of task'; 13059 attrib etls_status length = $32 13060 label = 'Current status of task'; 13061 attrib etls_jobRC length = 8 13062 label = 'Return code of task'; 13063 set &etls_controlTable; 13064 run; 13065 13066 %rcSet(&syserr); 368 The SAS System 12:24 Tuesday, January 12, 2016 13067 13068 %put %str(NOTE: Creating parameter table...); 13069 proc sql; 13070 create table &etls_parameterTable as 13071 select DTFIM as DataParam 13072 from &etls_controlTable; 13073 quit; 13074 13075 %rcSet(&sqlrc); 13076 13077 /* Get the number of times to iterate from the number of rows in the source */ 13078 /* table */ 13079 proc sql noprint; 13080 select count(*) into :&etls_controlName._max from &etls_statusTable; 13081 %let &etls_controlName._max = &&&etls_controlName._max; 13082 quit; 13083 13084 %rcSet(&sqlrc); 13085 13086 %let etls_gridInstalled =; 13087 %etls_tsLevel(macroName=etls_gridInstalled, featureName=uwugrdsv); 13088 13089 %if (%str(&etls_gridInstalled) ne %str()) %then 13090 %do; 13091 %let etls_maxProcesses = %sysfunc(grdsvc_nnodes("besa")); 13092 %if (&etls_maxProcesses = 0) %then 13093 %do; 13094 %put %str(NOTE: No configured grid nodes were found; setting maximum concurrent 13095 processes to SYSNCPU value.); 13096 %let etls_maxProcesses = &SYSNCPU; 13097 %end; 13098 %end; 13099 %else 13100 %do; 13101 %put %str(NOTE: Grid service functions are not installed; setting maximum concurrent 13102 processes to SYSNCPU value.); 13103 %let etls_maxProcesses = &SYSNCPU; 13104 %end; 13105 13106 %if (&etls_maxProcesses > 0) %then 13107 %do; 13108 %do %until (&&&etls_controlName ge &&&etls_controlName._max); 13109 13110 %let etls_lastLoopPtr = &&&etls_controlName; 13111 13112 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 13113 processCountMacro=etls_processesRunning, statusSetting="Running"); 13114 13115 %do %while(&etls_processesRunning lt &&&etls_controlName._max 13116 and &etls_processesRunning lt &etls_maxProcesses 13117 and &&&etls_controlName lt &&&etls_controlName._max); 13118 13119 %let &etls_controlName = %eval(&&&etls_controlName+1); 13120 13121 %global etls_signonStatus; 13122 %let etls_logOutputPath = &DIR_PRJ_LOG.; 13123 13124 %etls_createHandle(statusTable=&etls_statusTable, statusVariable=etls_status, 369 The SAS System 12:24 Tuesday, January 12, 2016 13125 handleVariable=etls_handleName, handlePrefix=&etls_controlName, 13126 row=&&&etls_controlName, machineVariable=etls_machineId, 13127 startTimeVariable=etls_startTime, cmacvar=etls_signonStatus, signon=1, useGrid=1, 13128 additionalSignonOptions=&etls_additionalSignonOptions, signonRetries=&etls_signonRetries); 13129 13130 %etls_getProcessesRunning(statusTable=&etls_statusTable, statusVariable=etls_status, 13131 processCountMacro=etls_processesRunning, statusSetting="Running"); 13132 13133 %if &etls_processesRunning > 0 and &etls_signonStatus ne 1 %then 13134 %etls_processToLoopW6O7ZETR(parameterTable=&etls_parameterTable, row=&&&etls_controlName, 13135 handleName=%etls_getHandle(statusTable=&etls_statusTable, 13136 handleVariable=etls_handleName, row=&&&etls_controlName)); 13137 %else 13138 %do; /* if signon error, set iterator to max to force loop to stop. */ 13139 %let &etls_controlName = &&&etls_controlName._max; 13140 %put %str(ERROR%QUOTE(:) A parallel process did not start. Exiting loop.); 13141 %end; 13142 %end; 13143 13144 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 13145 runningStatusSetting="Running", handleVariable=etls_handleName, 13146 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 13147 startTimeVariable=etls_startTime, waitType=_ANY_, signoff=1, 13148 returnCodeVariable=etls_jobRC, 13149 statusUnknownReturnCode=.); 13150 13151 %end; 13152 13153 %etls_waitFor(statusTable=&etls_statusTable, statusVariable=etls_status, 13154 runningStatusSetting="Running", handleVariable=etls_handleName, 13155 completeStatusSetting="Finished", endTimeVariable=etls_endTime, 13156 startTimeVariable=etls_startTime, waitType=_ALL_, signoff=1, 13157 returnCodeVariable=etls_jobRC, 13158 statusUnknownReturnCode=.); 13159 13160 %end; 13161 13162 proc datasets lib = work nolist nowarn memtype = (data view); 13163 delete W6O7ZETU; 13164 quit; 13165 13166 %mend etls_loopW6O7ZETH; 13167 13168 %etls_loopW6O7ZETH; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ NOTE: Creating status table... SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_LOOPW6O7ZETH): data work.W68XKUM2 (keep = etls_handleName etls_machineId etls_startTime etls_endTime etls_status etls_jobRC DTFIM ); MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_handleName length = $32 label = 'Name of handle to remote session'; MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_machineId length = $32 label = 'Name of machine executing the task'; MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_startTime length = 8 format = nldatmap. label = 'Start time of task'; MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_endTime length = 8 format = nldatmap. label = 'End time of task'; MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_status length = $32 label = 'Current status of task'; MPRINT(ETLS_LOOPW6O7ZETH): attrib etls_jobRC length = 8 label = 'Return code of task'; SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W68XKUHP MPRINT(ETLS_LOOPW6O7ZETH): set work.W68XKUHP; MPRINT(ETLS_LOOPW6O7ZETH): run; 370 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: Variable etls_handleName is uninitialized. NOTE: Variable etls_machineId is uninitialized. NOTE: Variable etls_startTime is uninitialized. NOTE: Variable etls_endTime is uninitialized. NOTE: Variable etls_status is uninitialized. NOTE: Variable etls_jobRC is uninitialized. NOTE: There were 1 observations read from the data set WORK.W68XKUHP. NOTE: The data set WORK.W68XKUM2 has 1 observations and 7 variables. NOTE: Compressing data set WORK.W68XKUM2 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.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 319k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 2 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETH): ; NOTE: Creating parameter table... MPRINT(ETLS_LOOPW6O7ZETH): proc sql; SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZETU SYMBOLGEN: Macro variable ETLS_CONTROLTABLE resolves to work.W68XKUHP MPRINT(ETLS_LOOPW6O7ZETH): create table work.W6O7ZETU as select DTFIM as DataParam from work.W68XKUHP; NOTE: Compression was disabled for data set WORK.W6O7ZETU because compression overhead would increase the size of the data set. NOTE: Table WORK.W6O7ZETU created, with 1 rows and 1 columns. MPRINT(ETLS_LOOPW6O7ZETH): quit; 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 273k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 371 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETH): ; MPRINT(ETLS_LOOPW6O7ZETH): proc sql noprint; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_LOOPW6O7ZETH): select count(*) into :L80__max from work.W68XKUM2; SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 MPRINT(ETLS_LOOPW6O7ZETH): quit; 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 226k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_LOOPW6O7ZETH): ; MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsv MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsv")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_LOOPW6O7ZETH): ; SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 NOTE: SAS Grid Manager is not licensed. SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ 372 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable L80_ resolves to 0 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W68XKUM2 where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZETH): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 0 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 0 SYMBOLGEN: Macro variable DIR_PRJ_LOG resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 1 SYMBOLGEN: Macro variable ETLS_ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable ETLS_SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable HANDLEPREFIX resolves to L80_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable SIGNON resolves to 1 373 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L80_1 SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 MPRINT(ETLS_TSLEVEL): data _null_; SYMBOLGEN: Macro variable MACRONAME resolves to etls_gridInstalled SYMBOLGEN: Macro variable FEATURENAME resolves to uwugrdsvc MPRINT(ETLS_TSLEVEL): call symput("etls_gridInstalled",tslvl("uwugrdsvc")); MPRINT(ETLS_TSLEVEL): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 330k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable USEGRID resolves to 1 SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable GRIDRC resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable GRIDRC resolves to L80_1RC SYMBOLGEN: Macro variable WORKLOADMACROVARIABLE resolves to SYMBOLGEN: Macro variable GRIDRC resolves to L80_1RC SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable WORKLOAD resolves to NOTE: SAS Grid Manager is not licensed. NOTE: Grid server not found; the local machine will be used. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus MPRINT(ETLS_SIGNON): data _null_; SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable LOG resolves to SYMBOLGEN: Macro variable OUTPUT resolves to SYMBOLGEN: Macro variable ADDITIONALSIGNONOPTIONS resolves to MPRINT(ETLS_SIGNON): signon cmacvar=etls_signonStatus ; NOTE: Remote signon to L80_1 commencing (SAS Release 9.01.01M3P020206). NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to BES ANGOLA - BIA SERVER, Site 0085062005. NOTE: This session is executing on the HP-UX B.11.31 platform. NOTE: Running on HP Model ia64 Serial Number 2925976628. NOTE: (E9BX01) SAS 9.1.3 SP 4 You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.09 seconds cpu time 0.07 seconds NOTE: AUTOEXEC processing beginning; file is /opt/sasdata/DSV/me/prj/besa/cfg/autoexec_batch.sas. NOTE: Libref MACROS was successfully assigned as follows: Engine: V9 Physical Name: /opt/sasdata/DSV/me/prj/besa/mcr SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable ANOMES resolves to 201511 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable DATA resolves to 20151130 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable MES resolves to 11 SYMBOLGEN: Macro variable DIA resolves to 30 SYMBOLGEN: Macro variable MESSTR resolves to NOV SYMBOLGEN: Macro variable ANO resolves to 2015 SYMBOLGEN: Macro variable SYSPARM resolves to 20151130 /opt/sasdata/work/SAS_workE7070000012D_sxbasasd NOTE: Libref WEB was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref WEBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref ODSBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref GLBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref CTBBESA was successfully assigned as follows: Engine: ORACLE Physical Name: DWCPD1 NOTE: Libref MACGI_DW was successfully assigned as follows: Engine: ORACLE Physical Name: IDWD1 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 SYMBOLGEN: Macro variable MT_DATACARREG resolves to 1764460800 NOTE: The PROCEDURE SQL printed page 1. NOTE: PROCEDURE SQL used (Total process time): real time 0.14 seconds user cpu time 0.05 seconds system cpu time 0.02 seconds Memory 362k Page Faults 0 Page Reclaims 49 Page Swaps 0 Voluntary Context Switches 95 Involuntary Context Switches 2 Block Input Operations 0 Block Output Operations 0 /opt/sasdata/work/SAS_workE7070000012D_sxbasasd NOTE: AUTOEXEC processing completed. NOTE: Remote signon to L80_1 complete. MPRINT(ETLS_SIGNON): run; NOTE: DATA statement used (Total process time): real time 1.05 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds Memory 223k Page Faults 0 Page Reclaims 13 374 The SAS System 12:24 Tuesday, January 12, 2016 Page Swaps 0 Voluntary Context Switches 27 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_GRIDINSTALLED resolves to 9.01 TS1M3 SYMBOLGEN: Macro variable MACHINEIDMACROVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 NOTE: Connection is not grid enabled;the request did not return a value. SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable TRYCOUNT resolves to 1 SYMBOLGEN: Macro variable SIGNONRETRIES resolves to 3 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_SIGNON): ; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_CREATEHANDLE): data work.W68XKUM2; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_CREATEHANDLE): retain ptr 1; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_CREATEHANDLE): modify work.W68XKUM2 point = ptr; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable REMOTESESSIONID resolves to L80_1 MPRINT(ETLS_CREATEHANDLE): etls_handleName = "L80_1"; SYMBOLGEN: Macro variable SIGNON resolves to 1 SYMBOLGEN: Macro variable MACHINEVARIABLE resolves to etls_machineId SYMBOLGEN: Macro variable ETLS_MACHINEID resolves to MPRINT(ETLS_CREATEHANDLE): etls_machineId = ""; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable CMACVAR resolves to etls_signonStatus SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_CREATEHANDLE): etls_status = "Running"; SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime MPRINT(ETLS_CREATEHANDLE): etls_startTime = datetime(); MPRINT(ETLS_CREATEHANDLE): replace; MPRINT(ETLS_CREATEHANDLE): stop; MPRINT(ETLS_CREATEHANDLE): run; NOTE: The data set WORK.W68XKUM2 has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds 375 The SAS System 12:24 Tuesday, January 12, 2016 Memory 309k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_CREATEHANDLE): ; MPRINT(ETLS_LOOPW6O7ZETH): ; SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_GETPROCESSESRUNNING): proc sql noprint; SYMBOLGEN: Macro variable PROCESSCOUNTMACRO resolves to etls_processesRunning SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Running" MPRINT(ETLS_GETPROCESSESRUNNING): select count(*) into: etls_processesRunning from work.W68XKUM2 where etls_status = "Running"; MPRINT(ETLS_GETPROCESSESRUNNING): quit; 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 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPROCESSESRUNNING): ; MPRINT(ETLS_LOOPW6O7ZETH): ; SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_SIGNONSTATUS resolves to 0 SYMBOLGEN: Macro variable ETLS_PARAMETERTABLE resolves to work.W6O7ZETU SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 376 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable RC resolves to 0 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable ETLS_VARNUM resolves to 1 SYMBOLGEN: Macro variable ETLS_DSID resolves to 1 SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETU SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 MPRINT(ETLS_GETPARAMETERS): data _null_; MPRINT(ETLS_GETPARAMETERS): length vname $256 vtype $1 value $3200; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETU MPRINT(ETLS_GETPARAMETERS): dsid = open("work.W6O7ZETU"); MPRINT(ETLS_GETPARAMETERS): if (dsid > 0) then do; SYMBOLGEN: Macro variable ROW resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i = 1 to 1; MPRINT(ETLS_GETPARAMETERS): fetchrc = fetch(dsid); MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable STARTINGCOLUMNNUMBER resolves to 1 MPRINT(ETLS_GETPARAMETERS): do _i=1 to attrn(dsid,'nvars'); MPRINT(ETLS_GETPARAMETERS): vname = varname(dsid,_i); MPRINT(ETLS_GETPARAMETERS): vtype = vartype(dsid,_i); MPRINT(ETLS_GETPARAMETERS): if (fetchrc = 0) then do; MPRINT(ETLS_GETPARAMETERS): if (vtype = 'C') then do; MPRINT(ETLS_GETPARAMETERS): value = getvarc(dsid,_i); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"%","%%"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,"(","%("); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,")","%)"); MPRINT(ETLS_GETPARAMETERS): value = tranwrd(value,'"','%"'); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else value = left(put(getvarn(dsid,_i),best32.)); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): put ; MPRINT(ETLS_GETPARAMETERS): if indexc(trimn(value),"+-*/<>=^~;, '()&%",'"')>0 then do; MPRINT(ETLS_GETPARAMETERS): value='%str('||trim(value)||')'; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Special characters encountered; References may require: %UNQUOTE(&" vname+(-1)').'; MPRINT(ETLS_GETPARAMETERS): end; SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 MPRINT(ETLS_GETPARAMETERS): value = '%syslput '||trim(vname)||'= '||trim(value)||" / remote = L80_1;"; MPRINT(ETLS_GETPARAMETERS): put "NOTE: Setting macro variable " vname "with statement:" value ; MPRINT(ETLS_GETPARAMETERS): call execute(value); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): dsid = close(dsid); MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): else do; SYMBOLGEN: Macro variable PARAMETERTABLE resolves to work.W6O7ZETU MPRINT(ETLS_GETPARAMETERS): put "ERROR" ": Parameter table, work.W6O7ZETU, could not be opened."; MPRINT(ETLS_GETPARAMETERS): abort; MPRINT(ETLS_GETPARAMETERS): end; MPRINT(ETLS_GETPARAMETERS): stop; MPRINT(ETLS_GETPARAMETERS): run; NOTE: Setting macro variable DataParam with statement:%syslput DataParam= 1764460800 / remote = L80_1; 377 The SAS System 12:24 Tuesday, January 12, 2016 NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 434k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated. SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_GETPARAMETERS): ; MPRINT(ETLS_PROCESSTOLOOPW6O7ZETR): ; SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to SYMBOLGEN: Macro variable ETLS_PREVIOUSFILEPREFIX resolves to SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable ROW resolves to 1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L80_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L80_1 SYMBOLGEN: Macro variable ETLS_LOGOUTPUTPATH resolves to /opt/sasdata/DSV/me/prj/besa/log SYMBOLGEN: Macro variable ETLS_FILEPREFIX resolves to L80_1 MPRINT(ETLS_PROCESSTOLOOPW6O7ZETR): rsubmit wait = no sysrputsync = yes persist = no log = "/opt/sasdata/DSV/me/prj/besa/log/L80_1.log" output = "/opt/sasdata/DSV/me/prj/besa/log/L80_1.lst" ; 374 The SAS System 12:30 Tuesday, January 12, 2016 NOTE: Background remote submit to L80_1 in progress. SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_PROCESSESRUNNING resolves to 1 SYMBOLGEN: Macro variable ETLS_MAXPROCESSES resolves to 8 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W68XKUM2 where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 387 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select etls_handleName into :etlsHandles1 - :etlsHandles1 from work.W68XKUM2 where etls_status = "Running"; MPRINT(ETLS_WAITFOR): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 241k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable WAITTYPE resolves to _ANY_ SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 NOTE: Remote signoff from L80_1 commencing. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1.87 seconds user cpu time 0.38 seconds system cpu time 0.20 seconds Memory 12727k Page Faults 11 Page Reclaims 733 Page Swaps 0 Voluntary Context Switches 365 Involuntary Context Switches 36 Block Input Operations 1 Block Output Operations 33 NOTE: Remote signoff from L80_1 complete. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 1 SYMBOLGEN: Macro variable USEDEFAULTRCMACVAR resolves to Y SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 NOTE: There are no active tasks/transactions. MPRINT(ETLS_WAITFOR): waitfor L80_1 timeout=1; SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable SYSRC resolves to -2 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 SYMBOLGEN: Macro variable COMPLETESTATUSSETTING resolves to "Finished" SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC 388 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL80_1 SYMBOLGEN: Macro variable STATUSUNKNOWNRETURNCODE resolves to . SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL80_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL80_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_rcMacroVarExisted from dictionary.macros where name=upcase("job_rcL80_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_RCMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable SETMAINJOBRC resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL80_1 SYMBOLGEN: Macro variable JOB_RCL80_1 resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L80_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L80_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_startTimeMacroVarExisted from dictionary.macros where name=upcase("etls_startTime_L80_1"); MPRINT(ETLS_FREEHANDLE): quit; 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 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 389 The SAS System 12:24 Tuesday, January 12, 2016 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_STARTTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L80_1 MPRINT(ETLS_FREEHANDLE): proc sql noprint; SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L80_1 MPRINT(ETLS_FREEHANDLE): select '1' into: etls_endTimeMacroVarExisted from dictionary.macros where name=upcase("etls_endTime_L80_1"); MPRINT(ETLS_FREEHANDLE): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 216k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ETLS_ENDTIMEMACROVAREXISTED resolves to 1 SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_FREEHANDLE): data work.W68XKUM2; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName SYMBOLGEN: Macro variable HANDLENAME resolves to "L80_1" MPRINT(ETLS_FREEHANDLE): modify work.W68XKUM2(where=(etls_handleName = "L80_1")); SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L80_1 SYMBOLGEN: Macro variable STARTTIMEVARIABLE resolves to etls_startTime SYMBOLGEN: Macro variable STARTTIMEMACROVARIABLE resolves to etls_startTime_L80_1 MPRINT(ETLS_FREEHANDLE): etls_startTime = input(symget("etls_startTime_L80_1"),32.); MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L80_1 SYMBOLGEN: Macro variable ENDTIMEVARIABLE resolves to etls_endTime SYMBOLGEN: Macro variable ENDTIMEMACROVARIABLE resolves to etls_endTime_L80_1 MPRINT(ETLS_FREEHANDLE): etls_endTime = input(symget("etls_endTime_L80_1"),32.); MPRINT(ETLS_FREEHANDLE): ; MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC 390 The SAS System 12:24 Tuesday, January 12, 2016 SYMBOLGEN: Macro variable RETURNCODEVARIABLE resolves to etls_jobRC SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to job_rcL80_1 MPRINT(ETLS_FREEHANDLE): etls_jobRC = input(symget("job_rcL80_1"),32.); SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status MPRINT(ETLS_FREEHANDLE): if (symget("etls_rcMacroVarExisted") eq "0") then etls_status = "Unknown Status"; SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable STATUSSETTING resolves to "Finished" MPRINT(ETLS_FREEHANDLE): else etls_status = "Finished"; SYMBOLGEN: Macro variable HANDLEVARIABLE resolves to etls_handleName MPRINT(ETLS_FREEHANDLE): call symput('handle',etls_handleName); MPRINT(ETLS_FREEHANDLE): replace; MPRINT(ETLS_FREEHANDLE): stop; MPRINT(ETLS_FREEHANDLE): run; NOTE: There were 1 observations read from the data set WORK.W68XKUM2. WHERE etls_handleName='L80_1'; NOTE: The data set WORK.W68XKUM2 has been updated. There were 1 observations rewritten, 0 observations added and 0 observations deleted. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 651k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SYSERR resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_FREEHANDLE): ; SYMBOLGEN: Macro variable SIGNOFF resolves to 1 SYMBOLGEN: Macro variable HANDLE resolves to L80_1 NOTE: Testing connection with etls_serverConnected macro (mprint off). MPRINT(ETLS_SIGNOFF): options nomprint; SYMBOLGEN: Macro variable HANDLENAME resolves to L80_1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SYSSCP resolves to HP IPF NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 8k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 391 The SAS System 12:24 Tuesday, January 12, 2016 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SEARCH_STR resolves to -------------- SYMBOLGEN: Macro variable TOKEN resolves to 1 SYMBOLGEN: Macro variable MACVARNAME resolves to isConnected SYMBOLGEN: Macro variable SAVENOTES resolves to NOTES SYMBOLGEN: Macro variable SAVEMPRINT resolves to MPRINT SYMBOLGEN: Macro variable ISCONNECTED resolves to 0 MPRINT(ETLS_SIGNOFF): ; MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable ETLSHANDLES1 resolves to L80_1 NOTE: Process L80_1 has completed. MPRINT(ETLS_LOOPW6O7ZETH): ; SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80_ resolves to 1 SYMBOLGEN: && resolves to &. SYMBOLGEN: Macro variable ETLS_CONTROLNAME resolves to L80_ SYMBOLGEN: Macro variable L80__MAX resolves to 1 SYMBOLGEN: Macro variable ETLS_STATUSTABLE resolves to work.W68XKUM2 MPRINT(ETLS_WAITFOR): proc sql noprint; SYMBOLGEN: Macro variable STATUSTABLE resolves to work.W68XKUM2 SYMBOLGEN: Macro variable STATUSVARIABLE resolves to etls_status SYMBOLGEN: Macro variable RUNNINGSTATUSSETTING resolves to "Running" MPRINT(ETLS_WAITFOR): select count(*) into :etls_rows from work.W68XKUM2 where etls_status = "Running"; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_WAITFOR): quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds Memory 227k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 SYMBOLGEN: Macro variable SQLRC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable TRANS_RC resolves to 0 SYMBOLGEN: Macro variable ERROR resolves to 0 SYMBOLGEN: Macro variable JOB_RC resolves to 0 MPRINT(ETLS_WAITFOR): ; SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 SYMBOLGEN: Macro variable RETURNCODEMACROVARIABLE resolves to SYMBOLGEN: Macro variable ETLS_ROWS resolves to 0 MPRINT(ETLS_LOOPW6O7ZETH): ; MPRINT(ETLS_LOOPW6O7ZETH): proc datasets lib = work nolist nowarn memtype = (data view); MPRINT(ETLS_LOOPW6O7ZETH): delete W6O7ZETU; 392 The SAS System 12:24 Tuesday, January 12, 2016 MPRINT(ETLS_LOOPW6O7ZETH): quit; NOTE: Deleting WORK.W6O7ZETU (memtype=DATA). NOTE: PROCEDURE DATASETS used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds Memory 60k Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 13169 13170 /*============================================================================* 13171 * Step: Loop End A50D7W6R.B6001AAT * 13172 * Transform: Loop End * 13173 * Description: * 13174 *============================================================================*/ 13175 ERROR: Errors printed on pages 223,229. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 5:32.00 user cpu time 1.12 seconds system cpu time 0.56 seconds Memory 6575k Page Faults 285 Page Reclaims 2254 Page Swaps 0 Voluntary Context Switches 7284 Involuntary Context Switches 106 Block Input Operations 12 Block Output Operations 35