<?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: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646766#M78585</link>
    <description>&lt;P&gt;Your solution works, thank you very much for your help!&lt;/P&gt;</description>
    <pubDate>Mon, 11 May 2020 15:29:14 GMT</pubDate>
    <dc:creator>GLO1</dc:creator>
    <dc:date>2020-05-11T15:29:14Z</dc:date>
    <item>
      <title>WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646650#M78567</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to merge two datasets into one (one with measurements the other with characteristics for the same observations). However, the datastep was terminated after observation number 27 (there are 13000). The error shown is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Some character data was lost during transcoding in the dataset _EXP1_.BASCOCOG. Either&amp;nbsp;the data contains characters that are not representable in the new encoding or&amp;nbsp;truncation occurred during transcoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After using:&lt;/P&gt;&lt;P&gt;%let dsn=libref.data;&lt;BR /&gt;%let dsid=%sysfunc(open(&amp;amp;dsn,i));&lt;BR /&gt;%put &amp;amp;dsn ENCODING is: %sysfunc(attrc(&amp;amp;dsid,encoding));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;,I got the following&amp;nbsp;WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function&amp;nbsp;is out of range.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does someone know how to fix this? I would really be appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance, looking forward to hear from you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 11:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646650#M78567</guid>
      <dc:creator>GLO1</dc:creator>
      <dc:date>2020-05-11T11:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646653#M78568</link>
      <description>&lt;P&gt;After this line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsid=%sysfunc(open(&amp;amp;dsn,i));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;insert and run this line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;=dsid;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What does it write to the log?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 11:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646653#M78568</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-11T11:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646654#M78569</link>
      <description>Thank you for your fast reply. The log shows the following;&lt;BR /&gt;&lt;BR /&gt;/* Show the encoding value for the problematic data set */&lt;BR /&gt;137 %let dsn=libref.expbascog_carolina;&lt;BR /&gt;138 %let dsid=%sysfunc(open(&amp;amp;dsn,i));&lt;BR /&gt;139 %put &amp;amp;=dsid;&lt;BR /&gt;DSID=0&lt;BR /&gt;140 %put &amp;amp;dsn ENCODING is: %sysfunc(attrc(&amp;amp;dsid,encoding));&lt;BR /&gt;WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function&lt;BR /&gt;is out of range.&lt;BR /&gt;libref.expbascog_carolina ENCODING is:&lt;BR /&gt;141 %let rc=%sysfunc(close(&amp;amp;dsid));&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 May 2020 11:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646654#M78569</guid>
      <dc:creator>GLO1</dc:creator>
      <dc:date>2020-05-11T11:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646659#M78570</link>
      <description>&lt;P&gt;No issues with the code. You may have to replace the 'libref' with the actual library name in your code.&lt;/P&gt;
&lt;PRE&gt;17         %let dsn=sashelp.class;
18         %let dsid=%sysfunc(open(&amp;amp;dsn,i));
19         %put &amp;amp;dsid.;
4
20         %put &amp;amp;dsn ENCODING is: %sysfunc(attrc(&amp;amp;dsid,encoding));
sashelp.class ENCODING is: us-ascii  ASCII (ANSI)
21         %let cl=%sysfunc(close(&amp;amp;dsid));&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 12:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646659#M78570</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2020-05-11T12:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646661#M78571</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328250"&gt;@GLO1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;138 %let dsid=%sysfunc(open(&amp;amp;dsn,i));&lt;/SPAN&gt;&lt;BR /&gt;139 %put &amp;amp;=dsid;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;DSID=0&lt;/FONT&gt;&lt;BR /&gt;140 %put &amp;amp;dsn ENCODING is: %sysfunc(attrc(&amp;amp;dsid,encoding));&lt;BR /&gt;WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function&lt;BR /&gt;is out of range.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;According to the documentation for the OPEN function&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;OPEN returns 0 if the data set could not be opened.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;So that's why the next line fails. LIBREF.DATA cannot be opened. Perhaps because it does not exist.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646661#M78571</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-11T12:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646663#M78572</link>
      <description>&lt;P&gt;Paige is right . I got no problem.&lt;/P&gt;
&lt;PRE&gt;69         %let dsn=sashelp.class;
 70         %let dsid=%sysfunc(open(&amp;amp;dsn));
 71         %let encoding=%sysfunc(attrc(&amp;amp;dsid,encoding));
 72         %let dsid=%sysfunc(close(&amp;amp;dsid));
 73         
 74         %put Table &amp;amp;dsn  encoding is &amp;amp;encoding ;
 Table sashelp.class  encoding is us-ascii  ASCII (ANSI)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646663#M78572</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-05-11T12:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646666#M78573</link>
      <description>&lt;P&gt;Ok, maybe I should start from the beginning. This is the actual problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;165 data expcog_carolina; /*copy CAROLINA EXP1_coga1d and EXP1_bascocog to workfile*/&lt;BR /&gt;166 set _EXP1_.coga1d;&lt;BR /&gt;NOTE: Data file _EXP1_.COGA1D.DATA is in a format that is native to another host, or the file&lt;BR /&gt;encoding does not match the session encoding. Cross Environment Data Access will be&lt;BR /&gt;used, which might require additional CPU resources and might reduce performance.&lt;BR /&gt;167 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 13078 observations read from the data set _EXP1_.COGA1D.&lt;BR /&gt;NOTE: The data set WORK.EXPCOG_CAROLINA has 13078 observations and 186 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.22 seconds&lt;BR /&gt;cpu time 0.18 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;169 data expbascog_carolina;&lt;BR /&gt;170 set _EXP1_.bascocog;&lt;BR /&gt;NOTE: Data file _EXP1_.BASCOCOG.DATA is in a format that is native to another host, or the&lt;BR /&gt;file encoding does not match the session encoding. Cross Environment Data Access will be&lt;BR /&gt;used, which might require additional CPU resources and might reduce performance.&lt;BR /&gt;171 run;&lt;/P&gt;&lt;P&gt;ERROR: Some character data was lost during transcoding in the dataset _EXP1_.BASCOCOG. Either&lt;BR /&gt;the data contains characters that are not representable in the new encoding or&lt;BR /&gt;truncation occurred during transcoding.&lt;BR /&gt;NOTE: The DATA step has been abnormally terminated.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: There were 27 observations read from the data set _EXP1_.BASCOCOG.&lt;BR /&gt;WARNING: The data set WORK.EXPBASCOG_CAROLINA may be incomplete. When this step was stopped&lt;BR /&gt;there were 27 observations and 156 variables.&lt;BR /&gt;WARNING: Data set WORK.EXPBASCOG_CAROLINA was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646666#M78573</guid>
      <dc:creator>GLO1</dc:creator>
      <dc:date>2020-05-11T12:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646687#M78575</link>
      <description>&lt;P&gt;I have seen this exact issue happening when migrating data from a LATIN platform to UTF-8. In UTF-8 you may need more bytes in UTF-8 for the same data than in LATIN (for example, the e-accent or é) is 1 byte in LATIN but two in UTF-8. Now if the dataset copies the length attributes for character columns from source to target it fails to take this into consideration, resulting in truncation. If you analyze your observation 27 you will likely find the culprit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has a solution for this. This is the CVP engine. This engine will multiply the length of the target columns by a set amount to avoid the issue. Using this engine would be like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname source cvp 'Source-data-library';   
libname target 'Target-data-library';   
proc copy noclone in=source out=target;   
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 13:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646687#M78575</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2020-05-11T13:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: Argument 1 to function ATTRC referenced by the %SYSFUNC or %QSYSFUNC macro function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646766#M78585</link>
      <description>&lt;P&gt;Your solution works, thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 15:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WARNING-Argument-1-to-function-ATTRC-referenced-by-the-SYSFUNC/m-p/646766#M78585</guid>
      <dc:creator>GLO1</dc:creator>
      <dc:date>2020-05-11T15:29:14Z</dc:date>
    </item>
  </channel>
</rss>

