|
I don't see a problem with the code you posted. I may be there but I
don't see it.
Can you post a bit of the log. The only think I can think of that
might be wrong is with &charvar.
On Feb 13, 2008 5:31 PM, Xuhong <zhuxuhong2000@gmail.com> wrote:
> Thank very much for your quick response. Here is the reason why I am
> doing this. We did a survey by two methods. One is from online and
> another part is by paper. For paper part, they scanned each answers
> into four numbers and I need to translate the 4 numbers back to the
> original meanings. Then I could merge the two parts together.
>
> Just now, I tried your codes and it works for my example. However, my
> original part didn't work. I changed the dataset name and I don't need
> to change the work directory since it is there.
>
> I thought my original logic is very similar to yours. However, the
> weird thing is my results always only show length four.
>
> Here is my codes:
>
> Proc contents data=Pap_New2 out=temp (keep=name type) ;
> run;
>
> proc sql noprint;
> select trim(name)
> into :charvar separated by ' '
> from temp
> where type=2;
> quit;
>
> %put NOTE: name=&charvar;
>
> data Pap_New3 (drop=i);
> length &charvar $50;
> set Pap_New2;
> array a(*) _character_;
> do i = 1 to dim(a);
> a[i]=put(a[i], $type.);
> end;
> run;
>
> I really don't understand what's the problem here. It is so weired...
>
|