<?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: comparing varchar(13) loan number to numeric (10,) loan number in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153913#M40447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;change input to put&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Sorry about that, its nap time now &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2015 20:49:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-02-04T20:49:24Z</dc:date>
    <item>
      <title>comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153908#M40442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Hi &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The below are just examples to use to ask my question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I am trying to change the below proc sql using ODBC to the one below that due to other fields created in previous code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The loan_num and loan_no are being compared in the final query but proc contents of each table shows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;LOAN_NO Num 8 11. 11.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Loan_Num Char 13 $13. $13. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Kartika;"&gt;I have been unable to research and find the syntax to convert the numeric loan_no to character or visa versa.&amp;nbsp; Any help much appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;connect to odbc (noprompt="Driver={SQL Server};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server=THIS IS INTENTIONALLY LEFT BLANK FOR PRIVACY REASONS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database=daisy001");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;create table test2 as select * from connection to odbc &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;(select m1.loan_num, cast(lc.loan_no as varchar) from cpidata.dbo.tbl14 lc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;left join daisy001.dbo.master1 m1 on m1.loan_num = lc.loan_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;where m1.loan_num = lc.loan_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;);quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I want to code as this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;create table test1 as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;(select m1.loan_num, lc.loan_no from PAPCPI.tbl14 lc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;left join PAPDSY1.master1 m1 on m1.loan_num = lc.loan_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;where m1.loan_num = lc.loan_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;);quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153908#M40442</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T20:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153909#M40443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the INPUT function to convert character to numeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="https://ciser.cornell.edu/faq/sas/char2num.shtml" title="https://ciser.cornell.edu/faq/sas/char2num.shtml"&gt;https://ciser.cornell.edu/faq/sas/char2num.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to trim loan_num because of the trailing spaces to get a match.&amp;nbsp; &lt;/P&gt;&lt;P&gt;If you have leading zeros you may want to use Z8, instead of 8 below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;create table test1 as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;(select m1.loan_num, lc.loan_no from PAPCPI.tbl14 lc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;left join PAPDSY1.master1 m1 on m1.loan_num = lc.loan_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;where trim(m1.loan_num) = input(lc.loan_no, 8. -l)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;);quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153909#M40443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T20:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153910#M40444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your quick response.&lt;/P&gt;&lt;P&gt;I ran your suggestion and received this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;P&gt;ERROR: INPUT function requires a character argument.&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153910#M40444</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T20:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153911#M40445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, I didn't look closely at your code, you have a ON and WHERE and you only need one, preferably the ON&lt;/P&gt;&lt;P&gt;This assumes that loan_num is CHAR, and loan_no is Numeric as indicated above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;create table test1 as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;select m1.loan_num, lc.loan_no from PAPCPI.tbl14 lc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;left join PAPDSY1.master1 m1 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;ON trim(m1.loan_num) = input(lc.loan_no, 8. -l)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153911#M40445</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T20:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153912#M40446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still getting the input function requires a character argument.&amp;nbsp; Loan_no is numeric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153912#M40446</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T20:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153913#M40447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;change input to put&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Sorry about that, its nap time now &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153913#M40447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T20:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153914#M40448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You either need both variables as numeric or both as character. I would go for character to allow for the already existing character variable to have values other than digits.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;on left(m1.loan_num) = put(lc.loan_no, 13.)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;Why do you want to change the explicit SQL to an implicit one? Using an explicit SQL has the advantage that you're under full control what SQL gets sent to the data base for execution. With implicit SQL using the SAS SQL flavor there is a good chance that a SAS function can't get translated into a data base function which results in SAS first loading all the data into SAS and only then applying the functions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;In your case: "&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;put(lc.loan_no, 13.)&lt;/SPAN&gt;" won't get translated so SAS will first have to load both tables into SAS and only then apply the where clause.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A search like below will show you which SAS functions can get translated for your data base "site:support.sas.com 9.4 passing SAS functions to &amp;lt;&lt;EM&gt;your data base&amp;gt;&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If using implicit SQL as you want to then make sure that you also use option &lt;SPAN style="line-height: 1.5em; color: #545454; font-family: arial, sans-serif; font-size: small; background-color: #ffffff;"&gt;OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-weight: bold; color: #545454; font-family: arial, sans-serif; font-size: small; background-color: #ffffff;"&gt;NOSTSUFFIX&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #545454; font-family: arial, sans-serif; font-size: small; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; as this will show you in the SAS log what part of the SQL SAS was able to send to the data base.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153914#M40448</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-04T20:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153915#M40449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I mentioned in the original post that we are using this implicit sql because there are other tables we have created previously that need to be joined into this query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just a small snippet of the entire query as this is showing the exact problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 20:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153915#M40449</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T20:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153916#M40450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still, try to reduce volumes on the database side as much as possible before you "suck" the data into SAS - unless the volumes are so low that it doesn't matter and you prefer to go for simple code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else: The code snippet I've posted should work. With SAS you need a PUT() function to cast from numeric to character.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153916#M40450</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-04T21:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153917#M40451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it was running so I thought we were going to be okay but no luck.&amp;nbsp; No I have no idea what is happening. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Reeza: When I run your code I get back &lt;STRONG&gt;NOTHING &lt;/STRONG&gt;in the loan_num column and the loan_no(s) are anywhere from 2 to 8 digits which means the leading zeros in loan_no were dropped. &lt;/P&gt;&lt;P&gt;Loan_Num LOAN_NO&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 75&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 208&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 521&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 950&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1115&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1131&lt;/P&gt;&lt;P&gt;&amp;nbsp; through to &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 508353265&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test3 as &lt;/P&gt;&lt;P&gt;select m1.loan_num, lc.loan_no from PAPCPI.tbl14 lc&lt;/P&gt;&lt;P&gt;left join PAPDSY1.master1 m1 ON trim(m1.loan_num) = put(lc.loan_no, Z8. -l)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick:&amp;nbsp; Your suggestion returns the same as Reeza's.&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test3 as &lt;/P&gt;&lt;P&gt;select m1.loan_num, lc.loan_no from PAPCPI.tbl14 lc&lt;/P&gt;&lt;P&gt;left join PAPDSY1.master1 m1 ON left(m1.loan_num) = put(lc.loan_no, 13.)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:smileyconfused:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153917#M40451</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T21:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153918#M40452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the loan_no(s) to show correctly by using this: strip(put(lc.loan_no,10.))&amp;nbsp; Do you know what is causing the blank column?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153918#M40452</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T21:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153919#M40453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your Join try this:&amp;nbsp; Left join daisy001.dbo.master1 m1 on LTrim(m1.loan_num,0) = lc.loan_no&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LTrim will remove leading zeroes from loan_num.&amp;nbsp; Syntax is LTrim(column name,character value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153919#M40453</guid>
      <dc:creator>Zugati</dc:creator>
      <dc:date>2015-02-04T21:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153920#M40454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - didn't say thank you for your suggestion..&lt;/P&gt;&lt;P&gt;ERROR: Function LTRIM could not be located.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153920#M40454</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-04T21:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153921#M40455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Try the following, if it doesn't work, post samples of your data, both columns&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc sql;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;create table test3 as &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;select trim(m1.loan_num) as loan_num, put(lc.loan_no, Z8. -l) as loan_no&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;from PAPCPI.tbl14 lc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;left join PAPDSY1.master1 m1 ON&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;trim(m1.loan_num) = put(lc.loan_no, Z8. -l)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 23:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153921#M40455</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T23:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153922#M40456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NOTE: Table WORK.TEST4 created, with 476272 rows and 2 columns.&lt;/P&gt;&lt;P&gt;NOTE: At least one W.D format was too small for the number to be printed. The decimal may be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shifted by the "BEST" format.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4:19.91&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.63 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;column two is correct with the new query but column one is still blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't post actual information.&amp;nbsp; Numbers look like this in their correct format - 0012345678 and 12345678&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your continued assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 14:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153922#M40456</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-05T14:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: comparing varchar(13) loan number to numeric (10,) loan number</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153923#M40457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again to everyone for your help.&amp;nbsp; I have reached out to the tech team here and they advised that there is another table that has the loan numbers already formatted so I can use that in my join!&amp;nbsp; We were not aware of this as the tables we are working with are new to our team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 17:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/comparing-varchar-13-loan-number-to-numeric-10-loan-number/m-p/153923#M40457</guid>
      <dc:creator>jacqelynl49</dc:creator>
      <dc:date>2015-02-05T17:17:04Z</dc:date>
    </item>
  </channel>
</rss>

