DATA Step, Macro, Functions and more

Is there a function to get a SAS member name?

Reply
Frequent Contributor
Posts: 91

Is there a function to get a SAS member name?

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;
Valued Guide
Posts: 632

Re: Is there a function to get a SAS member name?

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]
Frequent Contributor
Posts: 91

Re: Is there a function to get a SAS member name?

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.
Ask a Question
Discussion stats
  • 2 replies
  • 128 views
  • 0 likes
  • 2 in conversation