08-03-2011 03:57 PM
I am trying to use preloadfmt with proc tabulate but I am receiving the following error:
The format for variable SAMPLE_MONTH cannot be preloaded. Preload will have no effect.
value time_frame_format (notsorted)
low-<'01JAN2008'd = 'Before 2008'
'01JAN2008'd-<'01JAN2009'd = [worddate20.]
'01JAN2009'd-<'01JAN2010'd = 'Timeframe1'
'01JAN2010'd-high = 'After timeframe1'
proc tabulate data=work.data MISSING order=data;
class sample_month / preloadfmt;
format sample_month time_frame_format.;
table = c_type, amount * SUM, c_type all='TOTAL';
08-03-2011 05:41 PM
Thanks greatly appreciated! The sample_month field only contains the first of each month so the summary would be limited to 12 values for that specified range. I now understand that I must expand all the format ranges for preloadfmt to work.
04-11-2013 09:03 PM
Hi, I am having a similar problem. Can you elaborate on what you mean here? The way I'm understanding it, data _null_ is suggesting that the preloadfmt error that brian is receiving is due to the fact that he is using ranges to define his multi-label format. I too am trying to define a multi-label format to use in a proc tabulate and am receiving the error that brian noted. In my situation, it would be nearly impossible for my to individually define each of my numeric values. However, I see plenty of documented examples (incl on the SAS website) where people are successfully using ranges in their user-defined multilabel format definitions without having to expand out and define each value separately. I think I must be misunderstanding the solution here? Any help would be greatly appreciated! My situation looks something like this (hopefully no typos--i didnt copy/paste here):
proc format; picture testf (multilabel notsorted)
9998="Worse 2"; run;
proc tabulate data=dat1;
class vision /mlf preloadfmt order=data;
table vision,(group all)*(n colpctn);
format vision testf.; run;
04-12-2013 06:54 AM
Ranges are fine but not they must map to a single value.
Doesn't say make the range 0-9996 a single value.
I've been experimenting with your program in the other thread and it "works" mostly for everything but PRELOADFMT.
04-12-2013 10:27 AM
AHA! This was the jist of my eventual conclusion as well. It seems that this means a picture format will never be able to be preloaded. It makes sense to me that a format could not be preloaded if it is dependent on the data itself (like a picture format is). Unfortunately, the format is useless to me if I can't apply it to this proc tabulate
04-12-2013 10:35 AM
You may still be able to have your cake and eat it too. Start a new thread where you explain what you want include sample data and the rest. Give exact details.
Need further help from the community? Please ask a new question.