<?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: ERROR: Numeric format Z in PUT function requires a numeric argument in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680051#M205442</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;##- Please type your reply above this line. No attachments.&lt;BR /&gt;character&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you are trying to use the Z. format on a character variable. This cannot be done. You cannot convert a character variable using the Z. format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please explain in words (not SAS code), and give an example or two or three, of what these character variables look like and what you want to convert them into.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 16:01:49 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-08-28T16:01:49Z</dc:date>
    <item>
      <title>ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679822#M205325</link>
      <description>&lt;P&gt;Hi Dears,&lt;/P&gt;
&lt;P&gt;im getting below error in SAS DI, please can you help to resolve this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;case&lt;/P&gt;
&lt;P&gt;when INPUT(SUBSTR(PUT(DBLNSIA ,Z6.),3,4) || SUBSTR(PUT(DBLNSIA ,Z6.),1,2) || '01',11.) = 0 then -1&lt;/P&gt;
&lt;P&gt;else INPUT(SUBSTR(PUT(DBLNSIA ,Z6.),3,4) || SUBSTR(PUT(DBLNSIA ,Z6.),1,2) || '01',11.)&lt;/P&gt;
&lt;P&gt;end&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Line 593: ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 17:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679822#M205325</guid>
      <dc:creator>dhruvakumar</dc:creator>
      <dc:date>2020-08-27T17:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679824#M205327</link>
      <description>&lt;P&gt;Variable&amp;nbsp;&lt;SPAN&gt;DBLNSIA&amp;nbsp;is not numeric, so you can't convert it to character using the PUT statement with the Z6. format. Z6. can only work on numeric variables.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 17:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679824#M205327</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-27T17:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679826#M205328</link>
      <description>&lt;P&gt;HI Thanks for reply. May I know what can I use there please&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 17:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679826#M205328</guid>
      <dc:creator>dhruvakumar</dc:creator>
      <dc:date>2020-08-27T17:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679883#M205353</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI Thanks for reply. May I know what can I use there please&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Kind of need to know what the values of DBLNSIA look like and what you expect for a result.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 19:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679883#M205353</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-27T19:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679890#M205359</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI Thanks for reply. May I know what can I use there please&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Important debugging tool ... look at variable&amp;nbsp;&lt;SPAN&gt;DBLNSIA&amp;nbsp;and see if it is numeric or character, and look at the values of&amp;nbsp;DBLNSIA. Do they look like numbers, or do some of them have non-numeric characters? What do you see?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 19:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679890#M205359</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-27T19:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679893#M205361</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;when INPUT(
  SUBSTR(PUT(DBLNSIA ,Z6.),3,4) ||
  SUBSTR(PUT(DBLNSIA ,Z6.),1,2) ||
  '01',
11.) = 0 then -1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No matter what, you build a string that ends in a 1, and input that; this number can never be zero, so this part of the code makes absolutely no sense.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 20:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679893#M205361</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-27T20:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679978#M205411</link>
      <description>##- Please type your reply above this line. No attachments.&lt;BR /&gt;character</description>
      <pubDate>Fri, 28 Aug 2020 09:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/679978#M205411</guid>
      <dc:creator>dhruvakumar</dc:creator>
      <dc:date>2020-08-28T09:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680047#M205439</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;##- Please type your reply above this line. No attachments.&lt;BR /&gt;character&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;42 ?!?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 15:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680047#M205439</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-28T15:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680051#M205442</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;##- Please type your reply above this line. No attachments.&lt;BR /&gt;character&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you are trying to use the Z. format on a character variable. This cannot be done. You cannot convert a character variable using the Z. format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please explain in words (not SAS code), and give an example or two or three, of what these character variables look like and what you want to convert them into.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 16:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680051#M205442</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-28T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format Z in PUT function requires a numeric argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680101#M205464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203162"&gt;@dhruvakumar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may be having a difficulty understanding what a variable type is. SAS supports two basic types of variables, numeric, that hold values used for arithmetic, and character, that hold text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes character values look like numbers. These cannot use a numeric type of format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error message says that is what you have attempted to do.&lt;/P&gt;
&lt;P&gt;Two examples of using the Z format. One correct:&lt;/P&gt;
&lt;PRE&gt;data example1;
  /* this a numeric value*/
   x= 3;
   y=put(x,z4.);
run;&lt;/PRE&gt;
&lt;P&gt;one incorrect:&lt;/P&gt;
&lt;PRE&gt;data example2;
  /* this a character value*/
   x= "3";
   y=put(x,z4.);
run;&lt;/PRE&gt;
&lt;P&gt;Running the Example2 code will have a log like:&lt;/P&gt;
&lt;PRE&gt;69   data example2;
70     /* this a character value*/
71      x= "3";
72      y=put(x,z4.);
                ---
                484
NOTE 484-185: Format $Z was not found or could not be loaded.

73   run;
&lt;/PRE&gt;
&lt;P&gt;The note about format $Z is because only character formats, whose names will start with $, are allowed with character variables.&lt;/P&gt;
&lt;P&gt;In other places, like your case statement that may become an error because of different syntax rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may well be a way to make things work as you need but you have not provided 1) any actual examples of the values of your variable or 2) what the expected output for those given values would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 16:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-Z-in-PUT-function-requires-a-numeric/m-p/680101#M205464</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-11T16:13:27Z</dc:date>
    </item>
  </channel>
</rss>

