I'm going crazy trying to figure out a highly customized risk dimensions program. There is one paticular line of the code that involves using the PUTC (or PUTN on numeric values). The orriginal program is extremely complex but I have simplified it down to this for example purposes;
----------------------------------
Data frank;
input num1 num2 num3 ;
datalines;
1 2 3
4 5 6
7 8 9
;
run;
data postfrank;
set frank;
length a1 a2 a3 $32. ;
array thenums{3} a1-a3 ('num1','num2','num3');
myvar=thenums(_N_);
myfmt='Z3';
myresult=putn(myvar,myfmt);
run;
----------------------------------
When I run this code in an EG or PC SAS session the variable myresult is null just as I would expect, null. Except in our production environment, which runs this code in DI studio, the code seems to work.
The way I understand PUTN/PUTC is that the variable myfmt holds the format name to apply to the contents of myvar. This is true in the documentation and when I run it in PC SAS or EG.
But the way the orriginal code is working in our production environment is the myvar holds the name of the variable whos contents should be formated. That variable can change depending on other information in the observation. Based on the way things are working in prod, but not in my PC SAS or EG session, is that myresult in POSTFRANK should have the following values;
obs 1: '001'
obs 2: '005'
obs 3: '009'
Has any one come accross this kind of functionality or had to deal with this? Am I making sense or have I gone loco?