LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 17 Sep 1998 17:05:13 -0400
Reply-To:     Chenglong Han <hanc@CALIB.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Chenglong Han <hanc@CALIB.COM>
Subject:      Re: PERMANENT FORMAT
Comments: To: "captain@ROCKETSHIP.COM" <captain@ROCKETSHIP.COM>
Content-Type: text/plain

You need use LIBRARY as the libref to fine your permanent formats. According to SAS procedure guideline, SAS looks for permanent formats only in the sas data library that has been assigned the LIBRARY libref. So your code should be like this: libname nutritn 'x:\xxx'; proc format library=nutritn; value lvwthx 0='NONE' 1='HUSBAND' 2='MALE PARTNER' 3='ADULT CHILDREN' 4='PARENTS' 5='OTHER RELATIVES' 6='FRIENDS/FLATMATES' 7='OTHER' 8='N/A' 9="DON'T KNOW"; run;

/* Next time, IF you refer to the formats THEN DO;

libname nutritn 'x:\xxx'; libname LIBRARY 'x:\xxx';

data nutritn.q4tab; set temp1x; format livewth1 lvwthx. livewth2 lvwthx. livewth3 lvwthx.; run; /*ELSE "format is unknown" ; /*end;

Chenglong Han Senior Associate 10350 Rosehaven Street Suit 400 Fairfax, VA 22030 Tel: 703-385-3200

> -----Original Message----- > From: captain@ROCKETSHIP.COM [SMTP:captain@ROCKETSHIP.COM] > Sent: Sunday, September 13, 1998 8:50 PM > To: SAS-L@UGA.CC.UGA.EDU > Subject: PERMANENT FORMAT > > Hi all, > > I'm trying to use PROC FORMAT to define some permanent formats. I've used > it > in statements like to the one below, using the "library=" command to > define a > permanent format catalog in my "nutritn" library. This seems to create the > required formats catalog, in the right library, but when I go to refer to > these catalogs using the format statement in a data step I get a "format > is > unknown" error from SAS. If I leave off the library= option then SAS lets > me > define the datasets later with the format statement, but then the formats > aren't permanent. I think I must be refering to these newly defined > formats > wrongly, can anyone help? > > Here is an example of the sort of statement I use to define a permanent > format: > > proc format library=nutritn; > value lvwthx 0='NONE' 1='HUSBAND' 2='MALE PARTNER' 3='ADULT CHILDREN' > 4='PARENTS' 5='OTHER RELATIVES' 6='FRIENDS/FLATMATES' 7='OTHER' > 8='N/A' > 9="DON'T KNOW"; > run; > > Here is an example of how I've tried to refer to the format defined above: > > data nutritn.q4tab; > set temp1x; > format livewth1 lvwthx. livewth2 lvwthx. livewth3 lvwthx.; > run; > > > Incidentally, I'm using SAS 6.12 for Windows 95 on a Pentium 120 box. > > Thanks in advance.... > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum


Back to: Top of message | Previous page | Main SAS-L page