BookmarkSubscribeRSS Feed
teja04
Calcite | Level 5
Hi All,
I have two datasets (AAA, BBB). In dataset AAA has variables (AA, BB, CC, DD, EE, FF, P1, P2, P3, P4...P30).
In dataset BBB has variables ( AA, BB, CC, DD, EE, FF, (VALUE). I want to read the dataset by using variable.
Example: if dataset has variable (P1) then read dataset AAA, else if dataset has variable (VALUE) then read dataset BBB.
2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

What do you mean by 'read the data set'? And what if the variable has the value AA?

PaigeMiller
Diamond | Level 26

If I am understanding you properly:

 

Use PROC CONTENTS to determine which variable names are in the data set. Then you can determine which path to follow and which data set to read.

--
Paige Miller

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

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