<?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 Invalid argument to function ... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242647#M268426</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got the following information in the log:&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function YRDIF at line 21 column 18.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 26 column 9.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 9.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;The lines 21 to 27 ar as below:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;21 age_at_131015 = yrdif(birth_date, '13oct2015'd, 'act/act');&lt;/P&gt;&lt;P&gt;22 if age_at_131015 &amp;lt;5 then age_grp="0-4";&lt;/P&gt;&lt;P&gt;23 else if age_at_131015 &amp;lt;15 then age_grp="5-14";&lt;/P&gt;&lt;P&gt;24 else age_group="15+";&lt;/P&gt;&lt;P&gt;25 if substr(Indigenous_status, 1, 1)="A" or substr(Indigenous_status, 1, 1)="T" then Indig=1;&lt;/P&gt;&lt;P&gt;26 else if substr(compress(Indigenous_status), 1, 4)="NOTA" then Indig=2;&lt;/P&gt;&lt;P&gt;27 else if substr(compress(Indigenous_status), 1, 4)="NOTS" then Indig=9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;What I did wrong?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;Thanks.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;qinghe&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2016 04:55:11 GMT</pubDate>
    <dc:creator>qinghe</dc:creator>
    <dc:date>2016-01-11T04:55:11Z</dc:date>
    <item>
      <title>Invalid argument to function ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242647#M268426</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got the following information in the log:&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function YRDIF at line 21 column 18.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 26 column 9.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 9.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;The lines 21 to 27 ar as below:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;21 age_at_131015 = yrdif(birth_date, '13oct2015'd, 'act/act');&lt;/P&gt;&lt;P&gt;22 if age_at_131015 &amp;lt;5 then age_grp="0-4";&lt;/P&gt;&lt;P&gt;23 else if age_at_131015 &amp;lt;15 then age_grp="5-14";&lt;/P&gt;&lt;P&gt;24 else age_group="15+";&lt;/P&gt;&lt;P&gt;25 if substr(Indigenous_status, 1, 1)="A" or substr(Indigenous_status, 1, 1)="T" then Indig=1;&lt;/P&gt;&lt;P&gt;26 else if substr(compress(Indigenous_status), 1, 4)="NOTA" then Indig=2;&lt;/P&gt;&lt;P&gt;27 else if substr(compress(Indigenous_status), 1, 4)="NOTS" then Indig=9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;What I did wrong?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;Thanks.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3" face="Courier New"&gt;&lt;FONT size="3" face="Courier New"&gt;qinghe&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 04:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242647#M268426</guid>
      <dc:creator>qinghe</dc:creator>
      <dc:date>2016-01-11T04:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242649#M268427</link>
      <description>&lt;P&gt;Most likely you forgot to account for missing values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Birth_date is probably missing, and indigineous status is less than 4 characters, or missing, so trying to take a substring of length 4 isn't possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look closer at your log, it will show sample data points and you can verify the value of birth_date and/or indigineous status to verify my guess.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 05:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242649#M268427</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-11T05:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid argument to function ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242651#M268428</link>
      <description>&lt;P&gt;Thanks, Reeza&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 05:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-argument-to-function/m-p/242651#M268428</guid>
      <dc:creator>qinghe</dc:creator>
      <dc:date>2016-01-11T05:06:36Z</dc:date>
    </item>
  </channel>
</rss>

