BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Amy0223
Quartz | Level 8

Hi community, I'm not sure how to answer this question. It appears nothing is wrong but I'd like to hear your advice. Your help is much appreciated!

 

What, if anything, is wrong with the following programs? 

data p1; set mast;
if sector='a4' then output;

data p2; set me;
if sector=29 then output;

data sects;
merge p1 p2;
by sector;
proc print noobs;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

The program might run.  But if SECTOR is really character in one dataset and numeric in the other then the data step with the MERGE statement will fail.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

The program might run.  But if SECTOR is really character in one dataset and numeric in the other then the data step with the MERGE statement will fail.

Amy0223
Quartz | Level 8
Thank you so much! I really appreciate your advice!
Reeza
Super User

Can you please start using subject lines that are more reflective of your question?

I think you have about 4 questions all with the same/similar vague subject line of 'anything wrong with this program'. 

 

And please mark the questions as solved when they are, identifying the correct solution for future users.

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!

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
  • 3 replies
  • 721 views
  • 2 likes
  • 3 in conversation