<?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 Call Symput query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-Symput-query/m-p/69187#M15005</link>
    <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
facing a weird challenges, in my scenario, I am building an prompted STP which would faciliate the user to enter time, date , which gets pass on to a third party database, which requires me to add " ' " to the value.&lt;BR /&gt;
&lt;BR /&gt;
The challenge is as follow, due to the value generated by the prompt does not contain value , I am running a data step wherein I am creating a colum with the prompt value and then appending the " ' " to the column value and finally calling call SYMPUT to create a macro variable, Please find enclosd the sample code&lt;BR /&gt;
&lt;BR /&gt;
%let t1 = 10:30:00;&lt;BR /&gt;
%let t2 = 15:30:00;&lt;BR /&gt;
%let tdate = 08Oct2007;&lt;BR /&gt;
&lt;BR /&gt;
data sasinput.abc;&lt;BR /&gt;
a = "&amp;amp;t1";&lt;BR /&gt;
a1="'"|| a || "'";&lt;BR /&gt;
call symput('time1',a1);&lt;BR /&gt;
%put &amp;amp;time1;&lt;BR /&gt;
&lt;BR /&gt;
b = "&amp;amp;t2";&lt;BR /&gt;
*b1="'"|| b || "'";&lt;BR /&gt;
call symput("time2",b);&lt;BR /&gt;
%put &amp;amp;time2;&lt;BR /&gt;
&lt;BR /&gt;
d = "&amp;amp;tdate";&lt;BR /&gt;
*d1="'"|| d || "'";&lt;BR /&gt;
call symput("date1",d);&lt;BR /&gt;
%put &amp;amp;date1;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This code runs fine in base sas , but if tried to run in STP , it does not resolve the macro variable created via SYMPUT

Message was edited by: Danny Dsouza</description>
    <pubDate>Thu, 03 Sep 2009 09:38:11 GMT</pubDate>
    <dc:creator>DannyDsouza</dc:creator>
    <dc:date>2009-09-03T09:38:11Z</dc:date>
    <item>
      <title>Call Symput query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Symput-query/m-p/69187#M15005</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
facing a weird challenges, in my scenario, I am building an prompted STP which would faciliate the user to enter time, date , which gets pass on to a third party database, which requires me to add " ' " to the value.&lt;BR /&gt;
&lt;BR /&gt;
The challenge is as follow, due to the value generated by the prompt does not contain value , I am running a data step wherein I am creating a colum with the prompt value and then appending the " ' " to the column value and finally calling call SYMPUT to create a macro variable, Please find enclosd the sample code&lt;BR /&gt;
&lt;BR /&gt;
%let t1 = 10:30:00;&lt;BR /&gt;
%let t2 = 15:30:00;&lt;BR /&gt;
%let tdate = 08Oct2007;&lt;BR /&gt;
&lt;BR /&gt;
data sasinput.abc;&lt;BR /&gt;
a = "&amp;amp;t1";&lt;BR /&gt;
a1="'"|| a || "'";&lt;BR /&gt;
call symput('time1',a1);&lt;BR /&gt;
%put &amp;amp;time1;&lt;BR /&gt;
&lt;BR /&gt;
b = "&amp;amp;t2";&lt;BR /&gt;
*b1="'"|| b || "'";&lt;BR /&gt;
call symput("time2",b);&lt;BR /&gt;
%put &amp;amp;time2;&lt;BR /&gt;
&lt;BR /&gt;
d = "&amp;amp;tdate";&lt;BR /&gt;
*d1="'"|| d || "'";&lt;BR /&gt;
call symput("date1",d);&lt;BR /&gt;
%put &amp;amp;date1;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This code runs fine in base sas , but if tried to run in STP , it does not resolve the macro variable created via SYMPUT

Message was edited by: Danny Dsouza</description>
      <pubDate>Thu, 03 Sep 2009 09:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Symput-query/m-p/69187#M15005</guid>
      <dc:creator>DannyDsouza</dc:creator>
      <dc:date>2009-09-03T09:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symput query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Symput-query/m-p/69188#M15006</link>
      <description>Your macro coding (%PUT statements) are co-mingled within your defined SAS DATA step, which has a CALL SYMPUT -- these coding techniques will not generate the results you might expect.&lt;BR /&gt;
&lt;BR /&gt;
Also, it's unclear whether you are generating some SAS ERROR/WARNING or that the resulting variable value is blank -- suggest you try hardcoding some value to attempt to pass the data on to the STP to test various options, just to ensure your code is functioning at all.&lt;BR /&gt;
&lt;BR /&gt;
And, here is some useful reading on macro variable SCOPE (local versus global) within the SAS macro language.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Scopes of Macro Variables &lt;BR /&gt;
Special Cases of Scope with the CALL SYMPUT Routine&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/tw3514-symput.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/tw3514-symput.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scopes of Macro Variables&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm&lt;/A&gt;</description>
      <pubDate>Thu, 03 Sep 2009 14:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Symput-query/m-p/69188#M15006</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-03T14:53:38Z</dc:date>
    </item>
  </channel>
</rss>

