BookmarkSubscribeRSS Feed
YB1
Calcite | Level 5 YB1
Calcite | Level 5

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;

6 REPLIES 6
Reeza
Super User

Ok. How does it fail?

Post your code and log. 

ballardw
Super User

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?

YB1
Calcite | Level 5 YB1
Calcite | Level 5
/* 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. -##


Reeza
Super User

You still haven't told us what's not working.

Shmuel
Garnet | Level 18

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.

PGStats
Opal | Level 21

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.

PG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1475 views
  • 0 likes
  • 5 in conversation