BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MeganE
Pyrite | Level 9

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;

1 ACCEPTED SOLUTION

Accepted Solutions
MeganE
Pyrite | Level 9

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!

View solution in original post

1 REPLY 1
MeganE
Pyrite | Level 9

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!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 948 views
  • 0 likes
  • 1 in conversation