<?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: I am not able to give value and format my data in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/594049#M13122</link>
    <description>&lt;P&gt;Great. So, the suggested solution in the first part of my response should work for you. Have you tried it?&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2019 08:29:51 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2019-10-04T08:29:51Z</dc:date>
    <item>
      <title>I am not able to give value and format my data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593899#M13115</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;libname _all_ clear;&lt;BR /&gt;libname cdc "C:/Users/noor/Desktop/cups";&lt;BR /&gt;data fda;&lt;BR /&gt;set cdc.hw7;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;BR /&gt;PROC FORMAT;&lt;BR /&gt;VALUE Gender&amp;nbsp; 1= 'Female'&amp;nbsp; 2 = 'Male';&lt;BR /&gt;VALUE Occupation 1= 'Medical student' 2 = 'Nurse' 3-5 = 'Resident' 6-10 = 'Fellow';&lt;BR /&gt;VALUE JudgedPreviously 1='Yes' 2= 'No';&lt;BR /&gt;&amp;nbsp;VALUE Age&amp;nbsp; 20 -29 = '2 '&lt;BR /&gt;&amp;nbsp;30-39 = '3'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40 - 49 = '4'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50 - 59 = '5';&lt;BR /&gt;&amp;nbsp;RUN;&lt;BR /&gt;&amp;nbsp;PROC PRINT DATA= cdc.hw7;&lt;BR /&gt;FORMAT GENDER FEMALE.&amp;nbsp; Occupation residents. JudgedPreviously yes.&amp;nbsp; AGE 2.;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;my final report is not giving the assign values&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;please tell me whats wrong with my code&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Oct 2019 20:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593899#M13115</guid>
      <dc:creator>ambreen</dc:creator>
      <dc:date>2019-10-03T20:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: I am not able to give value and format my data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593969#M13116</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289899"&gt;@ambreen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's the FORMAT statement in the PROC PRINT step:&lt;/P&gt;
&lt;P&gt;You are using the syntax&lt;/P&gt;
&lt;PRE&gt;FORMAT &lt;EM&gt;format_name1 &lt;FONT color="#FF0000"&gt;label1&lt;FONT color="#000000"&gt;.&lt;/FONT&gt;&lt;/FONT&gt; format_name2 &lt;FONT color="#FF0000"&gt;label2&lt;FONT color="#000000"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt; ...&lt;/PRE&gt;
&lt;P&gt;but the correct syntax (see documentation: &lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n0d5oq7e0oia0wn13nsins0x8nmh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;FORMAT Statement&lt;/A&gt;) is&lt;/P&gt;
&lt;PRE&gt;FORMAT &lt;EM&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;variable_name1&lt;/STRONG&gt;&lt;/FONT&gt; format_name1. &lt;FONT color="#008000"&gt;&lt;STRONG&gt;variable_name2&lt;/STRONG&gt;&lt;/FONT&gt; format_name2.&lt;/EM&gt; ...&lt;/PRE&gt;
&lt;P&gt;So, you need to look into dataset &lt;FONT face="courier new,courier"&gt;cdc.hw7&lt;/FONT&gt;&amp;nbsp;(or its copy, &lt;FONT face="courier new,courier"&gt;fda&lt;/FONT&gt;) to find out the names of the four variables to be formatted. You may want to create a list of all variables in the dataset by means of PROC CONTENTS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=fda;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Depending on the variable names (which could be, say, &lt;FONT face="courier new,courier"&gt;sex&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;occup&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;jprev&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;age&lt;/FONT&gt;), your FORMAT statement might look like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format sex Gender. occup Occupation. jprev JudgedPreviously. age Age.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a remote possibility that one or more of the four variables are in fact &lt;EM&gt;character&lt;/EM&gt; variables (see column "Type" in the PROC CONTENTS output). This would cause an error message in the log when you submit the PROC PRINT step, e.g.:&lt;/P&gt;
&lt;PRE&gt;ERROR: You are trying to use the numeric format GENDER with the character variable sex in data set CDC.HW7.&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Only in this case&lt;/EM&gt; you would need to modify the &lt;EM&gt;corresponding&lt;/EM&gt; format definition in the PROC FORMAT step (and rerun that step), e.g.:&lt;/P&gt;
&lt;PRE&gt;VALUE &lt;FONT color="#008000"&gt;&lt;STRONG&gt;$&lt;/STRONG&gt;&lt;/FONT&gt;Gender  &lt;FONT color="#008000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;1&lt;FONT color="#008000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;= 'Female'  &lt;FONT color="#008000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;2&lt;FONT color="#008000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt; = 'Male';&lt;/PRE&gt;
&lt;P&gt;and use &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;$&lt;/STRONG&gt;Gender.&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;Gender.&lt;/FONT&gt; in the FORMAT statement.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 22:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593969#M13116</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-10-03T22:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: I am not able to give value and format my data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593979#M13117</link>
      <description>&amp;nbsp;I have checked all of tgem are numeric variables&amp;nbsp;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Oct 2019 22:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/593979#M13117</guid>
      <dc:creator>ambreen</dc:creator>
      <dc:date>2019-10-03T22:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: I am not able to give value and format my data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/594049#M13122</link>
      <description>&lt;P&gt;Great. So, the suggested solution in the first part of my response should work for you. Have you tried it?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 08:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/I-am-not-able-to-give-value-and-format-my-data/m-p/594049#M13122</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-10-04T08:29:51Z</dc:date>
    </item>
  </channel>
</rss>

