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!
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.