<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299005#M60375</link>
    <description>&lt;P&gt;Numbers are characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are ME2/SE2 variables or values your having issues with? Please explain in detail.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2016 18:25:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-16T18:25:11Z</dc:date>
    <item>
      <title>Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299001#M60373</link>
      <description>&lt;P&gt;How do you create a (proc) format for a variable having mixed values (character and numeric) like ME2 and SE2 ? Is it possible? Or is there any other way?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 18:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299001#M60373</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-16T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299005#M60375</link>
      <description>&lt;P&gt;Numbers are characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are ME2/SE2 variables or values your having issues with? Please explain in detail.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 18:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299005#M60375</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-16T18:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299007#M60376</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps your question is about how to NAME your format?&lt;/P&gt;
&lt;P&gt;FORMAT names cannot end in a digit as that would be too confusing because a format reference specifies the length in the using the trailing digits. &amp;nbsp;DATE9. for example. &amp;nbsp;So a format reference of ME2. means to use the format named ME and display using 2 character positions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the name you use for your FORMAT has nothing to do with the name of the VARIABLE. &amp;nbsp;It desribes the FORMAT itself. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you have variables named ME1 and ME2 and they both use the same sets of possible values then you could create a single format named ME or MEF and use it for both variables. &amp;nbsp;If they use different sets of possible vlaues then could create formats named ME1F and ME2F.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 18:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299007#M60376</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-16T18:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299008#M60377</link>
      <description>JobCode is the variable. 'ME2' and 'SE2' are the values of the variable JobCode.</description>
      <pubDate>Fri, 16 Sep 2016 18:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299008#M60377</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-16T18:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299009#M60378</link>
      <description>&lt;P&gt;If you variable JOBCODE has values like 'ME2' then you have a character variable. You will need to use a character format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value $jobcode
   'ME2'='Must Enter Twice'
  ;
run;
....
format jobcode $jobcode. ;
....&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2016 18:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299009#M60378</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-16T18:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299013#M60380</link>
      <description>proc format;&lt;BR /&gt;	value $Jobf&lt;BR /&gt;	'TA2'='MANAGER'&lt;BR /&gt;	'ME2'='ASSISTANT'&lt;BR /&gt;	'ME1'='TECHNICAL WRITER'&lt;BR /&gt;	'FA3'='SENIOR TECHNICAL WRITER'&lt;BR /&gt;	'TA3'='ASST MANAGER'&lt;BR /&gt;	'ME3'='ASSISTANT ASST'&lt;BR /&gt;	'SCP'='TIME PASS';&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this code correct?</description>
      <pubDate>Fri, 16 Sep 2016 18:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299013#M60380</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-16T18:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299024#M60385</link>
      <description>&lt;P&gt;That should work.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 19:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299024#M60385</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-16T19:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299027#M60387</link>
      <description>&lt;P&gt;Close, but probably not the way you want. YOU should always test your code.&lt;/P&gt;
&lt;P&gt;To test a format, test all values AND some values that aren't in your list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $Jobf
'TA2'='MANAGER'
'ME2'='ASSISTANT'
'ME1'='TECHNICAL WRITER'
'FA3'='SENIOR TECHNICAL WRITER'
'TA3'='ASST MANAGER'
'ME3'='ASSISTANT ASST'
'SCP'='TIME PASS';
RUN;

data test;
input orig $5.;
want=put("TA2", $jobf.);
cards;
TA2
ME2
ME1
FA3
TA3
ME3
SCP
XXX
YYY
AAA
TB24
TA24
ME23
;
run;

proc print data=test;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 19:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299027#M60387</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-16T19:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299081#M60401</link>
      <description>Reeza, can I copy paste this code and run it? or do I need to edit anything?</description>
      <pubDate>Sat, 17 Sep 2016 05:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299081#M60401</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T05:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299082#M60402</link>
      <description>&lt;P&gt;Try it...&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2016 05:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299082#M60402</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-17T05:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299084#M60403</link>
      <description>&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12988iC1CCB3A6ECE384B4/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="2016-09-17 (1).png" title="2016-09-17 (1).png" /&gt;</description>
      <pubDate>Sat, 17 Sep 2016 06:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299084#M60403</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T06:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299085#M60404</link>
      <description>Below is the screenshot of the output. I think something's wrong?</description>
      <pubDate>Sat, 17 Sep 2016 06:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299085#M60404</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T06:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299086#M60405</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52196"&gt;@SamuelRajKandru&lt;/a&gt; wrote:&lt;BR /&gt;Below is the screenshot of the output. I think something's wrong?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, that was the point of this little exercise, though not as bad as your output.&lt;/P&gt;
&lt;P&gt;Check the log to make sure no errors occurred.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2016 07:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299086#M60405</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-17T07:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299087#M60406</link>
      <description>&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;55&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;56 data test;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;57 input orig $5.;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;58 want=put("TA2", $jobf.);&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;59 cards;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote1_1474093954496" class="sasNote"&gt;NOTE: The data set WORK.TEST has 13 observations and 2 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote2_1474093954496" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.02 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;73 ;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;74 run;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;75&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;76 proc print data=test;run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote3_1474093954496" class="sasNote"&gt;NOTE: There were 13 observations read from the data set WORK.TEST.&lt;/DIV&gt;
&lt;DIV id="sasLogNote4_1474093954496" class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.07 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.08 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;77&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;90&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Sep 2016 07:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299087#M60406</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T07:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299089#M60407</link>
      <description>&lt;P&gt;Sorry, typo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Want=put(orig, $jobf.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Sep 2016 07:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299089#M60407</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-17T07:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299091#M60408</link>
      <description>&lt;P&gt;Okay, corrected the code and submitted it. There weren't any errors or warnings in the log.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12989iDE63C75E81ABD442/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="posttypo.png" title="posttypo.png" /&gt;</description>
      <pubDate>Sat, 17 Sep 2016 07:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299091#M60408</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T07:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299093#M60409</link>
      <description>&lt;P&gt;Okay, corrected the code and submitted it. There weren't any errors or warnings in the log.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12990iEB10FAF48EBC9F9A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="posttypo.png" title="posttypo.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12991i27530AC6B1D0BBD5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="posttypo.png" title="posttypo.png" /&gt;</description>
      <pubDate>Sat, 17 Sep 2016 07:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299093#M60409</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T07:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299094#M60410</link>
      <description>&lt;P&gt;So, are the results what you want? If so, your done.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2016 08:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299094#M60410</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-17T08:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299096#M60411</link>
      <description>Yes, I got the results! Thank you, Reeza!</description>
      <pubDate>Sat, 17 Sep 2016 08:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Format/m-p/299096#M60411</guid>
      <dc:creator>SamuelRajKandru</dc:creator>
      <dc:date>2016-09-17T08:29:35Z</dc:date>
    </item>
  </channel>
</rss>

