Date: Thu, 8 Jan 2009 11:27:35 -0500
Reply-To: Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Subject: Re: Removing all formats from a dataset
In-Reply-To: <200901081540.AEJ48342@mailsvr2.deltacom.net>
Content-Type: text/plain; charset=ISO-8859-1
proc datasets lib=work memtype=data;
modify class;
attrib _all_ label=' ';
attrib _all_ format=;/* including an Equal sign will remove the
formats */
run;
Quit;
or
By Including Format statement
Proc datasets lib=work memtype=data;
modify class;
format _all_;
Quit;
Thanks!Akshaya
On Thu, Jan 8, 2009 at 10:58 AM, Carl Denney <cdenney@healthinfotechnics.com
> wrote:
> Will someone help me understand why the following doesn't work for
> me? The file import function adds formats and informats to all my
> variables which I wish to delete.
>
> When I run this code, I get errors.
>
> proc datasets library=areacode memtype=data;
> modify all_npa;
> attrib _char_ format ;
> run;
> quit;
>
>
>
>
> In SAS v9.2 help, under "The DATASETS Procedure: ATTRIB Statement" is
> a link to a feature on "Removing All Labels and Formats in a Data Set."
>
> In that section, you will find:
>
> Within PROC DATASETS, remove all the labels and formats using the
> MODIFY statement and the ATTRIB option.
>
> proc datasets lib=work memtype=data;
> modify class;
> attrib _all_ label=' ';
> attrib _all_ format;
> run;
>
>
>
>
> But when I try to run this on one of my datasets, I get:
>
> proc datasets library=areacode memtype=data;
> Directory
>
> Libref AREACODE
> Engine V9
> Physical Name \\hitserver\d\areacodes
> Filename \\hitserver\d\areacodes
>
>
> Member File
> # Name Type Size Last Modified
>
> 1 ALL_NPA DATA 132096 07Jan09:17:15:34
>
> modify all_npa;
> attrib _all_ format ;
> -
> 22
> 76
> ERROR 22-322: Syntax error, expecting one of the following: a name,
> -, :, FORMAT, INFORMAT, LABEL, LENGTH, _ALL_, _CHARACTER_, _CHAR_,
> _NUMERIC_.
> ERROR 76-322: Syntax error, statement will be ignored.
> run;
>
> NOTE: Statements not processed because of errors noted above.
> quit;
>
>
>
> Carl Denney, MSIE
> Founder
> Health InfoTechnics
> 210 Jamestown Park, Suite 101, Brentwood, TN 37027
> 615/298-4011
> http://www.healthinfotechnics.com
>
|