<?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: Numeric Format Error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472149#M70980</link>
    <description>&lt;P&gt;CAT() is the concatenate function and returns a character variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can either convert it back to numeric and apply a Z5 format or you can instead use some math to make a new variable v1*10000+ v2*1000 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131693"&gt;@lady8506&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to concatenate several variables into one variable called "result" that is numeric. The variables are all numeric with the format BEST12. and the informat 12. When I run the code below, I get the following error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;659 DATA want; set have;&lt;BR /&gt;660 result = cat(of v1-v5);&lt;BR /&gt;661 put result BEST12.;&lt;BR /&gt;-------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The format $BEST was not found or could not be loaded.&lt;/P&gt;
&lt;P&gt;662 RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code, please help me figure out why I am getting this error.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
	INPUT v1 v2 v3 v4 v5;
DATALINES;
0 1 0 1 1
0 0 0 0 0
1 1 0 1 1
1 1 1 1 1
1 0 0 0 1
0 1 1 0 0
1 1 1 0 1
0 0 1 1 0
;
RUN;

DATA want; set have;
result = cat(of v1-v5);
put result BEST12.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I want the numeric format for the "result" variable is for analysis purposes, to be able to run a PROC FREQ on this variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 15:22:39 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-06-21T15:22:39Z</dc:date>
    <item>
      <title>Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472146#M70979</link>
      <description>&lt;P&gt;I am trying to concatenate several variables into one variable called "result" that is numeric. The variables are all numeric with the format BEST12. and the informat 12. When I run the code below, I get the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;659 DATA want; set have;&lt;BR /&gt;660 result = cat(of v1-v5);&lt;BR /&gt;661 put result BEST12.;&lt;BR /&gt;-------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The format $BEST was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;662 RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code, please help me figure out why I am getting this error.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
	INPUT v1 v2 v3 v4 v5;
DATALINES;
0 1 0 1 1
0 0 0 0 0
1 1 0 1 1
1 1 1 1 1
1 0 0 0 1
0 1 1 0 0
1 1 1 0 1
0 0 1 1 0
;
RUN;

DATA want; set have;
result = cat(of v1-v5);
put result BEST12.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I want the numeric format for the "result" variable is for analysis purposes, to be able to run a PROC FREQ on this variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 15:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472146#M70979</guid>
      <dc:creator>lady8506</dc:creator>
      <dc:date>2018-06-21T15:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472149#M70980</link>
      <description>&lt;P&gt;CAT() is the concatenate function and returns a character variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can either convert it back to numeric and apply a Z5 format or you can instead use some math to make a new variable v1*10000+ v2*1000 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131693"&gt;@lady8506&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to concatenate several variables into one variable called "result" that is numeric. The variables are all numeric with the format BEST12. and the informat 12. When I run the code below, I get the following error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;659 DATA want; set have;&lt;BR /&gt;660 result = cat(of v1-v5);&lt;BR /&gt;661 put result BEST12.;&lt;BR /&gt;-------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The format $BEST was not found or could not be loaded.&lt;/P&gt;
&lt;P&gt;662 RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code, please help me figure out why I am getting this error.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
	INPUT v1 v2 v3 v4 v5;
DATALINES;
0 1 0 1 1
0 0 0 0 0
1 1 0 1 1
1 1 1 1 1
1 0 0 0 1
0 1 1 0 0
1 1 1 0 1
0 0 1 1 0
;
RUN;

DATA want; set have;
result = cat(of v1-v5);
put result BEST12.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I want the numeric format for the "result" variable is for analysis purposes, to be able to run a PROC FREQ on this variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 15:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472149#M70980</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-21T15:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472152#M70981</link>
      <description>&lt;P&gt;&lt;EM&gt;Make&lt;/EM&gt; it numeric:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want; set have;
result = input(cat(of v1-v5),best.);
put result BEST12.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 15:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472152#M70981</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T15:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472208#M70985</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131693"&gt;@lady8506&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I want the numeric format for the "result" variable is for analysis purposes, to be able to run a PROC FREQ on this variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PROC FREQ works with both character and numeric variables. Do you still see an advantage of having a &lt;EM&gt;numeric&lt;/EM&gt; variable &lt;FONT face="courier new,courier"&gt;result&lt;/FONT&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 16:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472208#M70985</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-06-21T16:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472285#M70988</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131693"&gt;@lady8506&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I want the numeric format for the "result" variable is for analysis purposes, to be able to run a PROC FREQ on this variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PROC FREQ works with both character and numeric variables. Do you still see an advantage of having a &lt;EM&gt;numeric&lt;/EM&gt; variable &lt;FONT face="courier new,courier"&gt;result&lt;/FONT&gt;?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I would suspect the OP only wants a single table instead of five tables and shouldn't care too much.&lt;/P&gt;
&lt;P&gt;But Proc tabulate would work with the 5 variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; class v1-v5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; table v1*v2*v3*v4*v5,&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; n colpctn&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though the appearance may not be "ideal"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472285#M70988</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-21T20:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472288#M70989</link>
      <description>&lt;P&gt;Probably where the LIST option from PROC FREQ comes in handy?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data random;
array v(*) v1-v5;
do i=1 to 100;
do j=1 to 5;
v(j) = rand('bernoulli', 0.3);
end;
output;
end;
run;

proc freq data=random;
table v1*v2*v3*v4*v5 / list out=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472288#M70989</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-21T20:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472482#M71000</link>
      <description>&lt;P&gt;I was finally able to solve my problem using a suggestion from Reeza that I convert it back to numeric with a Z5 format. Here is the code I used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA want; set have;&lt;BR /&gt;format result2 Z5.;&lt;BR /&gt;result = cat(of v1-v5);&lt;BR /&gt;put result $char.;&lt;BR /&gt;result2 = result;&lt;BR /&gt;RUN;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 13:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472482#M71000</guid>
      <dc:creator>lady8506</dc:creator>
      <dc:date>2018-06-22T13:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472504#M71001</link>
      <description>&lt;P&gt;That probably leaves a conversion note in your log that you don't want, otherwise it's hard to detect a real error from a conversion note.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want; set have;

result = input(cat(of v1-v5), 8.);
format result z5.;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 14:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Numeric-Format-Error/m-p/472504#M71001</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-22T14:47:00Z</dc:date>
    </item>
  </channel>
</rss>

