NOTE: Active Session now server. NOTE: Added action set 'modelPublishing'. NOTE: Added action set 'ds2'. NOTE: Added action set 'table'. NOTE: Running DATA program on one node NOTE: Execution succeeded. One row affected. NOTE: Running 'modelPublishing' action set with 3 workers. NOTE: Creating new model table 'TempModel_D71F899D-2DA7-1C47-8ED6-57C796E5303C'. NOTE: Model 'TempModel_D71F899D-2DA7-1C47-8ED6-57C796E5303C' has been successfully published to model table 'TempModel_D71F899D-2DA7-1C47-8ED6-57C796E5303C'. 1 2 ds2_options scond=none; 3 /* Custom Object Code_file_1 retrieved on Tue Apr 18 19:55:50 PET 2023 */ 4 ds2_options sas; 5 package "Decision_Python_Code_file_1_1_0" / inline; 6 dcl package pymas py; 7 dcl double pystop; 8 dcl package logger logr('App.tk.MAS'); 9 10 method execute( 11 double Bid 12 , varchar(100) state 13 , in_out varchar bidCommand 14 ); 15 16 dcl nvarchar(10485760) pypgm; 17 dcl double rc; 18 dcl double revision; 19 if null(py) and pystop ^= 1 then do; 20 py = _new_ pymas(); 21 if inmas() then do; 22 rc = py.useModule('"Decision_Python_Code_file_1_1_0_823265343"', 1); 23 end; 24 else do; 25 rc = 1; 26 end; 27 if rc then do; 28 rc = py.appendSrcLine('#/*{"signatureExtension":[{"name":"Bid","description":"","length":null,"defaultValue":null,"dataType":"boolean","direction":"input"},{"name":"state","description":"","length":"2","defaultValue":null,"dataType":"string","direction":"input"},{"name":"bidCommand","description":"","length":null,"defaultValue":null,"dataType":"string","direction":"output"}]}*/'); 29 rc = py.appendSrcLine(''''''' List all output parameters as comma-separated values in the "Output:" docString. Do not specify "None" if there is no output parameter. '''''''); 30 rc = py.appendSrcLine(''); 31 rc = py.appendSrcLine('def execute(Bid,state):'); 32 rc = py.appendSrcLine(' ''Output: bidCommand'''); 33 rc = py.appendSrcLine(' if Bid == 0:'); 34 rc = py.appendSrcLine(' bidCommand = ''Do NOT bid on this car!!!'''); 35 rc = py.appendSrcLine(' else:'); 36 rc = py.appendSrcLine(' bidCommand = ''Bid on this car!!!'''); 37 rc = py.appendSrcLine(' if state == ''CA'':'); 38 rc = py.appendSrcLine(' bidCommand = ''Buy anything from California!'''); 39 rc = py.appendSrcLine(' return bidCommand'); 40 pypgm = py.getSource(); 41 revision = py.publish(pypgm, '"Decision_Python_Code_file_1_1_0_823265343"'); 42 if revision < 1 then do; 43 pystop = 1; 44 logr.log( 'e', 'publish revision=$s', revision ); 45 return; 46 end; 47 end; 48 else do; 49 logr.log( 'e', 'useModule rc=$s', rc ); 50 end; 51 rc = py.useMethod('execute'); 52 if rc then do; 53 pystop = 1; 54 logr.log( 'e', 'useMethod rc=$s', rc ); 55 return; 56 end; 57 end; 58 if pystop ^= 1 then do; 59 rc = py.setBool ('Bid', Bid); 60 if rc then do; 61 logr.log( 'e', 'set Bid rc=$s', rc ); 62 return; 63 end; 64 rc = py.setString ('state', state); 65 if rc then do; 66 logr.log( 'e', 'set state rc=$s', rc ); 67 return; 68 end; 69 rc = py.execute(); 70 logr.log( 'd', 'execute rc=$s', rc ); 71 bidCommand = py.getString('bidCommand'); 72 end; 73 end; 74 endpackage; 75 76 ds2_options scond=none; 77 78 /* Decision Decision_Python version 1.0 generated on Tue Apr 18 19:55:50 PET 2023 */ 79 package Decision_1a6d112b_553c_4011_90e / inline; 80 dcl package logger logr_perf('App.tk.SID.Perf'); 81 dcl double timer_start; 82 dcl double elapsed_time; 83 dcl double total_timer_start; 84 dcl double total_elapsed_time; 85 86 dcl package "Decision_Python_Code_file_1_1_0" "Decision_Python_Code_file_1_1_0_hdl"(); 87 88 method initRuleFiredRecording(); 89 dcl integer ruleFiredStartPosition; 90 91 /* query and set offsets - always traverse in same order as execute() method */ 92 ruleFiredStartPosition = 1; 93 end; 94 95 method init(); 96 initRuleFiredRecording(); 97 end; 98 99 method execute ( 100 double "Bid" 101 ,varchar(100) "state" 102 ,in_out varchar "bidCommand" 103 ,in_out varchar "PathID" 104 ,in_out char "ruleFiredFlags" 105 ,in_out integer "rulesFiredForRecordCount" 106 ,in_out integer "_filter_" 107 108 ); 109 dcl integer dg_filter_; 110 111 total_timer_start = datetime(); 112 113 timer_start = datetime(); 114 "Decision_Python_Code_file_1_1_0_hdl".execute("Bid", "state", "bidCommand"); 115 elapsed_time = datetime() - timer_start; 116 logr_perf.log( 'd', 'Package Name: Decision_1a6d112b_553c_4011_90e, Node Name: Code_file_1, Node ID: 31af9369-6d1c-4506-8fd3-a6503cac9310, NODE DURATION: ' .. elapsed_time); 117 "PathID" = "PathID" || '/' || '31af9369-6d1c-4506-8fd3-a6503cac9310'; 118 119 "end":/*label for decision node link to flow end*/ 120 121 total_elapsed_time = datetime() - total_timer_start; 122 logr_perf.log( 'd', 'Package Name: Decision_1a6d112b_553c_4011_90e, TOTAL DURATION: ' .. total_elapsed_time); 123 124 end; 125 126 endpackage; 127 ds2_options scond=none; 128 thread decisionFlowThread / inline; 129 dcl package Decision_1a6d112b_553c_4011_90e decisionPackage(); 130 dcl varchar(38) "PathID"; 131 dcl char(1) "ruleFiredFlags"; 132 dcl integer "rulesFiredForRecordCount" having label 'Rules Fired Count'; 133 dcl char(36) "_recordCorrelationKey"; 134 135 dcl integer "_filter_"; 136 /* declare input terms not read in from SET statement */ 137 138 dcl double "Bid"; 139 dcl double "Bid"; 140 dcl varchar(100) "state"; 141 dcl varchar(100) "state"; 142 143 /* declare output terms not read in from SET statement */ 144 dcl varchar(100) "bidCommand"; 145 146 /*declare static terms */ 147 dcl double "Bid"; 148 dcl varchar(100) "state"; 149 150 keep 151 152 "PathID" "ruleFiredFlags" "rulesFiredForRecordCount" "_recordCorrelationKey" 153 "bidCommand" 154 ; 155 156 method resetruleFiredCounts( in_out char "ruleFiredFlags", in_out integer "rulesfiredforrecordcount"); 157 "rulesfiredforrecordcount"=0; 158 end; 159 160 method init(); 161 decisionPackage.initRuleFiredRecording(); 162 end; 163 164 method run(); 165 dcl integer localRC; 166 167 set "CASUSER(BT22939)"."Scenario_95ec0693_7b08_4717_a578_aad809d7e457"( 168 ); 169 170 "Bid" = 0; 171 "state" = 'CA'; 172 173 "PathID" = ''; 174 175 resetruleFiredCounts("ruleFiredFlags", "rulesfiredforrecordcount"); 176 177 "_filter_" = 1; 178 179 decisionPackage.execute( 180 "Bid" 181 ,"state" 182 ,"bidCommand" 183 ,"PathID" 184 ,"ruleFiredFlags", "rulesFiredForRecordCount" 185 186 ,"_filter_" 187 ); 188 189 if "_filter_"; 190 191 "_recordCorrelationKey" = uuidgen(); 192 193 /* Expectation check for: "bidCommand" */ 194 if missing("bidCommand") or "bidCommand" ^= 'Buy anything from California!' then 195 put 'WARNING: EXPECTATIONS: The value of "bidCommand" does not match its expectation.'; 196 197 output; 198 end; 199 endthread; 200 201 ds2_options scond=none; 202 203 data "caslib_sasdata36_t22939"."d_Decision_Python_2023-04-19_00-55-50_output"( 204 overwrite=yes); 205 206 dcl thread decisionFlowThread t; 207 208 method run(); 209 set from t threads=4; 210 output "caslib_sasdata36_t22939"."d_Decision_Python_2023-04-19_00-55-50_output"; 211 end; WARNING: EXPECTATIONS: The value of "bidCommand" does not match its expectation. NOTE: Running THREAD program on all nodes NOTE: Running DATA program on all nodes ERROR: Line 41: ERROR: Python launch _pyConnect Failure. Matplotlib created a temporary config/cache directory at /tmp/matplotlib-ssj5q88c because the default path (/viyatmp/python) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing. . ERROR: Line 41: ERROR: tkmaspyPublish encountered a failure in tkmaspyConnect, rc=0x803FC009. ERROR: Line 41: Error reported by DS2 package pymas: ERROR: Line 41: DS2 "pymas" package encountered a failure in the 'publish' method. NOTE: Execution succeeded. One row affected. NOTE: Running 'modelPublishing' action set with 3 workers. NOTE: Execution of model 'TempModel_D71F899D-2DA7-1C47-8ED6-57C796E5303C' succeeded. NOTE: Cloud Analytic Services promoted table D_DECISION_PYTHON_2023-04-19_00-55-50_OUTPUT in caslib caslib_sasdata36_t22939 to table d_Decision_Python_2023-04-19_00-55-50_output in caslib caslib_sasdata36_t22939. NOTE: Cloud Analytic Services dropped table TempModel_D71F899D-2DA7-1C47-8ED6-57C796E5303C from caslib caslib_sasdata36_t22939.