<?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: Create snowflake table as select from sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992067#M380406</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13871"&gt;@DBailey&lt;/a&gt;! Can you add these lines to your program before PROC SQL and post the results? (Just make sure there's nothing sensitive first)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace=',,,d' sastraceloc=saslog;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2026 16:48:44 GMT</pubDate>
    <dc:creator>Stu_SAS</dc:creator>
    <dc:date>2026-08-13T16:48:44Z</dc:date>
    <item>
      <title>Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992048#M380405</link>
      <description>&lt;P&gt;I have an issue creating a table in snowflake using proc sql.&amp;nbsp; I know that behind the scenes, sas is creating a file, putting it to the snowflake stage, and then using snowflake copy to actually load the table.&amp;nbsp; During the copy part, it seems as the column definitions are getting mismatched....where the copy is trying to load a text value into a numeric column.&amp;nbsp; Here's the relevant portion of the log where you can see that it's trying to insert the value 'SOLE OWNER' (which is actually the ACCT_RELAT_NAME) into the IP_ID column (which is numeric but physically just before the ACCT_RELAT_NAME attribute).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;NOTE: Get Base Accounts&lt;BR /&gt;189 execute by sf (drop table if exists r2_base_accounts);&lt;BR /&gt;190 create table snwfk.r2_base_accounts (bulkload=yes) as&lt;BR /&gt;191 select&lt;BR /&gt;192 e.*&lt;BR /&gt;193 ,dhms(date(),0,0,0) as LOAD_DATE format=datetime20.&lt;BR /&gt;194 from connection to edw (&lt;BR /&gt;195 SELECT&lt;BR /&gt;196 AR.BUSINESS_Date&lt;BR /&gt;197 ,AR.AR_ID&lt;BR /&gt;198 ,AR.ACCT_ID_IN_WH&lt;BR /&gt;199 ,ar.BANK_NBR&lt;BR /&gt;200 ,ar.BRNCH_NBR&lt;BR /&gt;201 ,AR.SRC_SYS_CODE&lt;BR /&gt;202 ,AR.AR_TYPE_NAME&lt;BR /&gt;203 ,AR.PRIM_OFFICER_CODE&lt;/P&gt;
&lt;P&gt;204 ,ar.ALT_OFFICER_CODE&lt;BR /&gt;205 ,ar.SAD_OFFICER_CODE&lt;BR /&gt;206 ,hp.levl_2_name product_domain&lt;BR /&gt;207 ,hp.levl_3_name product_super_class&lt;BR /&gt;208 ,hp.levl_4_name product_class&lt;BR /&gt;209 ,hp.levl_6_name product_group&lt;BR /&gt;210 ,hp.levl_7_name product_sub_group&lt;BR /&gt;211 ,AR.HIER_PRODUCT_TYPE_CODE product_id&lt;BR /&gt;212 ,hp.leaf_levl_name product_desc&lt;BR /&gt;213 ,hp.PRODUCT_PTYPE_CODE ptype&lt;BR /&gt;214 ,hp.LOB_CODE product_lob&lt;BR /&gt;215 ,AR.BS_SEG_CODE&lt;BR /&gt;216 ,AR.COST_CENTER&lt;BR /&gt;217 ,ar2ip.ip_id&lt;BR /&gt;218 ,ar2ip.acct_relat_name&lt;BR /&gt;219 ,ip.ip_id_in_wh&lt;BR /&gt;220 ,ip.ip_type_code&lt;BR /&gt;221 ,ip.ip_name&lt;BR /&gt;222 ,ip.LEGAL_RSDNT_TYPE_name&lt;BR /&gt;223 ,ip.hh_id_in_wh HOUSEHOLD_ID&lt;BR /&gt;224 ,ip.priv_clnt_code&lt;BR /&gt;225 ,ip.priv_clnt_ind&lt;BR /&gt;226 ,ip.priv_clnt_trust_code&lt;BR /&gt;227 ,ip.prty_cust_type_name&lt;BR /&gt;228 ,ar2ar.relat_acct_id_in_wh odp_account&lt;BR /&gt;229 ,ar2ar.relat_ar_id odp_ar_id&lt;BR /&gt;230 FROM&lt;BR /&gt;231 EDWSSL.D_AR AR&lt;BR /&gt;232 JOIN edwssl.d_ar_to_ip_relat ar2ip ON&lt;BR /&gt;233 ar2ip.ar_id=ar.AR_ID&lt;BR /&gt;234 and ar2ip.period_code='D'&lt;BR /&gt;235 AND ar2ip.BUSINESS_DATE = &amp;amp;tDBDate&lt;BR /&gt;236 JOIN edwssl.d_ip ip ON&lt;BR /&gt;237 ip.ip_id = ar2ip.ip_id&lt;BR /&gt;238 and ip.period_code='D'&lt;BR /&gt;239 AND ip.business_date = &amp;amp;tDBDate&lt;BR /&gt;240 JOIN edwssl.d_hier_ar_product hp ON&lt;BR /&gt;241 ar.HIER_PRODUCT_TYPE_CODE = hp.LEAF_LEVL_CODE&lt;BR /&gt;242 and hp.period_code='D'&lt;BR /&gt;243 AND hp.business_date = &amp;amp;tDBDate&lt;BR /&gt;244 LEFT OUTER JOIN edwssl.D_AR_TO_AR_RELAT ar2ar ON&lt;BR /&gt;245 ar2ar.BUSINESS_DATE = &amp;amp;tDBDate&lt;BR /&gt;246 and ar.ar_id = ar2ar.ar_id&lt;BR /&gt;247 AND ar2ar.PERIOD_CODE ='D'&lt;BR /&gt;248 AND ar2ar.relat_code = 'HAS ODP FROM'&lt;BR /&gt;249 WHERE&lt;BR /&gt;250 AR.BUSINESS_DATE = &amp;amp;tDBDate&lt;BR /&gt;251 AND AR.PERIOD_CODE ='D'&lt;BR /&gt;252 and ar.ar_type_name !='APPLCTN'&lt;BR /&gt;253 and ar.ar_type_name !='FEATURE'&lt;BR /&gt;254 ) e;&lt;BR /&gt;NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Error executing COPY command: Numeric value 'SOLE OWNER' is not recognized File &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;'SASSNBL_6C042481-B5CC-D549-ABC8-EB31972007F2-01.dat', line 3206396, character 231 Row 3206396, column &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;"R2_BASE_ACCOUNTS"["IP_ID":22] If you would like to continue loading when an error is encountered, use other values such &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;as 'SKIP_FILE' or 'CONTINUE' for the ON_ERROR option. For more information on loading options, please run 'info &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;loading_data' in a SQL client.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 13:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992048#M380405</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2026-08-13T13:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992067#M380406</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13871"&gt;@DBailey&lt;/a&gt;! Can you add these lines to your program before PROC SQL and post the results? (Just make sure there's nothing sensitive first)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace=',,,d' sastraceloc=saslog;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 16:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992067#M380406</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2026-08-13T16:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992072#M380407</link>
      <description>&lt;P&gt;not much there&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;33 &lt;BR /&gt;34 options stimer;&lt;BR /&gt;35 options sastrace=',,,d' sastraceloc=saslog;&lt;/P&gt;
&lt;P&gt;56 &lt;BR /&gt;57 PROC SQL NOPRINT;&lt;BR /&gt;58 connect using edwusr as edw;&lt;BR /&gt;59 CONNECT USING SNWFK AS sf;&lt;BR /&gt;60 connect using retailh as d;&lt;BR /&gt;61&lt;/P&gt;
&lt;P&gt;140 execute by sf (drop table if exists r2_base_accounts);&lt;BR /&gt;141 create table snwfk.r2_base_accounts (bulkload=yes) as&lt;BR /&gt;142 select * from work.r2_base_accounts;&lt;BR /&gt;NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.&lt;BR /&gt;ERROR: Error executing COPY command: Numeric value 'SOLE OWNER' is not recognized File &lt;BR /&gt;'SASSNBL_817DD106-4724-B94A-B56A-A6400B577F13-00.dat', line 3511769, character 231 Row 3511769, column &lt;BR /&gt;"R2_BASE_ACCOUNTS"["IP_ID":22] If you would like to continue loading when an error is encountered, use other values such &lt;BR /&gt;as 'SKIP_FILE' or 'CONTINUE' for the ON_ERROR option. For more information on loading options, please run 'info &lt;BR /&gt;loading_data' in a SQL client.&lt;/P&gt;
&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 18:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992072#M380407</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2026-08-13T18:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992096#M380408</link>
      <description>&lt;P&gt;What happens if you don't use the BULKLOAD option? Still the same errors? Also what version and maintenance level of SAS is this?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 20:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992096#M380408</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2026-08-13T20:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992097#M380409</link>
      <description>&lt;P&gt;it works...just painfully slow loading 7MM records.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current version: 9.04.01M8P022223&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 20:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992097#M380409</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2026-08-13T20:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992098#M380410</link>
      <description>&lt;P&gt;I'm wondering if there's some unprintable characters in the load data upsetting the layout of bulk load file. Maybe try bulk loading a small sample first.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 20:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992098#M380410</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2026-08-13T20:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992120#M380411</link>
      <description>&lt;P&gt;That is a strange error. It seems to be saying it tried to read the text string 'SOLE OWNER' into a numeric variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds like something is causing the parsing of the bulk loaded file to fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know where in your data you have that value?&amp;nbsp; If it only appears only a few times you might be able figure out what values are causing the trouble by looking at the values of a couple of observations before where it first appears.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have unbalanced quotes in your data fields and SAS and Snowflake don't agree on how to handle them.&amp;nbsp; Or perhaps your data includes values that look like the delimiter that bulkload is using to parse the records.&amp;nbsp; Or perhaps they don't agree on the encoding that is being used?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2026 01:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992120#M380411</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-08-15T01:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992130#M380412</link>
      <description>&lt;P&gt;SOLE OWNER appears a lot as it describes the relationship between customer and account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The source is an oracle database.&amp;nbsp; There might be quotes inside the text columns, but it's not something I could change even it it's there (say customer say is O'BRIAN).&amp;nbsp; It might be a delimiter problem...but I don't see any options on telling sas what delimiter to use in the bulk load process.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2026 12:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992130#M380412</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2026-08-16T12:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992131#M380413</link>
      <description>&lt;P&gt;If the goal is to move data between two different foreign databases then you should get better results if you switch to PROC FEDSQL instead.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2026 14:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992131#M380413</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-08-16T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create snowflake table as select from sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992154#M380414</link>
      <description>I did try that...same issue&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Aug 2026 20:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-snowflake-table-as-select-from-sql/m-p/992154#M380414</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2026-08-17T20:00:11Z</dc:date>
    </item>
  </channel>
</rss>

