Hi mate,
For this small table you can use multiple IFs and substr function to separate what you need.
But if your table is very large and there is no patterns, then you need a new way to get this table
I agree with Kiwi.
But for this small table you can do this:
%macro name(name,pos,len,pos1,len1); data want_&name(where=(last_name ne "")); set sample; if substr(name,1,1) = "&name." then do; last_name = substr(name,&pos. ,&len.); first_name = substr(name,&pos1.,&len1.); end; run; %mend; %name(g,9,6 ,1,8); %name(a,5,6 ,1,4); %name(d,7,10,1,9); %name(m,6,10,1,5); %name(s,7,10,1,6);
And then append.
Hope this helps
... View more