<?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 F in PUT function requires a numeric argument. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/829262#M327617</link>
    <description>&lt;P&gt;There are good replies to this question from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;all worth reading.&lt;BR /&gt;&lt;BR /&gt;What I am going to do is explain how to troubleshoot this question, and eventually get to the answer.&lt;BR /&gt;&lt;BR /&gt;The first thing to do is simplify the issue, by identifing the where the issue is occurring and focusing on that.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The error message gives us the first clue, indicating an issue with the &lt;FONT face="courier new,courier"&gt;PUT&lt;/FONT&gt; function&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;ERROR: Numeric format F &lt;FONT color="#FF0000"&gt;in PUT function&lt;/FONT&gt; requires a numeric argument.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;In the code we can see there's just 1 line containing a &lt;FONT face="courier new,courier"&gt;PUT&lt;/FONT&gt; function, and really one expression:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Now we want to create a simple data step program to simulate the variables that this expression uses, and break this expression up into individual function calls:&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;

	/* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	/* create the variables used in the expression above */
	AccNrSet=1234 ;
	acc_no="5678" ;
	serial_no="9012" ;
	put "Start " AccNrSet= acc_no= serial_no= ; ;
	/* Break the expression up into small chuncks */
	/* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	a=PUT(ACC_NO,13.) ;
	put "1     " a= ;
	/* INPUT(PUT(COMPRESS(INPUT(a,$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	b=INPUT(a,$13.) ;
	put "2     " b= ;
	/* INPUT(PUT(COMPRESS(b||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	c=PUT(SERIAL_NO,Z3.) ;
	put "3     " b= ;
	/* INPUT(PUT(COMPRESS(b||c),$16.),16.) */
	d=COMPRESS(b||c) ;
	put "4     " b= ;
	/* INPUT(PUT(d,$16.),16.) */
	e=PUT(d,$16.) ;
	put "5     " b= ;
	/* INPUT(e,16.) */
	f=INPUT(e,16.) ;
	put "6     " b= ;

run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I pulled the variable definitions from the other replies in the post, then took the expression and broke it up into individual function calls. I also added comments and &lt;FONT face="courier new,courier"&gt;put&lt;/FONT&gt; statements so I could see what the values were as the code ran in the log:&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;47   data _null_ ;
48
49       /* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
50       /* create the variables used in the expression above */
51       AccNrSet=1234 ;
52       acc_no="5678" ;
53       serial_no="9012" ;
54       put "Start " AccNrSet= acc_no= serial_no= ; ;
55       /* Break the expression up into small chuncks */
56       /* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
57       a=PUT(ACC_NO,13.) ;
58       put "1     " a= ;
59       /* INPUT(PUT(COMPRESS(INPUT(a,$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
60       b=INPUT(a,$13.) ;
61       put "2     " b= ;
62       /* INPUT(PUT(COMPRESS(b||PUT(SERIAL_NO,Z3.)),$16.),16.) */
63       c=PUT(SERIAL_NO,Z3.) ;
                         ---
                         48
ERROR 48-59: The format $Z was not found or could not be loaded.

64       put "3     " b= ;
65       /* INPUT(PUT(COMPRESS(b||c),$16.),16.) */
66       d=COMPRESS(b||c) ;
67       put "4     " b= ;
68       /* INPUT(PUT(d,$16.),16.) */
69       e=PUT(d,$16.) ;
70       put "5     " b= ;
71       /* INPUT(e,16.) */
72       f=INPUT(e,16.) ;
73       put "6     " b= ;
74
75   run ;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;As you can see the code failed to compile and reported the following error (granted not identical but similar to the error reported in the post):&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;63       c=PUT(SERIAL_NO,Z3.) ;
                         ---
                         48
ERROR 48-59: The format $Z was not found or could not be loaded.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Next let's review the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0mlfb88dkhbmun1x08qbh5xbs7e.htm" target="_self"&gt;PUT function&lt;/A&gt; documentation (I've just copied the important part):&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-restriction" width="46px"&gt;Restriction&lt;/TH&gt;
&lt;TD width="1100px" class="xisDoc-summaryText"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format&lt;/EM&gt;. must be of the same type as the source, either character or numeric. That is, &lt;FONT color="#FF0000"&gt;if the source is character, the format name must begin with a dollar sign, but if the source is numeric, the format name must not begin with a dollar sign&lt;/FONT&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;BR /&gt;After reviewing the documentation and the error, we can see the variable &lt;FONT face="courier new,courier"&gt;serial_no&lt;/FONT&gt; is a character variable, so as per the documentation, the format name &lt;FONT color="#FF0000"&gt;MUST&lt;/FONT&gt; begin with a dollar sign. &lt;BR /&gt;The format is &lt;FONT face="courier new,courier"&gt;Z3.&lt;/FONT&gt; which doesn't start with a dollar sign (&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;) and hence we get an error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Aug 2022 18:04:46 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2022-08-18T18:04:46Z</dc:date>
    <item>
      <title>ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789488#M252634</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;BR /&gt;My code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;
CREATE TABLE TEST AS 
SELECT NEW_ACC,ACC_NO
FROM WRK.BRACC_SYST_04  A
INNER JOIN WORK.CARD99_PARSED B

ON A.AccNrSer = INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.)

;QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 15:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789488#M252634</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2022-01-11T15:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789504#M252638</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your PUT function requires a numeric variable, you are trying to use it on a character variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For everyone's benefit, from now on do not separate the errors in the log from the code in the log. Show us the ENTIRE log so we can see the code as it appears in the log, plus the ERRORs, WARNINGs and NOTEs.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789504#M252638</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-11T16:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789513#M252641</link>
      <description>&lt;P&gt;below is the log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 16:51 Tuesday, January 11, 2022&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (2)';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=PNG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 FILENAME EGSR TEMP;&lt;BR /&gt;15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;16 STYLE=HtmlBlue&lt;BR /&gt;17 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;BR /&gt;18 NOGTITLE&lt;BR /&gt;19 NOGFOOTNOTE&lt;BR /&gt;20 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;21 ENCODING=UTF8&lt;BR /&gt;22 options(rolap="on")&lt;BR /&gt;23 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;26 PROC SQL;&lt;BR /&gt;27 CREATE TABLE TEST AS&lt;BR /&gt;28 SELECT NEW_ACC,ACC_NO&lt;BR /&gt;29 FROM WRK.BRACC_SYST_04 A&lt;BR /&gt;30 INNER JOIN WORK.CARD99_PARSED B&lt;BR /&gt;31&lt;BR /&gt;32 /*ON A.AccNrSer = INPUT(COMPRESS((PUT(B.ACC_NO,Z13.))||PUT(B.SERIAL_NO,Z3.)),16.)*/&lt;BR /&gt;33 ON A.AccNrSer = INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.)&lt;BR /&gt;34 /*ON A.NEW_ACC = INPUT(B.ACC_NO,11.)*/&lt;BR /&gt;35&lt;BR /&gt;36 ;&lt;BR /&gt;ERROR: Numeric format F in PUT function requires a numeric argument.&lt;BR /&gt;ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;ERROR: Numeric format F in PUT function requires a numeric argument.&lt;BR /&gt;ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2022-01-11T17:42:00,469+02:00| _DISARM| WorkspaceServer| _DISARM| SAS|&lt;BR /&gt;_DISARM| | _DISARM| 1625220| _DISARM| 31887360| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 40| _DISARM| 0.000000|&lt;BR /&gt;_DISARM| 0.001953| _DISARM| 1957534920.468052| _DISARM| 1957534920.470005| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2022-01-11T17:42:00,470+02:00| _DISARM| WorkspaceServer| _DISARM| SAS|&lt;BR /&gt;_DISARM| | _DISARM| 115344| _DISARM| 31887360| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 40| _DISARM| 0.000000| _DISARM|&lt;BR /&gt;0.000901| _DISARM| 1957534920.469315| _DISARM| 1957534920.470216| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;36 ! QUIT;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE| _DISARM| STOP| _DISARM| 2022-01-11T17:42:00,479+02:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| |&lt;BR /&gt;_DISARM| 1111285760| _DISARM| 31887360| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 40| _DISARM| 0.010000| _DISARM|&lt;BR /&gt;0.015457| _DISARM| 1957534920.463991| _DISARM| 1957534920.479448| _DISARM| 0.010000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.01 seconds&lt;BR /&gt;2 The SAS System 16:51 Tuesday, January 11, 2022&lt;/P&gt;&lt;P&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 5900.50k&lt;BR /&gt;OS Memory 36264.00k&lt;BR /&gt;Timestamp 2022/01/11 05:42:00 PM&lt;BR /&gt;Step Count 47 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 21&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 5&lt;BR /&gt;Involuntary Context Switches 1&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 0&lt;BR /&gt;&lt;BR /&gt;37&lt;BR /&gt;38 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;39 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;40 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;41 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;42 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;43 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;44 %LET _SASPROGRAMFILE=;&lt;BR /&gt;45 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;46&lt;BR /&gt;47 ;*';*";*/;quit;run;&lt;BR /&gt;48 ODS _ALL_ CLOSE;&lt;BR /&gt;49&lt;BR /&gt;50&lt;BR /&gt;51 QUIT; RUN;&lt;BR /&gt;52&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789513#M252641</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2022-01-11T16:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789522#M252642</link>
      <description>&lt;P&gt;When you're building a nested function like that, I recommend testing each portion and then adding it together slowly. &lt;BR /&gt;&lt;BR /&gt;For example this: INPUT(PUT(B.ACC_NO,13.),$13.) doesn't seem super useful. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data check;
set card99_parsed (obs=100);
accrNrSer = INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789522#M252642</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-11T16:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789534#M252647</link>
      <description>&lt;P&gt;Good point&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;, none of this seems useful or necessary to concatenate two ID variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ON A.AccNrSer =&amp;nbsp;cat(B.ACC_NO,PUT(SERIAL_NO,Z3.))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789534#M252647</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-11T16:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789645#M252715</link>
      <description>&lt;P&gt;I have apply the the below , however am still getting the same error message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;
CREATE TABLE TEST AS 
SELECT NEW_ACC,ACC_NO
FROM WRK.BRACC_SYST_06  A
INNER JOIN WORK.CARD99_PARSED B

ON A.AccNrSer = cat(B.ACC_NO,PUT(B.SERIAL_NO,Z3.))

;QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 09:01 Wednesday, January 12, 2022&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (2)';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=PNG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 FILENAME EGSR TEMP;&lt;BR /&gt;15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;16 STYLE=HtmlBlue&lt;BR /&gt;17 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;BR /&gt;18 NOGTITLE&lt;BR /&gt;19 NOGFOOTNOTE&lt;BR /&gt;20 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;21 ENCODING=UTF8&lt;BR /&gt;22 options(rolap="on")&lt;BR /&gt;23 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 PROC SQL;&lt;BR /&gt;27 CREATE TABLE TEST AS&lt;BR /&gt;28 SELECT NEW_ACC,ACC_NO&lt;BR /&gt;29 FROM WRK.BRACC_SYST_06 A&lt;BR /&gt;30 INNER JOIN WORK.CARD99_PARSED B&lt;BR /&gt;31&lt;BR /&gt;32 ON A.AccNrSer = cat(B.ACC_NO,PUT(B.SERIAL_NO,Z3.))&lt;BR /&gt;33&lt;BR /&gt;34 ;&lt;BR /&gt;ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;BR /&gt;ERROR: Numeric format Z in PUT function requires a numeric argument.&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2022-01-12T09:18:00,485+02:00| _DISARM| WorkspaceServer| _DISARM| SAS|&lt;BR /&gt;_DISARM| | _DISARM| 1625279| _DISARM| 29790208| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 8772712| _DISARM| 0.000000|&lt;BR /&gt;_DISARM| 0.002279| _DISARM| 1957591080.483530| _DISARM| 1957591080.485809| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2022-01-12T09:18:00,486+02:00| _DISARM| WorkspaceServer| _DISARM| SAS|&lt;BR /&gt;_DISARM| | _DISARM| 115344| _DISARM| 29790208| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 8772712| _DISARM| 0.000000|&lt;BR /&gt;_DISARM| 0.001916| _DISARM| 1957591080.484163| _DISARM| 1957591080.486079| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;34 ! QUIT;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE| _DISARM| STOP| _DISARM| 2022-01-12T09:18:00,486+02:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| |&lt;BR /&gt;_DISARM| 1109712896| _DISARM| 29790208| _DISARM| 13| _DISARM| 36| _DISARM| 0| _DISARM| 8772712| _DISARM| 0.000000| _DISARM|&lt;BR /&gt;0.014387| _DISARM| 1957591080.472146| _DISARM| 1957591080.486533| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 5897.15k&lt;BR /&gt;OS Memory 34216.00k&lt;BR /&gt;Timestamp 2022/01/12 09:18:00 AM&lt;BR /&gt;Step Count 32 Switch Count 0&lt;BR /&gt;2 The SAS System 09:01 Wednesday, January 12, 2022&lt;/P&gt;&lt;P&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 56&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 5&lt;BR /&gt;Involuntary Context Switches 5&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 0&lt;BR /&gt;&lt;BR /&gt;35&lt;BR /&gt;36 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;37 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;38 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;39 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;40 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;41 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;42 %LET _SASPROGRAMFILE=;&lt;BR /&gt;43 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;44&lt;BR /&gt;45 ;*';*";*/;quit;run;&lt;BR /&gt;46 ODS _ALL_ CLOSE;&lt;BR /&gt;47&lt;BR /&gt;48&lt;BR /&gt;49 QUIT; RUN;&lt;BR /&gt;50&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 07:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789645#M252715</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2022-01-12T07:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789648#M252717</link>
      <description>&lt;P&gt;COMPRESS is a character function, so you can't use PUT with a numeric format for it.&lt;/P&gt;
&lt;P&gt;And SERIAL_NO is obviously a character variable, so again you cannot use a numeric format for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxim 3: Know Your Data.&lt;/P&gt;
&lt;P&gt;Inspect the dataset(s) for variable types.&lt;/P&gt;
&lt;P&gt;Next get a good picture of the real contents, so you can decide how you must concatenate them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the data types of the three variable used in the ON clause, ideally by copy/pasting the relevant lines from a PROC CONTENTS output.&lt;/P&gt;
&lt;P&gt;Next show typical content of these variables.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789648#M252717</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-12T08:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789945#M252867</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; as per you request see below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC CONTENTS DATA=WRK.BRACC_SYST_06;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rixile106_0-1642071859137.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67368iD152A0596BDEC710/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rixile106_0-1642071859137.png" alt="Rixile106_0-1642071859137.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC CONTENTS DATA=CARD99_PARSED;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rixile106_1-1642071989300.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67369i03DBC9820BB3746F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rixile106_1-1642071989300.png" alt="Rixile106_1-1642071989300.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rixile106_2-1642072064061.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67370i1C7A4A83B8C2940C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rixile106_2-1642072064061.png" alt="Rixile106_2-1642072064061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 11:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789945#M252867</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2022-01-13T11:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789953#M252874</link>
      <description>&lt;P&gt;So, AccNrSer is numeric, which you cannot compare to the result of a CAT function, which is character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The two character variables are both 32 characters long, and since CAT does not remove trailing blanks, the result will be 64(!) characters long, which does not make sense in any way as a number (SAS can't handle more than 15 decimal digits reliably).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I see, you first have a problem by storing an account number as a number. You never do calculations with account "numbers", which are rather codes. So you should create this variable as character in the first place when you import your data into SAS.&lt;/P&gt;
&lt;P&gt;Next, you need to take care to create the same structure you have in&amp;nbsp;AccNrSer when you concatenate the other two variables; to get this right, we need to know the contents of these, and the contents of a correctly (character!) imported&amp;nbsp;AccNrSer.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 11:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/789953#M252874</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-13T11:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric format F in PUT function requires a numeric argument.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/829262#M327617</link>
      <description>&lt;P&gt;There are good replies to this question from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;all worth reading.&lt;BR /&gt;&lt;BR /&gt;What I am going to do is explain how to troubleshoot this question, and eventually get to the answer.&lt;BR /&gt;&lt;BR /&gt;The first thing to do is simplify the issue, by identifing the where the issue is occurring and focusing on that.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The error message gives us the first clue, indicating an issue with the &lt;FONT face="courier new,courier"&gt;PUT&lt;/FONT&gt; function&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;ERROR: Numeric format F &lt;FONT color="#FF0000"&gt;in PUT function&lt;/FONT&gt; requires a numeric argument.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;In the code we can see there's just 1 line containing a &lt;FONT face="courier new,courier"&gt;PUT&lt;/FONT&gt; function, and really one expression:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Now we want to create a simple data step program to simulate the variables that this expression uses, and break this expression up into individual function calls:&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;

	/* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	/* create the variables used in the expression above */
	AccNrSet=1234 ;
	acc_no="5678" ;
	serial_no="9012" ;
	put "Start " AccNrSet= acc_no= serial_no= ; ;
	/* Break the expression up into small chuncks */
	/* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	a=PUT(ACC_NO,13.) ;
	put "1     " a= ;
	/* INPUT(PUT(COMPRESS(INPUT(a,$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	b=INPUT(a,$13.) ;
	put "2     " b= ;
	/* INPUT(PUT(COMPRESS(b||PUT(SERIAL_NO,Z3.)),$16.),16.) */
	c=PUT(SERIAL_NO,Z3.) ;
	put "3     " b= ;
	/* INPUT(PUT(COMPRESS(b||c),$16.),16.) */
	d=COMPRESS(b||c) ;
	put "4     " b= ;
	/* INPUT(PUT(d,$16.),16.) */
	e=PUT(d,$16.) ;
	put "5     " b= ;
	/* INPUT(e,16.) */
	f=INPUT(e,16.) ;
	put "6     " b= ;

run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I pulled the variable definitions from the other replies in the post, then took the expression and broke it up into individual function calls. I also added comments and &lt;FONT face="courier new,courier"&gt;put&lt;/FONT&gt; statements so I could see what the values were as the code ran in the log:&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;47   data _null_ ;
48
49       /* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
50       /* create the variables used in the expression above */
51       AccNrSet=1234 ;
52       acc_no="5678" ;
53       serial_no="9012" ;
54       put "Start " AccNrSet= acc_no= serial_no= ; ;
55       /* Break the expression up into small chuncks */
56       /* INPUT(PUT(COMPRESS(INPUT(PUT(B.ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
57       a=PUT(ACC_NO,13.) ;
58       put "1     " a= ;
59       /* INPUT(PUT(COMPRESS(INPUT(a,$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) */
60       b=INPUT(a,$13.) ;
61       put "2     " b= ;
62       /* INPUT(PUT(COMPRESS(b||PUT(SERIAL_NO,Z3.)),$16.),16.) */
63       c=PUT(SERIAL_NO,Z3.) ;
                         ---
                         48
ERROR 48-59: The format $Z was not found or could not be loaded.

64       put "3     " b= ;
65       /* INPUT(PUT(COMPRESS(b||c),$16.),16.) */
66       d=COMPRESS(b||c) ;
67       put "4     " b= ;
68       /* INPUT(PUT(d,$16.),16.) */
69       e=PUT(d,$16.) ;
70       put "5     " b= ;
71       /* INPUT(e,16.) */
72       f=INPUT(e,16.) ;
73       put "6     " b= ;
74
75   run ;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;As you can see the code failed to compile and reported the following error (granted not identical but similar to the error reported in the post):&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;63       c=PUT(SERIAL_NO,Z3.) ;
                         ---
                         48
ERROR 48-59: The format $Z was not found or could not be loaded.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Next let's review the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0mlfb88dkhbmun1x08qbh5xbs7e.htm" target="_self"&gt;PUT function&lt;/A&gt; documentation (I've just copied the important part):&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-restriction" width="46px"&gt;Restriction&lt;/TH&gt;
&lt;TD width="1100px" class="xisDoc-summaryText"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format&lt;/EM&gt;. must be of the same type as the source, either character or numeric. That is, &lt;FONT color="#FF0000"&gt;if the source is character, the format name must begin with a dollar sign, but if the source is numeric, the format name must not begin with a dollar sign&lt;/FONT&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;BR /&gt;After reviewing the documentation and the error, we can see the variable &lt;FONT face="courier new,courier"&gt;serial_no&lt;/FONT&gt; is a character variable, so as per the documentation, the format name &lt;FONT color="#FF0000"&gt;MUST&lt;/FONT&gt; begin with a dollar sign. &lt;BR /&gt;The format is &lt;FONT face="courier new,courier"&gt;Z3.&lt;/FONT&gt; which doesn't start with a dollar sign (&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;) and hence we get an error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 18:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Numeric-format-F-in-PUT-function-requires-a-numeric/m-p/829262#M327617</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-08-18T18:04:46Z</dc:date>
    </item>
  </channel>
</rss>

