BookmarkSubscribeRSS Feed
G_I_Jeff
Obsidian | Level 7

Creating 1 pdb from multiple:

DATA  PDB1;

SET PDBA

SET PDBB

SET PDBC

SET PDBD

SET PDBE;

Is there a way to create and set a single variable with a value to distinguish each SET pdb?

PDB=A for all observations from PDBA, so on and so on.....

Jeff

3 REPLIES 3
ballardw
Super User

Do you mean:

SET PDBA;

SET PDBB;

SET PDBC;

SET PDBD;

SET PDBE;

or

SET PDBA

      PDBB

      PDBC

      PDBD

      PDBE;

As written I would expect error messages about not finding the dataset SET.

UrvishShah
Fluorite | Level 6

Hi,

If you are going to append the data by using single SET statement, than you can use IN = option to identify the observations...But make sure that you are appending not one - to - one reading by using multiple SET statemsnts...

data test;

   set pdbA(in = a)

        pdbB(in = b)

        pdbC(in = c)

        .....and so on;

    if a then pdb = "A";

    if b then pdb = "B";

    if c then pdb = "C";

    .....and so on;

run;

Make sure you are going to append the datasets rather than one to one reading (Merging)...

-Urvish

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 602 views
  • 0 likes
  • 4 in conversation