create table work.OUTP2 as
select * , 'BLANK' as Completion_Status,
'BLANK COMPLETION STATUS' as ERROR_MESSAGE
from &_INPUT1 (drop=Completion_Status)
where Completion_status_no=0 ;
quit;
Ok. How does it fail?
Post your code and log.
Other than not seeing a Proc SQL; at the start
what is the value of &_input1? Does it actually match an existing data set?
Does that data set actually have any records where Completion_status_no=0?
/* ADM.HRSC.TRNG.TR.Fully */
%if (&_COST_OBJECT eq ADM.HRSC.TRNG.TR.Fully) %then
%do;
proc sql;
create table &_OUTPUT1 as
select distinct COST_OBJECT,
BUSINESS_LINE_CODE,
BUSINESS_LINE,
NEW_DIER_CODE,
'ADM.HR' as SourceDIER,
'# of Training Classes' as DriverName,
sum(Completion_status_no) as VOLUME,
Location
from &_INPUT1
where Completion_status_no=1
group by
COST_OBJECT,
BUSINESS_LINE_CODE,
BUSINESS_LINE,
NEW_DIER_CODE, Location;
create table work.OUTP2 as
select * , 'BLANK' as Completion_Status,
'BLANK COMPLETION STATUS' as ERROR_MESSAGE
from &_INPUT1 (drop=Completion_Status)
where Completion_status_no=0
quit;
%end;
##- Please type your reply above this line. Simple formatting, no
attachments. -##
You still haven't told us what's not working.
The code is part of a macro program.
The problem could be somewhere else in the macro.
Better show the whole code and the log.
Create global macro variables such as
%let _INPUT1=MYDS;
and test the SQL or DATA steps outside of your macro. You should be able to pinpoint the troublesome step by checking the log. If every step works as intended, then the problem is with macro logic.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.