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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 15 replies
  • 4865 views
  • 0 likes
  • 6 in conversation