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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.