NOTE: This session is in interactive mode. 1 /*---- mldmbd03d01_GettingStarted.sas ----*/ 2 3 /*---- Include course macro variable definition file ----*/ 4 /*---- when using SAS Studio in interactive mode. When ----*/ 5 /*---- using SAS Studio in non-interactive mode or SAS ----*/ 6 /*---- Enterprise Guide or the SAS Windowing Environment,----*/ 7 /*---- macro variables will persist, so the definition ----*/ 8 /*---- file need only be run once. ----*/ 9 10 /*---- BEGIN: Macro definitions ----*/ 11 12 %include "D:\workshop\MLDMBD\mldmbd_Macros_SMP.sas"; ====================================== Configuration SASDataFolder=D:\workshop\MLDMBD\Data ScoreFolder=D:\workshop\MLDMBD\output LASRpath=C:\Temp ServerName=SASBAP.demo.sas.com SessionPort=10011 host=SASBAP.demo.sas.com ====================================== NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.01 seconds NOTE: Libref SASLIB was successfully assigned as follows: Engine: V9 Physical Name: D:\workshop\MLDMBD\Data Directory Libref SASLIB Engine V9 Physical Name D:\workshop\MLDMBD\Data Filename D:\workshop\MLDMBD\Data Member # Name Type File Size Last Modified 1 PVA97NK DATA 22MB 02/13/2013 16:02:24 2 PVA97NK_OLD DATA 19MB 03/03/2008 15:06:36 3 P_MODEL_BANK13 DATA 448MB 01/22/2015 14:41:02 4 VALIDSTATS DATA 128KB 09/21/2018 04:23:26 5 VS_BANK DATA 430MB 01/22/2015 14:41:01 6 VS_BANK250K DATA 110MB 11/03/2015 14:43:51 7 VS_BANK500K DATA 219MB 11/03/2015 14:45:31 56 57 /*---- END: Macro definitions ----*/ 58 59 60 61 /*---- Use SASIOLA engine to converse with LASR ----*/ 62 63 libname LASRlib sasiola port=&SessionPort host="&host" tag="&TagString"; NOTE: Libref LASRLIB was successfully assigned as follows: Engine: SASIOLA Physical Name: SAS LASR Analytic Server engine on local host, port 10011 64 65 /*---- Load the Data (one time only for each LASR session) ----*\ 66 data LASRlib.p_model_bank13; 67 set SASlib.p_model_bank13; 68 run; 69 \*----*/ 70 71 /*---- Use IMSTAT to explore the project data ----*/ NOTE: PROCEDURE DATASETS used (Total process time): real time 0.56 seconds cpu time 0.06 seconds 72 proc imstat; 73 /*---- List the tables in the LASR server ----*/ 74 tableinfo / port=&SessionPort; 75 run; 76 /*---- Make model_bank13 the active table ----*/ 77 table LASRlib.p_model_bank13(tag="&TagString"); NOTE: The table LASRLIB.P_MODEL_BANK13 does not exist in the SAS LASR Analytic Server on host 'localhost', port 10011. ERROR: File LASRLIB.P_MODEL_BANK13.DATA does not exist. 78 79 /*---- List the columns in the project table ----*/ 80 columninfo; 81 run; NOTE: Statements are ignored in this RUN block because of parsing errors. 82 /*---- Print 10 rows ----*/ 83 fetch/ from=1 to=10; 84 run; NOTE: You need to assign a LASR Analytic Server table to execute the FETCH statement. Use the DATA= option in the PROC IMSTAT statement or the TABLE statement to assign the table. 85 /*---- Save columnifo table and make it ----*/ 86 /*---- available for later processing. ----*/ 87 columninfo/save=columns; 88 run; NOTE: You need to assign a LASR Analytic Server table to execute the COLUMNINFO statement. Use the DATA= option in the PROC IMSTAT statement or the TABLE statement to assign the table. 89 90 /*---- Create macro variable containg names ----*/ 91 /*---- of the original RFM input variables. ----*/ 92 store columns[1](where="substr(column,1,3)='rfm'",cols=Column)=rfms; 93 run; WARNING: The table columns could not be found. 94 %put &rfms; WARNING: Apparent symbolic reference RFMS not resolved. &rfms 95 96 /*---- The SUMMARY statement is like SAS PROC SUMMARY ----*/ 97 summary &rfms; _ 22 200 WARNING: Apparent symbolic reference RFMS not resolved. ERROR: No data set open to look up variables. ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 98 run; 99 100 /*---- Create macro variable for imputed RFM inputs ----*/ 101 store columns[1](where="substr(column,1,5)='i_rfm'",cols=Column)=i_rfms; 102 run; WARNING: The table columns could not be found. 103 %put &i_rfms; WARNING: Apparent symbolic reference I_RFMS not resolved. &i_rfms 104 105 summary &i_rfms; _ 22 200 WARNING: Apparent symbolic reference I_RFMS not resolved. ERROR: No data set open to look up variables. ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 106 run; 107 108 /*---- Create macro variable for log imputed rfm inputs ----*/ 109 store columns[1](where="substr(column,1,8)='logi_rfm'",cols=Column)=logi_rfms; 110 run; WARNING: The table columns could not be found. 111 %put &logi_rfms; WARNING: Apparent symbolic reference LOGI_RFMS not resolved. &logi_rfms 112 113 summary &logi_rfms; _ 22 200 WARNING: Apparent symbolic reference LOGI_RFMS not resolved. ERROR: No data set open to look up variables. ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 114 run; 115 116 /*---- Create macro variable for demographic inputs ----*/ 117 store columns[1](where="substr(column,1,5)='demog'",cols=Column)=demogs; 118 run; WARNING: The table columns could not be found. 119 %put &demogs; WARNING: Apparent symbolic reference DEMOGS not resolved. &demogs 120 121 /*---- Create macro variable for categorical inputs ----*/ 122 store columns[1](where="column in ('cat_input1' 'cat_input2')",cols=Column)=catvars; 123 run; WARNING: The table columns could not be found. 124 %put &catvars; WARNING: Apparent symbolic reference CATVARS not resolved. &catvars 125 126 /*---- Check cardinality of variables ----*/ 127 distinct account &demogs &catvars b_tgt cnt_tgt _partInd_; _ 22 200 WARNING: Apparent symbolic reference DEMOGS not resolved. WARNING: Apparent symbolic reference CATVARS not resolved. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 128 run; 129 130 summary r_demog: ri_demog: int_tgt; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 131 run; 132 133 /*---- One-way frequencies ----*/ 134 frequency _partind_ b_tgt cnt_tgt &catvars demog_ho demog_genf demog_genm; _ 22 200 ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. WARNING: Apparent symbolic reference CATVARS not resolved. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 135 run; 136 137 /*---- Cross-tabulations ----*/ 138 crosstab _partind_*b_tgt; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 139 crosstab b_tgt*cnt_tgt; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 140 crosstab cat_input1*cat_input2; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 141 run; 142 143 summary cnt_tgt int_tgt/ groupby=b_tgt; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 144 summary cnt_tgt int_tgt/ groupby=_partind_; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 145 run; 146 147 148 /*---- IMSTAT has no graphical output. It produces ----*/ 149 /*---- tables that can be used to create graphs ----*/ 150 /*---- using standard ODS graphics procedures. ----*/ 151 ods trace on; 152 /*---- Histogram tables only allow numeric variables. ----*/ 153 ods output histogram=work.cnt_histogramdata; ERROR: No data set open to look up variables. 154 histogram cnt_tgt/nbins=8; 155 run; 156 157 ods trace off; 158 ods output histogram=work.int_histogramdata; ERROR: No data set open to look up variables. 159 histogram int_tgt/nbins=200; 160 run; 161 162 ods output histogram=work.int_histogramdata; WARNING: Duplicate data set name on ODS OUTPUT statement. Entry will be ignored. ERROR: No data set open to look up variables. 163 histogram int_tgt/nbins=200 noemptybin; 164 run; 165 166 quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE IMSTAT used (Total process time): real time 0.29 seconds cpu time 0.03 seconds WARNING: Output 'histogram' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used. WARNING: Output 'histogram' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used. WARNING: The current ODS SELECT/EXCLUDE/OUTPUT statement was cleared because the end of a procedure step was detected. Probable causes for this include the non-termination of an interactive procedure (type quit; to end the procedure) and a run group with no output. 167 168 169 title1 "Histogram for Count Target Variable"; 170 proc print data=work.cnt_histogramdata; ERROR: File WORK.CNT_HISTOGRAMDATA.DATA does not exist. 171 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 0.19 seconds cpu time 0.01 seconds 172 173 proc sgplot data=work.cnt_histogramdata; ERROR: File WORK.CNT_HISTOGRAMDATA.DATA does not exist. 174 vbar binmid / freq=frequency; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 175 label binmid="Count Target"; 176 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.10 seconds cpu time 0.00 seconds 177 178 title1 "Histogram for Interval Target Variable"; 179 proc print data=work.int_histogramdata; ERROR: File WORK.INT_HISTOGRAMDATA.DATA does not exist. 180 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 181 182 proc sgplot data=work.int_histogramdata; ERROR: File WORK.INT_HISTOGRAMDATA.DATA does not exist. 183 vbar binmid / freq=frequency; ERROR: No data set open to look up variables. ERROR: No data set open to look up variables. 184 label binmid="Interval Target"; 185 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 186 187 title1 ; 188 189