I have the following format table....
start label fmtname type
dev_cumul1 1.43167 devfactors I
dev_cumul2 0.9861 devfactors I
dev_cumul3 0.98054 devfactors I
dev_cumul4 0.99966 devfactors I
dev_cumul5 1.0261 devfactors I
dev_cumul6 1.03256 devfactors I
dev_cumul7 1.00784 devfactors I
dev_cumul8 1.00418 devfactors I
dev_cumul9 1.01717 devfactors I
dev_cumul10 1.02158 devfactors I
dev_cumul11 1.01234 devfactors I
dev_cumul12 1.01011 devfactors I
dev_cumul13 0.98893 devfactors I
dev_cumul14 0.96408 devfactors I
dev_cumul15 0.97264 devfactors I
dev_cumul16 0.96371 devfactors I
dev_cumul17 0.97068 devfactors I
dev_cumul18 0.983 devfactors I
dev_cumul19 1.00195 devfactors I
dev_cumul20 1.00208 devfactors I
I was testing whether I could read in the values from this table and I included one value not listed in the 'start' column of the format table (dev_cumul100). However, the dataset test1 reads in a value for this? The output is given below the code:
data test;
input flag1 $14.;
datalines;
dev_cumul1
dev_cumul4
dev_cumul8
dev_cumul16
dev_cumul100
run;
data test1;
set test;
dev_factor = input(flag1,devfactors.);
run;
flag1 dev_factor
dev_cumul1 1.431666437
dev_cumul4 0.99965594
dev_cumul8 1.004175057
dev_cumul16 0.96371087
dev_cumul100 1.02158079
I would have thought the value for dev_cumul100 would be . since it's not on the format table.
The problem is the default W(idth) of the user defined informat. Notice that the value for dev_cuml100 is the same as dev_cuml10. Add w value to devfactors that is ge to the length of longest flag1, 11 I think.
The problem is the default W(idth) of the user defined informat. Notice that the value for dev_cuml100 is the same as dev_cuml10. Add w value to devfactors that is ge to the length of longest flag1, 11 I think.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.