<?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 When Trying to Load 'DATETIME' Columns from SAS to Snowflake in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929192#M365612</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442819"&gt;@mkiran&lt;/a&gt;&amp;nbsp;I suspect you might be getting this issue:&amp;nbsp;&lt;A href="https://support.sas.com/kb/69/628.html" target="_blank"&gt;https://support.sas.com/kb/69/628.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow the instructions in the SAS Note to see if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 19:59:59 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2024-05-21T19:59:59Z</dc:date>
    <item>
      <title>Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/884205#M349296</link>
      <description>&lt;P&gt;Hello, I am trying to BULKLOAD a SAS dataset into Snowflake and I am having trouble with the DATETIME column in my SAS dataset. When trying to load it into Snowflake, I get the error message:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;ERROR: Error executing COPY command: Numeric value '2016-01-08 14:20:34.000000000' is not recognized&lt;BR /&gt;  File &lt;BR /&gt;       '@~/nucleus/xxxxx.gz', line 6187, character 186&lt;BR /&gt;  Row 6187, column &lt;BR /&gt;       "&lt;CODE class=""&gt;CLR_CALL_ACTIV_HIST_2016&lt;/CODE&gt;"["INTERACTION-ID":21]&lt;BR /&gt;If you would like to continue loading when an error is encountered, use &lt;BR /&gt;other values such as 'SKIP_FILE' or 'CONTINUE' for the ON_ERROR option. For more information on loading options, please run &lt;BR /&gt;'info loading_data' in a SQL client.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For reference, here is my SAS code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/* Transform the data */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_0;
	/* Load in work table containing the pre-transformed file */
	SET WORK.CLR_CALL_ACTIV_HIST_2016_0;

	/* Transformations */
	'CHANNEL-ID-NUM'N			= INPUT(STRIP('CHANNEL-ID'N), BEST32.);

	IF MISSING('CHANNEL-OBJ-ID'N) OR UPCASE('CHANNEL-OBJ-ID'N) = "N/A" THEN
		'CHANNEL-OBJ-ID-NUM'N = .;
	ELSE
		'CHANNEL-OBJ-ID-NUM'N = INPUT(STRIP('CHANNEL-OBJ-ID'N), BEST32.);

	'GROUP-ID-NUM'N				= INPUT(STRIP('GROUP-ID'N), BEST32.);
	'INTERACTION-ID-NUM'N		= INPUT(STRIP('INTERACTION-ID'N), BEST32.);


	'DATE'N = INPUT(SUBSTR('TRANS-ACCEPT-TIME'N, 1, 10), YYMMDD10.);
		FORMAT 'DATE'N YYMMDD10.;
	'TIME'N	= INPUT(SUBSTR('TRANS-ACCEPT-TIME'N, 12, 8), TIME8.);
		FORMAT 'TIME'N TIME8.;
	'DATETIME'N = DHMS('DATE'N, HOUR('TIME'N), MINUTE('TIME'N), SECOND('TIME'N));
		FORMAT 'DATETIME'N DATETIME20.;

	'TRANS-POST-PROC-TIME-NUM'N	= INPUT(STRIP('TRANS-POST-PROC-TIME'N),	BEST32.);
	'TRANS-PROC-TIME-NUM'N		= INPUT(STRIP('TRANS-PROC-TIME'N), 		BEST32.);
	'TRANS-REC-NUM-NUM'N		= INPUT(STRIP('TRANS-REC-NUM'N), 		BEST32.);
	'TRANS-TOTAL-TIME-NUM'N		= INPUT(STRIP('TRANS-TOTAL-TIME'N), 	BEST32.);
	'TRANSACTION-ID-NUM'N		= INPUT(STRIP('TRANSACTION-ID'N), 		BEST32.);
RUN;

/* Drop columns */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_1;
	SET WORK.CLR_CALL_ACTIV_HIST_2016_0;

	DROP	'CHANNEL-ID'N
			'CHANNEL-OBJ-ID'N
			'GROUP-ID'N
			'INTERACTION-ID'N
			'TRANS-ACCEPT-TIME'N
			'DATE'N
			'TIME'N
			'TRANS-POST-PROC-TIME'N
			'TRANS-PROC-TIME'N
			'TRANS-REC-NUM'N
			'TRANS-TOTAL-TIME'N
			'TRANSACTION-ID'N
	;
RUN;

/* Rename columns */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_2;
	SET WORK.CLR_CALL_ACTIV_HIST_2016_1;

	RENAME	'CHANNEL-ID-NUM'N 			= 'CHANNEL-ID'n
			'CHANNEL-OBJ-ID-NUM'N		= 'CHANNEL-OBJ-ID'N
			'GROUP-ID-NUM'N				= 'GROUP-ID'N
			'INTERACTION-ID-NUM'N		= 'INTERACTION-ID'N
			'DATETIME'N					= 'TRANS-ACCEPT-TIME'N
			'TRANS-POST-PROC-TIME-NUM'N	= 'TRANS-POST-PROC-TIME'N
			'TRANS-PROC-TIME-NUM'N		= 'TRANS-PROC-TIME'N
			'TRANS-REC-NUM-NUM'N		= 'TRANS-REC-NUM'N
			'TRANS-TOTAL-TIME-NUM'N		= 'TRANS-TOTAL-TIME'N
			'TRANSACTION-ID-NUM'N		= 'TRANSACTION-ID'N
	;
RUN;

/* Load final table */
DATA WORK.CLR_CALL_ACTIV_HIST_2016;
	SET WORK.CLR_CALL_ACTIV_HIST_2016_2;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my Snowflake connector code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname NUC_LIB snow
	SERVER		= "xxxx"
	USER		= "xxxx"
	PASSWORD	= "xxxx"
	DATABASE	= "xxxx"
	SCHEMA 		= "xxxx"
	ROLE 		= "xxxx"
	WAREHOUSE 	= "xxxx"
;

DATA NUC_LIB.CLR_CALL_ACTIV_HIST_2016
	(
	  BULKLOAD              = YES
	  BL_INTERNAL_STAGE     = "user/nucleus"
	  BL_COMPRESS           = YES
	  BL_DELETE_DATAFILE    = YES
	  DBCOMMIT              = 1000000
	);

	SET WORK.CLR_CALL_ACTIV_HIST_2016;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Essentially, I need the DATETIME columns from SAS to be DATETIME columns in Snowflake.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 14:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/884205#M349296</guid>
      <dc:creator>u787bruw</dc:creator>
      <dc:date>2023-07-10T14:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/884250#M349333</link>
      <description>&lt;P&gt;If you don't use the BULKLOAD option do DATETIMEs work?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 19:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/884250#M349333</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-07-10T19:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929181#M365606</link>
      <description>&lt;P&gt;I also have the same issue while loading with bulkload options (regular load doesn't have this problem)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441184"&gt;@u787bruw&lt;/a&gt;&amp;nbsp;: can you suggest how did you overcome this error?.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 18:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929181#M365606</guid>
      <dc:creator>mkiran</dc:creator>
      <dc:date>2024-05-21T18:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929192#M365612</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442819"&gt;@mkiran&lt;/a&gt;&amp;nbsp;I suspect you might be getting this issue:&amp;nbsp;&lt;A href="https://support.sas.com/kb/69/628.html" target="_blank"&gt;https://support.sas.com/kb/69/628.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow the instructions in the SAS Note to see if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 19:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929192#M365612</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-05-21T19:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929460#M365717</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;: No, this one did not help. We are on windows environment and have SAS 9.4 M8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see the below error while loading the data using BULKLOAD options&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname statement:&lt;/P&gt;
&lt;P&gt;LIBNAME RAW SASIOSNF DSN=RAW SCHEMA=SAS USER=SVC_SAS_USER PASSWORD="XXXXXXXXXXXX" &lt;BR /&gt;bulkload=yes bulkunload=yes bl_internal_stage="user/testfolder" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Error executing COPY command: Numeric value '3ê&amp;#5;ÿW½ØXc&amp;#141;]&amp;#157;Ó'8§‹Éƒ„&amp;#12;S³ñ' is not recognized File &lt;BR /&gt;'@~/testfolder/SASSNBL_E28F343A-C79B-4FEB-A5E1-6C68E5A08B42-01.dat', line 5, character 1 Row 5, column &lt;BR /&gt;"DATASET "["YEAR":1] 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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data load is fine with proc sql if I don't use BULKLOAD options in the LIBNAME but it is taking lot of time with the volume of data I have.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 18:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929460#M365717</guid>
      <dc:creator>mkiran</dc:creator>
      <dc:date>2024-05-23T18:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Trying to Load 'DATETIME' Columns from SAS to Snowflake</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929482#M365722</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442819"&gt;@mkiran&lt;/a&gt;&amp;nbsp;- The problem documented also occurs on Windows and like it says may require additional bulk load options. I recommend you open a track with Tech Support if you haven't already.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, as SAS explains it is using the COPY INTO statements for bulk loading. If you look up the Snowflake COPY INTO there is a DATE_FORMAT option that may help in your case:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASKiwi_0-1716495128426.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96728i1A0D537A5DE357A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASKiwi_0-1716495128426.png" alt="SASKiwi_0-1716495128426.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 20:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-When-Trying-to-Load-DATETIME-Columns-from-SAS-to-Snowflake/m-p/929482#M365722</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-05-23T20:12:25Z</dc:date>
    </item>
  </channel>
</rss>

