Date: Sat, 11 Dec 2010 13:44:44 -0800
Reply-To: "Jack F. Hamilton" <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Jack F. Hamilton" <jfh@STANFORDALUMNI.ORG>
Subject: Re: User-define formats
In-Reply-To: <201012112125.oBBBkgfK022102@malibu.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii
Yes, and it surprised me that Ron said it works otherwise. Perhaps it worked differently in a previous release.
On Dec 11, 2010, at 13:25 , Arthur Tabachneck wrote:
> Jack,
>
> Not only does it work that way, but the documentation even states that is
> the way it should be expected to work:
>
> The WORK.FORMATS catalog is always searched first, and the LIBRARY.FORMATS
> catalog is searched next, unless one of them appears in the FMTSEARCH=
> list.\ If a catalog appears in the FMTSEARCH= list, the catalog is searched
> in the order in which it appears in the list. If a catalog in the list does
> not exist, that particular item is ignored and searching continues.
>
> Art
> -------
> On Sat, 11 Dec 2010 12:14:48 -0800, Jack F. Hamilton
> <jfh@STANFORDALUMNI.ORG> wrote:
>
>> The program results below indicate otherwise:
>>
>> =====
>> 1 libname other 'c:\ztemp';
>> NOTE: Libref OTHER was successfully assigned as follows:
>> Engine: V9
>> Physical Name: c:\ztemp
>> 2 options nofmterr;
>> 3
>> 4 proc format library=work;
>> 5 value test
>> 6 1 = 'from work';
>> NOTE: Format TEST has been output.
>> 7 value ex
>> 8 1 = 'from work';
>> NOTE: Format EX has been output.
>> 9 run;
>>
>> NOTE: PROCEDURE FORMAT used (Total process time):
>> real time 0.10 seconds
>> cpu time 0.03 seconds
>>
>>
>> 10
>> 11 proc format library=other;
>> 12 value test
>> 13 1 = 'from other';
>> NOTE: Format TEST is already on the library.
>> NOTE: Format TEST has been written to OTHER.FORMATS.
>> 14 run;
>>
>> NOTE: PROCEDURE FORMAT used (Total process time):
>> real time 0.01 seconds
>> cpu time 0.00 seconds
>>
>>
>> 15
>> 16
>> 17 options fmtsearch=(other);
>> 18
>> 19 data _null_;
>> 20 x = 1;
>> 21 put x=test.;
>> 22 put x=ex.;
>> 23 run;
>>
>> x=from work
>> x=from work
>> NOTE: DATA statement used (Total process time):
>> real time 0.03 seconds
>> cpu time 0.04 seconds
>> =====
>>
>> The format TEST is used from WORK even though only OTHER is specified in
> FMTSEARCH.
>>
>> It's a new session, so CATCACHE doesn't come into play.
>>
>>
>> On Dec 11, 2010, at 11:48 , Fehd, Ronald J. (CDC/OCOO/ITSO) wrote:
>>
>>>> From: bbser2009
>>>> Sent: Saturday, December 11, 2010 12:06 PM
>>>> Subject: RE: [SAS-L] User-define formats
>>>>
>>>> Ron
>>>>
>>>> I am not sure why you emphasized putting "work" first.
>>>>
>>>> If we have this
>>>> "options fmtsearch=(MyLibRef);",
>>>>
>>>> SAS will search Work, LIbrary, and Mylibref in the order displayed.
>>>
>>> your statements evaluates to False
>>>
>>> and this is a common FAQ: where are my work.formats after I changed
> fmtsearch?
>>>
>>> fmtsearch is The List of libref(s) to search
>>>
>>> the default is (work Library)
>>>
>>> if you change the value to e.g.
>>>> "options fmtsearch=(MyLibRef);",
>>> then those are the only libref(s)
>>> that SAS searches for formats.catalog
>>>
>>> i.e.: SAS will not search work nor library
>>>
>>> Ron Fehd the macro maven
>>>
>>> see also:
>>>
> http://www.sascommunity.org/wiki/Dynamically_Insert_and_Append_SAS_Format_an
> d_Macro_Libraries_within_a_SAS_Program
|