<?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: WARNING: Character expression will be truncated when assigned to character column in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580556#M13574</link>
    <description>&lt;P&gt;Same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to describe my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compare tables (V-new data and T-current data) and I look for records which are not appears in the V anymore.&lt;/P&gt;&lt;P&gt;I have for each record the Information when the record come the first time (erstes Erscheinungsdatum) and when the data was found the last time (Abgangsdatum).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I found a record which is not in the V I want to save the first time and last time information in a separate column (Historie). How can I do that directly?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text for the Historie fild E:firstdate Format MMYY and A:lastdate Format MMYY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sascha&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2019 14:13:25 GMT</pubDate>
    <dc:creator>SaschaD</dc:creator>
    <dc:date>2019-08-12T14:13:25Z</dc:date>
    <item>
      <title>WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580534#M13569</link>
      <description>&lt;P&gt;Hi SAS-Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got always the WARNING -&amp;nbsp;Character expression will be truncated when assigned to character column and I don't know why.&lt;/P&gt;&lt;P&gt;I tried it with PUT, INPUT... but always a Problem. Could you help me please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	CREATE TABLE GRV_Comeback_Dummy AS
	SELECT V.VTGONR
	FROM APPG.KOPIE_V_APP_GRV V
	WHERE V.VTGONR in (SELECT T.Gruppenvertrag FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Abgangsdatum not is null) AND V.STOV = '000000';
QUIT;

PROC SQL;
	ALTER TABLE GRV_Comeback_Dummy ADD Historie_OLD CHAR (100);
	ALTER TABLE GRV_Comeback_Dummy ADD Historie_NEW CHAR (100);
QUIT; 

PROC SQL;
	UPDATE GRV_Comeback_Dummy D
	SET 
	'Historie_OLD'n = (SELECT COMPRESS(T.Historie) FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR),	
	'Historie_NEW'n = 
		'E:' || PUT((SELECT T.'erstes Erscheinungsdatum'n FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR), MMYYN4.) 
		||
		'A:' || PUT((SELECT T.Abgangsdatum FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR), MMYYN4.)
	WHERE D.VTGONR in (SELECT T.Gruppenvertrag FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR);
QUIT;

PROC SQL;
	UPDATE APPG.TEST_AZL_GRV_Bestand T
	SET 'Historie'n = 
		(SELECT COMPRESS(D.Historie_OLD) FROM GRV_Comeback_Dummy D WHERE D.VTGONR = T.Gruppenvertrag)
		||
		(SELECT COMPRESS(D.Historie_NEW) FROM GRV_Comeback_Dummy D WHERE D.VTGONR = T.Gruppenvertrag)
	WHERE T.Gruppenvertrag in (SELECT D.VTGONR FROM GRV_Comeback_Dummy D WHERE T.Gruppenvertrag = D.VTGONR);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580534#M13569</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2019-08-12T13:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580538#M13571</link>
      <description>&lt;P&gt;If you want to limit the length of a string value then use SUBSTR() or perhaps better SUBSTRN().&amp;nbsp; Since you create length $100 variables probably something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Historie_OLD = substrn(.......,1,100)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580538#M13571</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-12T13:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580546#M13572</link>
      <description>&lt;P&gt;Thanks Tom, I changed my Code (see below), but now I get the error&amp;nbsp;Concatenation (||) requires character operands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	UPDATE GRV_Comeback_Dummy D
	SET 
	'Historie_OLD'n = (SELECT COMPRESS(T.Historie) FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR),	
	'Historie_NEW'n = 
		'E:' || &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;SUBSTRN(&lt;/STRONG&gt;&lt;/FONT&gt;(SELECT T.'erstes Erscheinungsdatum'n FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR), 1, 100) 
		||
		'A:' || &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;SUBSTRN(&lt;/FONT&gt;&lt;/STRONG&gt;(SELECT T.Abgangsdatum FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR), 1, 100)
	WHERE D.VTGONR in (SELECT T.Gruppenvertrag FROM APPG.TEST_AZL_GRV_Bestand T WHERE T.Gruppenvertrag = D.VTGONR);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580546#M13572</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2019-08-12T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580550#M13573</link>
      <description>&lt;P&gt;Put the concatenation where it belongs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(SELECT SUBSTRN('E:' ||  T.'erstes Erscheinungsdatum'n,1,100)  ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why are you using such convoluted code?&amp;nbsp; Create a table. Change the table. Update the table.&lt;/P&gt;
&lt;P&gt;Why not just build the table directly from joining the sources?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580550#M13573</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-12T13:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580556#M13574</link>
      <description>&lt;P&gt;Same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to describe my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compare tables (V-new data and T-current data) and I look for records which are not appears in the V anymore.&lt;/P&gt;&lt;P&gt;I have for each record the Information when the record come the first time (erstes Erscheinungsdatum) and when the data was found the last time (Abgangsdatum).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I found a record which is not in the V I want to save the first time and last time information in a separate column (Historie). How can I do that directly?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text for the Historie fild E:firstdate Format MMYY and A:lastdate Format MMYY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sascha&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 14:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580556#M13574</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2019-08-12T14:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Character expression will be truncated when assigned to character column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580558#M13575</link>
      <description>&lt;P&gt;So is the type issue that you are trying to concat a DATE value?&amp;nbsp; Convert it to a string first. For example using PUT() function.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 14:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WARNING-Character-expression-will-be-truncated-when-assigned-to/m-p/580558#M13575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-12T14:15:54Z</dc:date>
    </item>
  </channel>
</rss>

