|
The function vformat will return a variables format.
e.g. f= vformat(myVariable);
>hi,
>
>I have a variable myVariable that is formatted somewhere else in the
>program.
>
>I have a macro that i pass in the name of a variable (i.e myVariable)
>and that macro will have a proc tabulate that produces the sum of
>myVariable in the cell of the table.
>
>the number (sum) of the variable (myVariable) will not be formatted the
>same way the variable is (myVariable is comma8. for example)
>
>so you have to do *f=comma8. or such.
>
>is there a way to detect the formatting of the variable that is being
>passed in, and to format the sum of it the same way it is?
>
>I know I can do that indirectly (and undesirably) by outputting a
>dataset from porc content and them getting the format of the variable
>(myvariab;e) and then assigning that to a macro, then using that
>format...etc, But i was trying to find a better solution.
>
>is there some function to extract the format of a variable? or is there
>a way to tell proc tabulate that the sum of a variable should have the
>same format as the variable it self?
>
>thanks
|