Hi Team, I want something very easy. I want to mantain the same order of the variables of this dataset. set output.&cons ; I tried with retain and using keep statement and this does not mantain the same order of the variable names. I read on the forums and they suggested to use Retain and Format options validvarname=any;
data testa (drop=r1 r2 "Range Start"n "Range End"n) ;
format
month_var $char32.
Range $char24.
"Current Count"n comma15.
"Current %"n percent12.2
"Previous Count"n comma15.
"Previous %"n percent12.2
"% Change"n percent12.2
;
set output.&cons ;
r1=put(input("Range Start"n,15.),comma12.);
r2=put("Range End"n,comma15.);
Range=CATX('_',r1,r2);
;
run; NOTE: Variable 'Previous Count'n is uninitialized. getting this like Output: month_var Range Current Count Current % Previous Count Previous % % Change Previous Count M00_ACCT_BALANCE_AM ._0 313,313,113 36.16% . 33.97% 2.19% 2,323,333,131 M00_ACCT_BALANCE_AM 1_100 313,313,113 5.58% . 33.97% 2.19% 2,323,333,131 And I need this: month_var Range Current Count Current % Previous Count Previous % % Change M00_ACCT_BALANCE_AM ._0 313,313,113 36.16% 2,323,333,131 33.97% 2.19% M00_ACCT_BALANCE_AM 1_100 313,313,113 5.58% 2,323,333,131 33.97% 2.19% M00_ACCT_BALANCE_AM 101_500 313,313,113 12.15% 2,323,333,131 33.97% 2.19% My question are 2: 1. Why is reading twice the variable "Previous Count" ? One with expected output and another with missing values 2. Is there an easy way to mantain the same order of the variable names of my dataset ? set output.&cons ;
... View more