<?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: Proc format issue in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87562#M24983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ODS tagsets option is working!! it's fantastic!!&lt;/P&gt;&lt;P&gt;The Excelxp actually is not an Excel file, it's a Xml file, but you could make it as Excel file.&lt;/P&gt;&lt;P&gt;1. open the xml file in excel.&lt;/P&gt;&lt;P&gt;2. save as excel file (in this step, you are not able to import this excel file into sas, it poped up an error message - I have no idea, why? but I did some research &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;).&lt;/P&gt;&lt;P&gt;3. copy the whole worksheet to another worksheet, and then delete the first worksheet, keep the copy one. this way the file is really as a real excel file, and you could import into SAS with no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jan 2013 22:13:09 GMT</pubDate>
    <dc:creator>ursula</dc:creator>
    <dc:date>2013-01-28T22:13:09Z</dc:date>
    <item>
      <title>Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87557#M24978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have questions abou the sas dataset format:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1).&amp;nbsp; I was using 'Proc format' step to change the values in sas dataset (Gender).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The original values are: 1 and 2 (numeric).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want to change the value 1 as a 'Male' and 2 as a 'Female' by using the proc format step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value change 1='male'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2='female'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after done with the format, the values has been changed to either 'Male' or 'Female'. Then I tried to export the sas dataset into Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The problelm is, the "Gender" field in exported excel file did not show 'male' or 'Female', but it showed the original format (1 or 2) instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is it a way to mentain the formated value as 'Male' or 'Female' in the exported excel file?? Any advice will be really appreciate.&lt;/P&gt;&lt;P&gt;2). how to change the sas dataset's 'Type' from numeric into character?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 00:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87557#M24978</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2013-01-28T00:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87558#M24979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FORMAT doesn't actually change the values in a dataset. Instead, it creates labels for values, which you can choose to display instead of displaying the value itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to create a character value which would have the value of 'male' or 'female', you should use the PUT() function. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;genderC=put(gender,change.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to keep the name of the variable as gender, you can rename it when you read it in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have (rename=(gender=_gender));&lt;/P&gt;&lt;P&gt;gender=put(_gender,change.);&lt;/P&gt;&lt;P&gt;drop _gender;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those character variables should export to Excel as text cells.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 01:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87558#M24979</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-01-28T01:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87559#M24980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Quentin for your prompt help!&lt;/P&gt;&lt;P&gt;my understanding is that the proc format only "display" the value we want, but not really change in the dataset, is that true?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 01:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87559#M24980</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2013-01-28T01:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87560#M24981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is true.&amp;nbsp; When you associate a format with a variable,it changes how it is displayed, but does not change the value of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use the PUT() function as in my example, you are creating a new variable, and the value of that new variables will be the text string 'male' or 'female'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 02:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87560#M24981</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-01-28T02:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87561#M24982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't mention how you export to excel. One option would be to use ODS tagsets.Excelxp combined wiht proc print. Then in proc print you assign the formats you want. No data change needed plus you have some control over appearance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 15:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87561#M24982</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-01-28T15:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87562#M24983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ODS tagsets option is working!! it's fantastic!!&lt;/P&gt;&lt;P&gt;The Excelxp actually is not an Excel file, it's a Xml file, but you could make it as Excel file.&lt;/P&gt;&lt;P&gt;1. open the xml file in excel.&lt;/P&gt;&lt;P&gt;2. save as excel file (in this step, you are not able to import this excel file into sas, it poped up an error message - I have no idea, why? but I did some research &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;).&lt;/P&gt;&lt;P&gt;3. copy the whole worksheet to another worksheet, and then delete the first worksheet, keep the copy one. this way the file is really as a real excel file, and you could import into SAS with no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 22:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issue/m-p/87562#M24983</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2013-01-28T22:13:09Z</dc:date>
    </item>
  </channel>
</rss>

