<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic When does format statement take effect in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57315#M15991</link>
    <description>I heve a proc sql to make a sasdataset called result.&lt;BR /&gt;
The dataset contains a variable amount wich has a format of commax13.2&lt;BR /&gt;
&lt;BR /&gt;
I want to sort the dataset and give the variable amount an format of z11.&lt;BR /&gt;
proc sort data=userdata.result;&lt;BR /&gt;
by xxx;&lt;BR /&gt;
FORMAT amount z11. ;&lt;BR /&gt;
run;&lt;BR /&gt;
But the format stays commax13.2&lt;BR /&gt;
&lt;BR /&gt;
I also use a proc export:&lt;BR /&gt;
PROC EXPORT DATA=userdata.result&lt;BR /&gt;
	OUTFILE = 'Q:\bla\bla\xx.txt'&lt;BR /&gt;
	DBMS = dlm &lt;BR /&gt;
	REPLACE ;&lt;BR /&gt;
FORMAT amount z11. ;&lt;BR /&gt;
RUN ;&lt;BR /&gt;
But the format stays commax13.2&lt;BR /&gt;
&lt;BR /&gt;
So the question is why doesn't it  work, does the format statement only have effect when creating a new dataset?</description>
    <pubDate>Mon, 27 Oct 2008 15:28:29 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-10-27T15:28:29Z</dc:date>
    <item>
      <title>When does format statement take effect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57315#M15991</link>
      <description>I heve a proc sql to make a sasdataset called result.&lt;BR /&gt;
The dataset contains a variable amount wich has a format of commax13.2&lt;BR /&gt;
&lt;BR /&gt;
I want to sort the dataset and give the variable amount an format of z11.&lt;BR /&gt;
proc sort data=userdata.result;&lt;BR /&gt;
by xxx;&lt;BR /&gt;
FORMAT amount z11. ;&lt;BR /&gt;
run;&lt;BR /&gt;
But the format stays commax13.2&lt;BR /&gt;
&lt;BR /&gt;
I also use a proc export:&lt;BR /&gt;
PROC EXPORT DATA=userdata.result&lt;BR /&gt;
	OUTFILE = 'Q:\bla\bla\xx.txt'&lt;BR /&gt;
	DBMS = dlm &lt;BR /&gt;
	REPLACE ;&lt;BR /&gt;
FORMAT amount z11. ;&lt;BR /&gt;
RUN ;&lt;BR /&gt;
But the format stays commax13.2&lt;BR /&gt;
&lt;BR /&gt;
So the question is why doesn't it  work, does the format statement only have effect when creating a new dataset?</description>
      <pubDate>Mon, 27 Oct 2008 15:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57315#M15991</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-27T15:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: When does format statement take effect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57316#M15992</link>
      <description>I did a small test on SASHELP.class, and it works for me:&lt;BR /&gt;
&lt;BR /&gt;
proc copy in=sashelp out=work;&lt;BR /&gt;
select class;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=class;&lt;BR /&gt;
by age;&lt;BR /&gt;
format age z11.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Obs    Name       Sex            Age    Height    Weight&lt;BR /&gt;
1    Joyce       F     00000000011     51.3       50.5&lt;BR /&gt;
2    Thomas      M     00000000011     57.5       85.0&lt;BR /&gt;
3    James       M     00000000012     57.3       83.0&lt;BR /&gt;
4    Jane        F     00000000012     59.8       84.5&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
Please attach full log and partial output from your example.&lt;BR /&gt;
/Linus</description>
      <pubDate>Mon, 27 Oct 2008 15:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57316#M15992</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-10-27T15:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: When does format statement take effect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57317#M15993</link>
      <description>Thanks for your anwser, i did some further checking&lt;BR /&gt;
&lt;BR /&gt;
The format didn't work on the proc sort because the dataset was already sorted in the right way, so no sorting was done and no reformating.&lt;BR /&gt;
&lt;BR /&gt;
why the format didn't work with proc export i'm still checking.</description>
      <pubDate>Tue, 28 Oct 2008 08:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/When-does-format-statement-take-effect/m-p/57317#M15993</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-28T08:52:48Z</dc:date>
    </item>
  </channel>
</rss>

