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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1023 views
  • 0 likes
  • 3 in conversation