Hi all,
I have an array code, and i'd like to convert bvar(i) to the actual variable name that it's referencing at the time and put it as text into another character field. I've bolded it in the code. So i'd like for it to say xclm_thru## instead of bvar(i).
Any ideas?
Thanks
Data junk.x4b2_rewrite3 ;
/*new vars*/
array vvar(*) $200 case1 - case&max.;
array wvar(*) new_clm_from1 - new_clm_from&max.;
array xvar(*) new_clm_thru1 - new_clm_thru&max.;
set junk.x4b2_rewrite2;
/*existing vars*/
array avar(*) xclm_from1 - xclm_from&max.;
array bvar(*) xclm_thru1 - xclm_thru&max.;
do i=1 to &max.;
do j=2 to &max.;
by kecc_id;
if bvar(i) > avar(j) then do;
wvar(i)=avar(i); /*from*/
xvar(i)=bvar(j); /*thru*/
vvar(i)="03 - bvar(i) next claim start date is earlier than current claim end date";
end;
end;
end;
format new_clm_from: new_clm_thru: mmddyy10.;
run;
Got it. Typical. Messed around with it for more than 30 minutes before posting out here, and then 5 minutes later i find it. 🙂
vvar(i)=cats("03 - ", vvalue(bvar(i))," > ", vvalue(avar(j))," next claim start date is earlier than current claim end date");
vvalue. It doesn't give me xclm_from##, it gives me the value for xclm_from##, which is just as good for what I was looking for.
Thanks!
Got it. Typical. Messed around with it for more than 30 minutes before posting out here, and then 5 minutes later i find it. 🙂
vvar(i)=cats("03 - ", vvalue(bvar(i))," > ", vvalue(avar(j))," next claim start date is earlier than current claim end date");
vvalue. It doesn't give me xclm_from##, it gives me the value for xclm_from##, which is just as good for what I was looking for.
Thanks!
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.
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.