<?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 problem with showing the format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844427#M333831</link>
    <description>&lt;P&gt;hello all&lt;/P&gt;
&lt;P&gt;I have&amp;nbsp; the following data set and I'm trying to switch it's value using proc format but it is not working as expected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mysurvay1;&lt;BR /&gt;input q1 $ q2 $ q3 $;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1_strogly_agree 4_not_important 3_very_low&lt;BR /&gt;1_strogly_agree 3_somewhat_importatnt 9_left_blank&lt;BR /&gt;2_agree 9_left_blank 9_left_blank&lt;BR /&gt;4_disagree 2_important normal&lt;BR /&gt;9_left_blank 2_important 1_high&lt;BR /&gt;agree 3_somewhat_importatnt 2_normal&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;invalue $qanswer&lt;BR /&gt;"1_high" =1&lt;BR /&gt;"1_strogly_agree" =1&lt;BR /&gt;"2_agree" =2&lt;BR /&gt;"2_important" =2&lt;BR /&gt;"2_normal" =2&lt;BR /&gt;"3_somewhat_importatnt"=3&lt;BR /&gt;"3_very_low" =3&lt;BR /&gt;"4_disagree" =4&lt;BR /&gt;"4_not_important" =4 &lt;BR /&gt;"9_left_blank" = .&lt;BR /&gt;other =999&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc print data=mysurvay1;&lt;BR /&gt;format q1-q3 $qanswer.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;expected output&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;999&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but what I'm getting is&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Abdulla1_0-1668532233799.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77340i75C7DA6E3C1A4E3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Abdulla1_0-1668532233799.png" alt="Abdulla1_0-1668532233799.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;may you help me with that&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 17:12:03 GMT</pubDate>
    <dc:creator>Abdulla1</dc:creator>
    <dc:date>2022-11-15T17:12:03Z</dc:date>
    <item>
      <title>problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844427#M333831</link>
      <description>&lt;P&gt;hello all&lt;/P&gt;
&lt;P&gt;I have&amp;nbsp; the following data set and I'm trying to switch it's value using proc format but it is not working as expected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mysurvay1;&lt;BR /&gt;input q1 $ q2 $ q3 $;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1_strogly_agree 4_not_important 3_very_low&lt;BR /&gt;1_strogly_agree 3_somewhat_importatnt 9_left_blank&lt;BR /&gt;2_agree 9_left_blank 9_left_blank&lt;BR /&gt;4_disagree 2_important normal&lt;BR /&gt;9_left_blank 2_important 1_high&lt;BR /&gt;agree 3_somewhat_importatnt 2_normal&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;invalue $qanswer&lt;BR /&gt;"1_high" =1&lt;BR /&gt;"1_strogly_agree" =1&lt;BR /&gt;"2_agree" =2&lt;BR /&gt;"2_important" =2&lt;BR /&gt;"2_normal" =2&lt;BR /&gt;"3_somewhat_importatnt"=3&lt;BR /&gt;"3_very_low" =3&lt;BR /&gt;"4_disagree" =4&lt;BR /&gt;"4_not_important" =4 &lt;BR /&gt;"9_left_blank" = .&lt;BR /&gt;other =999&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc print data=mysurvay1;&lt;BR /&gt;format q1-q3 $qanswer.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;expected output&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;q3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;.&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;999&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but what I'm getting is&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Abdulla1_0-1668532233799.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77340i75C7DA6E3C1A4E3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Abdulla1_0-1668532233799.png" alt="Abdulla1_0-1668532233799.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;may you help me with that&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 17:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844427#M333831</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T17:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844429#M333832</link>
      <description>&lt;P&gt;You create the&amp;nbsp;&lt;EM&gt;numeric&lt;/EM&gt;&amp;nbsp;&lt;STRONG&gt;in&lt;/STRONG&gt;format qanswer, but you try to use the&amp;nbsp;&lt;EM&gt;character&lt;/EM&gt; format (note the missing "in") $qanswer.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 17:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844429#M333832</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-15T17:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844437#M333835</link>
      <description>&lt;P&gt;I have just tired to replace invalue with value in the proc format step. yet I'm still getting the same answer.&lt;/P&gt;
&lt;P&gt;I also tried to replace the format with informat in the proc print step but now I'm seeing my original data.&lt;/P&gt;
&lt;P&gt;is that what you meant?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 17:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844437#M333835</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844443#M333836</link>
      <description>&lt;P&gt;You need to define the INFORMAT before you use it.&lt;/P&gt;
&lt;P&gt;If you want the INFORMAT to create a NUMERIC result it needs to be defined as a NUMERIC informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue qanswer
  "1_high" =1
  "1_strogly_agree" =1
  "2_agree" =2
  "2_important" =2
  "2_normal" =2
  "3_somewhat_importatnt"=3
  "3_very_low" =3
  "4_disagree" =4
  "4_not_important" =4
  "9_left_blank" = .
  other =999
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have the informat defined you can use it to read in text and convert them into numbers. (Just like the 5. informat reads in 5 character digit strings and converts them into numbers).&lt;/P&gt;
&lt;P&gt;If you already have the Q1 variables defined as character then make new numeric variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mysurvey1;
  input (q1-q3) (:$50.);
DATALINES;
1_strogly_agree 4_not_important 3_very_low
1_strogly_agree 3_somewhat_importatnt 9_left_blank
2_agree 9_left_blank 9_left_blank
4_disagree 2_important normal
9_left_blank 2_important 1_high
agree 3_somewhat_importatnt 2_normal
;
data want;
  set mysurvey1;
  num1 = input(q1,qanswer.);
  num2 = input(q2,qanswer.);
  num3 = input(q3,qanswer.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1668536683082.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77345i7CE25E7D8F9C023D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1668536683082.png" alt="Tom_0-1668536683082.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just read them in using the INFORMAT so they are defined as numeric to begin with (you will lose the distinction between the various invalid responses).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mysurvey1;
  input (q1-q3) (:qanswer.);
DATALINES;
1_strogly_agree 4_not_important 3_very_low
1_strogly_agree 3_somewhat_importatnt 9_left_blank
2_agree 9_left_blank 9_left_blank
4_disagree 2_important normal
9_left_blank 2_important 1_high
agree 3_somewhat_importatnt 2_normal
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844443#M333836</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-15T18:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844444#M333837</link>
      <description>&lt;P&gt;This line is defining Q1 to Q4 to each be character with a length of only 8 bytes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input q1 $ q2 $ q3 $;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you only read in 8 of the characters then most of the strings will not match the strings in the format(informat?) definition.&lt;/P&gt;
&lt;PRE&gt;4_not_important &lt;/PRE&gt;
&lt;P&gt;is not the same as&lt;/P&gt;
&lt;PRE&gt;4_not_im&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844444#M333837</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-15T18:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844445#M333838</link>
      <description>Assuming the spelling mistakes in the code are also in the data?</description>
      <pubDate>Tue, 15 Nov 2022 18:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844445#M333838</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-11-15T18:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844446#M333839</link>
      <description>&lt;P&gt;If you want to just convert the first digit into a number then why not just do that?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  string='4_not_important';
  number = input(string,??1.);
  if number=. then number=999;
  if number=9 then number=.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844446#M333839</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-15T18:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844453#M333843</link>
      <description>&lt;P&gt;Thank you Tom&lt;/P&gt;
&lt;P&gt;That is helpful. may you help me on how to read it the data using the informat like on a data that was already defined (has set statement instead of input).&lt;/P&gt;
&lt;P&gt;I tired the code&lt;/P&gt;
&lt;P&gt;data mysurvey2;&lt;BR /&gt;set mysurvey1;&lt;BR /&gt;format q1-q3 qanswer.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844453#M333843</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T18:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844457#M333844</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mysurvey2;
set mysurvey1;
array _q(*) q1-q3;
array _new(*) new_q1-new_q3;

do i=1 to dim(_q);
_new(i) = input(substr(_q(i), 1, 1), 8.);
end;

run;

proc print data=mysurvey2;
var new_q1-new_q3;
run;

proc print data=mysurvey1;
var q1-q3;
format q1-q3 $1.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try both of the above options.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844457#M333844</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-11-15T18:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844458#M333845</link>
      <description>&lt;P&gt;lol they are not in the actual data for sure. but thanks for notifying me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844458#M333845</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T18:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844463#M333848</link>
      <description>&lt;P&gt;that is probably the easiest way of doing it, but it will be harder for me to adjusting some of the values, such as "normal" which doesn't have a number before it and I would code it later as 2.&lt;/P&gt;
&lt;P&gt;thanks for the suggestion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844463#M333848</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T19:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844464#M333849</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/414636"&gt;@Abdulla1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Tom&lt;/P&gt;
&lt;P&gt;That is helpful. may you help me on how to read it the data using the informat like on a data that was already defined (has set statement instead of input).&lt;/P&gt;
&lt;P&gt;I tired the code&lt;/P&gt;
&lt;P&gt;data mysurvey2;&lt;BR /&gt;set mysurvey1;&lt;BR /&gt;format q1-q3 qanswer.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is something completely different.&lt;/P&gt;
&lt;P&gt;INFORMATs are used to convert text into value.&amp;nbsp; A numeric informat (like in my previous answer) converts text into numbers. A character informat converts text into text (character strings).&lt;/P&gt;
&lt;P&gt;FORMATs are used to convert values into text.&amp;nbsp; A numeric format, like the qanswer format in your code here, converts numbers into text.&amp;nbsp; A character format converts character string (text) into text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for this code to work the variables Q1 to Q4 would need to be numeric.&amp;nbsp; And you would have needed to have define a numeric format that converts values like 1 or 2 into strings. Something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value qanswer
  1='1_something_or_other'
  2='2_another_answer'
  ...
  999='Invalid answer'
  .='9_no_response'
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844464#M333849</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-15T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844466#M333850</link>
      <description>&lt;P&gt;that explains it all.&lt;/P&gt;
&lt;P&gt;thank you very much.&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844466#M333850</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844467#M333851</link>
      <description>&lt;P&gt;thank you Reeza,&lt;/P&gt;
&lt;P&gt;may you explain the $1. below what is that ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;proc print data=mysurvey1;&lt;BR /&gt;var q1-q3;&lt;BR /&gt;format q1-q3 $1.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844467#M333851</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-11-15T19:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with showing the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844491#M333857</link>
      <description>That's a single character format. Essentially the same idea as take the first character.</description>
      <pubDate>Tue, 15 Nov 2022 20:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-showing-the-format/m-p/844491#M333857</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-11-15T20:47:47Z</dc:date>
    </item>
  </channel>
</rss>

