<?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 ERROR: Function TRUNC requires at least 2 argument(s). in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916852#M361135</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
     /*connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); */

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.act_dttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.inptid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm,
         			 c.mktcd,
                                 c.srcstcd,
                                 d.pur_id,
                                 d.bol_cd,
                                 d.clmplcd,
			         d.ent,
                             case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
                                  else 'INE'
                             end as Business,
                                 d.plancd
          
                    from dra.rsh_dra_snart_act as a

                       left join dra.rsh_dra_case as c
                          on a.id = c.id

                       left join dra.rsh_dra_nonmdm_mbr as d
                          on c.id = d.id 
				
                          where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.inptid in (&amp;amp;role1.)
                            and (c.srcstcd not in ('5','6') or c.srcstcd is null)
                            and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
        
                        /*  order by a.id, a.act_dttm*/);
                         
     /*disconnect from test;*/
quit;

ERROR: Function TRUNC requires at least 2 argument(s).
ERROR: Function TO_DATE could not be located.
ERROR: Function TO_DATE could not be located.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should I stick with using TRUNC or use datepart instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 19:18:00 GMT</pubDate>
    <dc:creator>bhca60</dc:creator>
    <dc:date>2024-02-19T19:18:00Z</dc:date>
    <item>
      <title>ERROR: Function TRUNC requires at least 2 argument(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916852#M361135</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
     /*connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); */

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.act_dttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.inptid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm,
         			 c.mktcd,
                                 c.srcstcd,
                                 d.pur_id,
                                 d.bol_cd,
                                 d.clmplcd,
			         d.ent,
                             case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
                                  else 'INE'
                             end as Business,
                                 d.plancd
          
                    from dra.rsh_dra_snart_act as a

                       left join dra.rsh_dra_case as c
                          on a.id = c.id

                       left join dra.rsh_dra_nonmdm_mbr as d
                          on c.id = d.id 
				
                          where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.inptid in (&amp;amp;role1.)
                            and (c.srcstcd not in ('5','6') or c.srcstcd is null)
                            and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
        
                        /*  order by a.id, a.act_dttm*/);
                         
     /*disconnect from test;*/
quit;

ERROR: Function TRUNC requires at least 2 argument(s).
ERROR: Function TO_DATE could not be located.
ERROR: Function TO_DATE could not be located.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should I stick with using TRUNC or use datepart instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 19:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916852#M361135</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-19T19:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function TRUNC requires at least 2 argument(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916855#M361137</link>
      <description>&lt;P&gt;I am certainly not knowledgeable about using Oracle commands within PROC SQL ... however a quick Google search finds many answers, such as this one:&amp;nbsp;&lt;A href="https://docs.oracle.com/cd/B13789_01/olap.101/b10339/x_trap012.htm#:~:text=The%20TRUNC%20function%20truncates%20either,TRUNC%20(for%20numbers" target="_blank"&gt;https://docs.oracle.com/cd/B13789_01/olap.101/b10339/x_trap012.htm#:~:text=The%20TRUNC%20function%20truncates%20either,TRUNC%20(for%20numbers&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 19:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916855#M361137</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-19T19:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function TRUNC requires at least 2 argument(s).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916856#M361138</link>
      <description>&lt;P&gt;If you are switching to SAS SQL then you don't need TRUNC and you'll have to remove TO_DATE as there is no such function in SAS. I'm assuming&amp;nbsp;act_dttm is an Oracle datetime here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; where a.act_dttm between "01Jan2024:00:00:00"dt and "31Jan2024:00:00:00"dt&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Feb 2024 20:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-TRUNC-requires-at-least-2-argument-s/m-p/916856#M361138</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-02-19T20:00:55Z</dc:date>
    </item>
  </channel>
</rss>

