<?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: Trying to Use Formats to Enhance output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743600#M80599</link>
    <description>&lt;P&gt;Ques1 is a NUMERIC variable in your data set. So, you must assign it a format that is appropriate for a numeric variable, the format name cannot begin with a $, and the values in the format must be written without quotes on the left of the equal sign, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new, courier"&gt;value Likert 1 = 'Str Disagree' ...&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 May 2021 16:16:39 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-05-25T16:16:39Z</dc:date>
    <item>
      <title>Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743599#M80598</link>
      <description>&lt;P&gt;I am trying to learn SAS and run a basic command as shown in the textbook im readying but it seems to not be working. Below is the code i am running:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname Jack "C where the file is located";
data survey02;
infile "C: where the file is located.... survey.txt";
input Id Gender $ Age Salary ques1-ques5;
run;


proc print;
run;


proc format;
value $Gender 'M' = 'male'
'F' = 'Female'
' ' = 'Not entered'
other = 'Miscoded';
value Age low-29 = 'Less than 30'
30-50 = '30 to 50'
51-high = '51+';
value $Likert '1' = 'Str Disagree'
'2' = 'Disagree'
'3' = 'No Opinion'
'4' = 'Agree'
'5' = 'Str Agree'
;
run;


title "data set SURVEY with formatted values";
proc print data=survey02;
id ID;
var gender age salary ques1-Ques5;
format gender $gender.
age Age.
Ques1-Ques5 $likert.
salary Dollar11.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i run this i keep getting the error:&amp;nbsp;You are trying to use the character format $LIKERT with the numeric variable ques1 in dataset WORK.SURVEY02. Im confused because im trying to make numeric values into character values so why wouldn't i include $, when i take it out it says:&amp;nbsp;ERROR: The quoted string '1' is not acceptable to a numeric format or informat.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 16:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743599#M80598</guid>
      <dc:creator>PilOSU</dc:creator>
      <dc:date>2021-05-25T16:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743600#M80599</link>
      <description>&lt;P&gt;Ques1 is a NUMERIC variable in your data set. So, you must assign it a format that is appropriate for a numeric variable, the format name cannot begin with a $, and the values in the format must be written without quotes on the left of the equal sign, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new, courier"&gt;value Likert 1 = 'Str Disagree' ...&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 16:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743600#M80599</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-25T16:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743601#M80600</link>
      <description>When i remove the $ from before it, i get the following error: The quoted string '1' is not acceptable to a numeric format or informat.</description>
      <pubDate>Tue, 25 May 2021 16:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743601#M80600</guid>
      <dc:creator>PilOSU</dc:creator>
      <dc:date>2021-05-25T16:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743603#M80601</link>
      <description>&lt;P&gt;You have a numeric variable. You need a numeric format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;

value Likert 
1 = 'Str Disagree'
2 = 'Disagree'
3 = 'No Opinion'
4 = 'Agree'
5 = 'Str Agree'
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you use it without the $.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format QUES1-QUES5 likert.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 May 2021 16:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743603#M80601</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-25T16:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743605#M80602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/383273"&gt;@PilOSU&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;When i remove the $ from before it, i get the following error: The quoted string '1' is not acceptable to a numeric format or informat.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;yes, I said above:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;and the values in the format must be written without quotes on the left of the equal sign&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;but obviously you didn't do that part. You need to remove the quotes from around '1' so there are no quotes, and this will work for a numeric variable.&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 16:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743605#M80602</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-25T16:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to Use Formats to Enhance output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743608#M80603</link>
      <description>Welp... that was an easy fix.... the textbook has it listed wrong then. Thank you</description>
      <pubDate>Tue, 25 May 2021 16:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trying-to-Use-Formats-to-Enhance-output/m-p/743608#M80603</guid>
      <dc:creator>PilOSU</dc:creator>
      <dc:date>2021-05-25T16:27:14Z</dc:date>
    </item>
  </channel>
</rss>

