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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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