BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
data hhs.hhs_combine_all(compress=yes);
set hhs.hhs_combine_all HHS_all;
description=upcase(description);
physician_name=upcase(physician_name);
ADDRESS_1=upcase(ADDRESS_1);
run;

How to load the above program to hhs.hhs_combine_all only one time.
I.e to avoid loading multiple times.
7 REPLIES 7
Peter_C
Rhodochrosite | Level 12
run it once and it is run.
What runs it more than once?
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
From my perspective, the question is unclear, however from the SET statement, it appears that there is a file to be replaced by adding new observations to that same file. But of course, the first time the file that is named in both the DATA and SET statement will not exist. Maybe this is the question?

If true, the SAS OPTIONS NODSNFERR; can be set. And if you have a BY statement to order the observations, you will also need to set NOVNFERR and NOBYERR, as well.

Scott Barry
SBBWorks, Inc.
Peter_C
Rhodochrosite | Level 12
should it be proc append?
Flip
Fluorite | Level 6
No he is just UPCASING 3 variables. I have no idea what he is asking.
SASPhile
Quartz | Level 8
This part of the code is the middle portion of a macro.There are situations,when I had to make changes to the code above or below this data step and so had to run the whole code again.in those situations hhs_all gets appended again resulting in duplicate values.
abdullala
Calcite | Level 5
I dont know there is any way your code will work for that purpose. you will need to control when to append the other dataset.
approach 1: do all you need to do to the base dataset, and only append at the very end after all the repeating work are completed.
approach 2: use different dataset name after appending so the original does not get overwritten by appending.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Also, you might receive more useful replies and assistance when you share the entire code piece and not just a convenient snippet.

Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 7 replies
  • 1678 views
  • 0 likes
  • 5 in conversation