BookmarkSubscribeRSS Feed
Astounding
PROC Star

A big issue from your program was already mentioned:  with no errors, SQL fails to populate &msg_w.  Here's a tweak that puts you on the road to accommodating that situation.  Your middle DATA step is:

data work.W2JOY0AE0;
set log1 (obs=1);
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;

Change that so it populates &msg_w when there is no error:

data work.W2JOY0AE0;
if done then call symput("msg_w", 'no errors');
set log1 (obs=1) end=done;
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;

Of course you could use any value you would like for &msg_w, but this at least guarantees that &msg_w will exist when you have no errors.  Of course if there is an error, this tweak lets the program run as it did before.

Adjust the logic as you would like from that DATA step forward.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 15 replies
  • 2583 views
  • 0 likes
  • 6 in conversation