BookmarkSubscribeRSS Feed
advoss
Quartz | Level 8
I have come up with the following code to get the member names into the observations when I concatenate several members. I've looked, and other than using the open and fetch functions, I haven't found a function that I can use. Each member might have over a million rows of data, and I am not in a position to be able to ask that the member name be added to the table.

Thoughts?

Thank you.

DATA ABC;
SET JORDAN.G1INNETDEDG(IN=G1INNETDEDG)
JORDAN.G2INNETDEDG(IN=G2INNETDEDG)
JORDAN.G3INNETDEDG(IN=G3INNETDEDG)
JORDAN.G4INNETDEDG(IN=G4INNETDEDG);
ARRAY XMEMBERS {*} G1INNETDEDG G2INNETDEDG
G3INNETDEDG G4INNETDEDG ;
length whichmem $32;
WHICHMEM = '??';
DO I=1 to dim(Xmembers) while (whichmem = '??');
IF XMEMBERS{i} THEN WHICHMEM = VNAME(XMEMBERS{i});
END;
drop i;
RUN;
2 REPLIES 2
ArtC
Rhodochrosite | Level 12
The INDSNAME SET statement option might do the trick for you.
[pre]
data two;
set sashelp.shoes sashelp.class indsname=innames;
put innames=;
run;
[/pre]
advoss
Quartz | Level 8
Thanks, that's exactly what I need. Now I've just got to get SAS 9.2 installed on my workstation.

I appreciate your quick response.

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!

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.

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