<?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 Re: Permanent Format Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428083#M105642</link>
    <description>&lt;P&gt;Hi Tom,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp; I saw the error, since I didn't know that CARDS/DATALINES needs to be the last statement in the DATA step, I couldn't figure out what was wrong. Now I know!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fiery&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2018 16:26:36 GMT</pubDate>
    <dc:creator>Fiery</dc:creator>
    <dc:date>2018-01-16T16:26:36Z</dc:date>
    <item>
      <title>Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427848#M105560</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my understanding about&amp;nbsp;FORMAT&amp;nbsp;in SAS is if you add the format statement in DATA step, it creates permanent format. If the format statement is added to PROC print step, it only creates the format on the output.&amp;nbsp; However, when I write the following programs, the format for the variable" HireDate" didn't change, it still appears as SAS data value.&amp;nbsp; But when I move the format statement to PROC PRINT step, it shows correctly.&amp;nbsp; Why is that?&amp;nbsp; Did I miss anything?&amp;nbsp; Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;data work.sales;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;infile datalines dlm="/";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;input ID First :$12. Last :$12. Gender $ Salary:comma. Title :$25. HireDate :date.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;datalines;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120102/Tom/Zhou/M/108,255/Sales Manager/01Jun1993&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120103/Wilson/Dawes/M/87,975/Sales Manager/01Jan1978&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120261/Harry/Highpoint/M/243,190/Chief Sales Officer/01Aug1991&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121143/Louis/Favaron/M/95,090/Senior Sales Manager/01Jul2001&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121144/Renee/Capachietti/F/83,505/Sales Manager/01Nov1995&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121145/Dennis/Lansberry/M/84,260/Sales Manager/01Apr1980&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;format HireDate mmddyy10.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Title "Orion Star Management Team";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;proc print data=work.sales;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;run;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Title;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17894i5EE2AF1FC1788D1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 21:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427848#M105560</guid>
      <dc:creator>Fiery</dc:creator>
      <dc:date>2018-01-15T21:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427849#M105561</link>
      <description>&lt;P&gt;Try it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sales;
infile datalines dlm="/";
input ID First :$12. Last :$12. Gender $ Salary:comma. Title :$25. HireDate :date.;
format HireDate mmddyy10.;
datalines;
120102/Tom/Zhou/M/108,255/Sales Manager/01Jun1993
120103/Wilson/Dawes/M/87,975/Sales Manager/01Jan1978
120261/Harry/Highpoint/M/243,190/Chief Sales Officer/01Aug1991
121143/Louis/Favaron/M/95,090/Senior Sales Manager/01Jul2001
121144/Renee/Capachietti/F/83,505/Sales Manager/01Nov1995
121145/Dennis/Lansberry/M/84,260/Sales Manager/01Apr1980
;
run;
Title "Orion Star Management Team";
proc print data=work.sales;
run;
Title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When you use 'cards' or 'datelines', it should be the last command in a data step. Your code as it was was reporting an error.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 21:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427849#M105561</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2018-01-15T21:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427850#M105562</link>
      <description>&lt;P&gt;If you want the FORMAT statement to be part of the data step then include it in the data step, not after it. You cannot have any statements for the data step after the in-line data lines.&amp;nbsp; You should have gotten an error message like this in the LOG.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;112  ;
113  format HireDate mmddyy10.;
     ------
     180

ERROR 180-322: Statement is not valid or it is used out of proper order.

114  run;&lt;/PRE&gt;
&lt;P&gt;Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sales;
  infile datalines dlm="/";
  input ID First :$12. Last :$12. Gender $ Salary:comma. Title :$25. HireDate :date.;
  format HireDate mmddyy10.;
datalines;
120102/Tom/Zhou/M/108,255/Sales Manager/01Jun1993
120103/Wilson/Dawes/M/87,975/Sales Manager/01Jan1978
120261/Harry/Highpoint/M/243,190/Chief Sales Officer/01Aug1991
121143/Louis/Favaron/M/95,090/Senior Sales Manager/01Jul2001
121144/Renee/Capachietti/F/83,505/Sales Manager/01Nov1995
121145/Dennis/Lansberry/M/84,260/Sales Manager/01Apr1980
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 21:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427850#M105562</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-15T21:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427851#M105563</link>
      <description>&lt;P&gt;Statements after the CARDS/DATALINE statement are assumed to be data or are otherwise ignored.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in this case the location of your FORMAT statement matters, it usually doesn't.&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/176006"&gt;@Fiery&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my understanding about&amp;nbsp;FORMAT&amp;nbsp;in SAS is if you add the format statement in DATA step, it creates permanent format. If the format statement is added to PROC print step, it only creates the format on the output.&amp;nbsp; However, when I write the following programs, the format for the variable" HireDate" didn't change, it still appears as SAS data value.&amp;nbsp; But when I move the format statement to PROC PRINT step, it shows correctly.&amp;nbsp; Why is that?&amp;nbsp; Did I miss anything?&amp;nbsp; Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;data work.sales;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;infile datalines dlm="/";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;input ID First :$12. Last :$12. Gender $ Salary:comma. Title :$25. HireDate :date.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;datalines;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120102/Tom/Zhou/M/108,255/Sales Manager/01Jun1993&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120103/Wilson/Dawes/M/87,975/Sales Manager/01Jan1978&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;120261/Harry/Highpoint/M/243,190/Chief Sales Officer/01Aug1991&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121143/Louis/Favaron/M/95,090/Senior Sales Manager/01Jul2001&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121144/Renee/Capachietti/F/83,505/Sales Manager/01Nov1995&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;121145/Dennis/Lansberry/M/84,260/Sales Manager/01Apr1980&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;format HireDate mmddyy10.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Title "Orion Star Management Team";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;proc print data=work.sales;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;run;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Title;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17894i5EE2AF1FC1788D1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 21:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427851#M105563</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-15T21:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427857#M105564</link>
      <description>&lt;P&gt;Maxim 2: Read the Log. The ERROR message would have alerted you to the mistake in your code.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 22:02:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/427857#M105564</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-15T22:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428079#M105640</link>
      <description>&lt;P&gt;Hi Laurie,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fiery&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428079#M105640</guid>
      <dc:creator>Fiery</dc:creator>
      <dc:date>2018-01-16T16:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428083#M105642</link>
      <description>&lt;P&gt;Hi Tom,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp; I saw the error, since I didn't know that CARDS/DATALINES needs to be the last statement in the DATA step, I couldn't figure out what was wrong. Now I know!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fiery&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428083#M105642</guid>
      <dc:creator>Fiery</dc:creator>
      <dc:date>2018-01-16T16:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent Format Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428090#M105645</link>
      <description>&lt;P&gt;Hi Kurt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing this link, it is indeed very useful for a fresh leaner like me. I am teaching myself by using internet. It is possible sometime miss out some key points. It is great thing to have the community, so I can get helps from experts like you guys.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fiery&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-Format-Statement/m-p/428090#M105645</guid>
      <dc:creator>Fiery</dc:creator>
      <dc:date>2018-01-16T16:39:30Z</dc:date>
    </item>
  </channel>
</rss>

