Thanks i changed the quit to be outside of the loop. . The %PUT at the else just informs of a an empty controlcell dataset. I indicate below where the macro is invoked. when i run this it is not resolving the test and control macro variables. How do I get those to resolve?
error messages:
WARNING: Apparent symbolic reference TEST not resolved.
SYMBOLGEN: Macro variable I resolves to 18
WARNING: Apparent symbolic reference CONTROL not resolved.
SYMBOLGEN: Macro variable I resolves to 18
MPRINT(CNTLCELLENTRYTEST): execute(INSERT INTO p_wae_u_work_05.CHD_TEST_X_CONTROL_test (cell_ky, comparison_ky, as_of_dt,
insrt_dt_tm) SELECT &test.18, &control.18, as_of_dt, CAST(CURRENT_TIMESTAMP(0) AS TIMESTAMP(0)) FROM (SELECT AS_OF_DT FROM
CORE_V2.WAE_CALENDAR WHERE MO_AGO = 0) dtl) by eiwp;
code:
%macro cntlcellentrytest;
%put &=controlcellobs.;
%if &controlcellobs > 0 %then
%do;
%put "here in do";
proc sql;
select test, control into :test1 -, :control1 - from work.controlcell;
connect to teradata as eiwp (username=&a. password=&b. tdpid=&EIWP_TDPID. mode=teradata fastload=yes);
* select test, control into :test1 -, :control1 - from work.controlcell;
%put _global_;
%do i=1 %to &controlcellobs;
execute(INSERT INTO p_wae_u_work_05.CHD_TEST_X_CONTROL_test
(cell_ky, comparison_ky, as_of_dt, insrt_dt_tm)
SELECT
&test.&i,
&control.&i,
as_of_dt,
CAST(CURRENT_TIMESTAMP(0) AS TIMESTAMP(0))
FROM
(SELECT AS_OF_DT
FROM WAE_D_CORE_V2.WAE_CALENDAR
WHERE MO_AGO = 0) etl) by eiwp;
%end;
quit;
%end;
%else;
%put 'No entries in control cells';
%mend cntlcellentrytest;
%cntlcellentrytest; ****here is where the macro is invoked
... View more