<?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: Convert STRING today() function to SAS Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878599#M347133</link>
    <description>&lt;P&gt;Use the data to WRITE the code.&amp;nbsp; For example by using a PUT statement.&lt;/P&gt;
&lt;P&gt;For example this data step will write one INSERT statement for each observation in your&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  file code ;
  set table1 ;
  put 'insert into TABLE2 (db_nm,tbl_nm,data_availability_check)'
   /  'select ' db_nm :$quote. 
   /  '     , ' tbl_nm :$quote. 
   /  '     ,  case when datepart(max_load_dt) between ' check_start 'and ' check_end
        "then 'Y' else 'N' end"
   /  'from (select max(' load_col ') as max_load_dt from ' db_nm +(-1) '.' tbl_nm ')'
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then LOOK at the text file and make sure the generated code is correct.&amp;nbsp; Copy the first statement from the file and run it to see if it works to get the status of that table.&amp;nbsp; If not then modify the PUT statement so it writes the correct code.&amp;nbsp; For example&amp;nbsp;if DB_NM and TBL_NM mean the names of an Oracle SCHEMA and a TABLE or VIEW in that schema then you probably need to modify the select clause to use explicit pass thru SQL instead of the above that is assuming that DB_NM has a SAS LIBREF and TBL_NM has the name of SAS dataset or view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you get it to generate the right code then just use %INCLUDE to run it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
%include code / source2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Jun 2023 03:15:54 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-06-01T03:15:54Z</dc:date>
    <item>
      <title>Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875970#M346111</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an oracle table with two columns &lt;STRONG&gt;start_dt&lt;/STRONG&gt; and &lt;STRONG&gt;end_dt&lt;/STRONG&gt; which holding the data like &lt;STRONG&gt;today()-2&lt;/STRONG&gt; and&lt;STRONG&gt; today()&lt;/STRONG&gt; in &lt;STRONG&gt;VARCHAR2(50) datatype&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Could you please help me to convert today()-2 and today() string values into SAS dates please.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 10:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875970#M346111</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-05-16T10:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875972#M346113</link>
      <description>&lt;P&gt;How does some example data in that columns look like?&lt;/P&gt;
&lt;P&gt;Is it "YYYY-MM-DD" ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 11:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875972#M346113</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-16T11:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875977#M346116</link>
      <description>I have created an oracle table as below.&lt;BR /&gt;create table ref_data(start_dt,end_dt) values ('today()-2','today()');&lt;BR /&gt;&lt;BR /&gt;Now I want to convert 'today()' (STRING) into SAS date value.</description>
      <pubDate>Tue, 16 May 2023 11:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875977#M346116</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-05-16T11:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875984#M346118</link>
      <description>&lt;P&gt;You need explain it more detail what you have because if you only have those two strings just type them into a program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have code in data then you need to use some type of code generation to be able to run the code.&amp;nbsp; That is you need to use the data to write the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you have this dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  start_dt ='today()-2';
  end_dt = 'todya()';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you want to get this dataset ;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  start_dt = today()-2;
  end_dt = today();
  format start_dt end_dt date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you could a program like this to read HAVE and generate the code to create WANT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  set have;
  file code;
  put 'start_dt=' start_dt ';'  ;
  put 'end_dt=' end_dt ';' ;
run;

data want;
%include code / source2;
  format start_dt end_dt date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 12:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/875984#M346118</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-16T12:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876183#M346202</link>
      <description>Thanks for your response. Below have given more details. Please chekc and suggest.&lt;BR /&gt;&lt;BR /&gt;Consider I have a SAS Temporary table which holds table name, schema name , load_dt, start_dt,end_dt like below. And I have similar data with 200 records in SAS temp Dataset..&lt;BR /&gt;&lt;BR /&gt;SALES,SALES_DW,23147,'TODAY()-2','TODAY()'  --&amp;gt; Sample Data in reference Table.&lt;BR /&gt;&lt;BR /&gt;My SAS code should verify like below.&lt;BR /&gt;&lt;BR /&gt;SELECT TABLE_NAME, SCHEMA_NAME,CASE WHEN start_dt &amp;lt;= table_load_dt &amp;lt;= end_dt then 'Y' else 'N' end as DATA_EXISTS&lt;BR /&gt;FROM reference_table;&lt;BR /&gt;&lt;BR /&gt;Here I am getting an error as datatype mismatch since table_load_dt in SAS date Value and START_DT and END_DT's are char datatype ('today()').</description>
      <pubDate>Wed, 17 May 2023 09:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876183#M346202</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-05-17T09:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876188#M346204</link>
      <description>&lt;P&gt;It's a bit over kill, but does this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* assumption: today() returns May 17th, 2023 */
data have;
infile cards dsd;
input (t s) (: $20.) dt (sd ed) (: $10.);
format dt yymmdd10.;
cards;
SALES,SALES_DW,23146,TODAY()-2,TODAY()
CUSTOMERS,SALES_DW,23148,TODAY()-22,TODAY()+16
;
run;

proc print data=have;
run;

data want;
  set have;


  dsStr=cat(
    "have(rename=(dt=_N_) where=(s='",strip(s),
    "' and t='",strip(t),"' ",
    "  and (",sd,") &amp;lt;=_N_&amp;lt;= (",ed,")",
    "))"
  );
  drop dsStr;
  declare hash H(dataset:dsStr);
  H.defineKey("_N_");
  H.defineDone();

  if H.NUM_ITEMS &amp;gt;0 
    then DATA_EXISTS="Yes";
    else DATA_EXISTS="No";
  H.delete();

run;

proc print data=want;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 10:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876188#M346204</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-17T10:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876192#M346207</link>
      <description>&lt;P&gt;You have left out details that make it impossible to give you a working solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the name of the dataset that has the character variables&amp;nbsp;&lt;SPAN&gt;START_DT and END_DT?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Do all of the observations have the same values of START_DT and END_DT?&lt;/P&gt;
&lt;P&gt;You can check by running PROC FREQ:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq;
  tables start_dt*end_dt / list missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that same dataset as the one named REFERENCE_TABLE you are querying later?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where is this TABLE_LOAD_DT variable?&amp;nbsp; Is it the same variable as the LOAD_DT variable in the dataset with the START_DT and END_DT character strings?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this DT suffix on your variable names stand for DaTe values (number of days) or DateTime values (number of seconds)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The key to getting code generation to work ( ie to creating a macro) is you need to know what code you want to generate.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show me the code that works to populate DATA_EXISTS variable for one or two of the records in your temporary table and the results you get when you run it.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 12:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/876192#M346207</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-17T12:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878506#M347091</link>
      <description>&lt;P&gt;Extremely sorry for the late response.&amp;nbsp; Below have trying my level best to show the scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table1: INPUT TABLE [ORACLE TABLE]&lt;/P&gt;
&lt;P&gt;db_nm(VARCHAR2(50),tbl_nm(VARCHAR2(50),load_col(VARCHAR2(50),chk_start(VARCHAR2(50),chk_end(VARCHAR2(50)&lt;/P&gt;
&lt;P&gt;store,customer,load_dt,today()-5,today()&lt;/P&gt;
&lt;P&gt;store,product,load_dt,today()-10,today()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have total 250 source tables list to verify.&lt;/P&gt;
&lt;P&gt;Table2: OUTPUT TABLE [ SAS Dataset ]&lt;/P&gt;
&lt;P&gt;db_nm,tbl_nm,data_availability_check&lt;/P&gt;
&lt;P&gt;'store','customer','Y'&lt;/P&gt;
&lt;P&gt;'store','product','Y'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need to write SAS code in below format.&lt;/P&gt;
&lt;P&gt;1. I managed to get the MAX(LOAD_COL)=LATEST_DT value in datetime20. format.&lt;/P&gt;
&lt;P&gt;2. Now trying in below way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;data table2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;set table1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if chk_start &amp;gt;=&amp;nbsp;LATEST_DT and chk_end &amp;lt;=&amp;nbsp;LATEST_DT then&amp;nbsp;data_availability_check='Y';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;else&amp;nbsp;data_availability_check='N';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error: CHK_START,CHK_END column values should be Numeric, but it hold Character value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: TABLE1 is in oracle database (ALL COLUMNS are VARCHAR2(50).&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TABLE2 is in SAS (Dataset).&lt;/P&gt;
&lt;P&gt;Also requirement here is , It's a data check program which verifies given database name and table names should have latest data i.e maximum load date should be between chk_start and chk_end dates, then only we make data flag as 'Y' else 'N'. I hope its helpful. Please help me to convert&amp;nbsp; 'today()' string value into SAS date value using proc sql or datastep, so that I will convert into datetime20. format.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 18:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878506#M347091</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-05-31T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878565#M347117</link>
      <description>&lt;P&gt;You are still not explaining a step here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have this metadata in an Oracle table which seems to be used to define the CRITERIA to use for testing whether a DATE is within a range.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table1 ;
  length db_nm tbl_nm load_col chk_start chk_end $50;
  input db_nm -- chk_end;
cards;
store customer load_dt today()-5  today()
store product  load_dt today()-10 today()
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am interpreting the first row to mean you want to check if LOAD_DT in STORE.CUSTOMER is between today and 5 days ago.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your comments it sounds like you actually want to test if the MAX() of LOAD_DT is within that window so that for each variable you get only one answer, (Y/N or T/F or 1/0).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to do that for STORE.CUSTOMER you might want to do something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select max(load_dt) as max_load_dt from store.customer&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which you could then wrap into something that tests its value&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select case when max_load_dt between today()-5 and today() then 'Y' else 'N' end as ANSWER from 
(select max(load_dt) as max_load_dt from store.customer)
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your LOAD_DT variable is a DATETIME variable instead of DATE variable then you cannot compare its value directly to the DATE value generated by the TODAY() function.&amp;nbsp; It is in the wrong units (seconds instead of days).&amp;nbsp; You can use the DATEPART() function to convert it to a DATE value instead.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select case when datepart(max_load_dt) between today()-5 and today() then 'Y' else 'N' end as ANSWER from 
(select max(load_dt) as max_load_dt from store.customer)
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As I explained before you cannot just compare LOAD_DT (or MAX_LOAD_DT) to the character strings you have in your metadata dataset (TABLE1).&amp;nbsp; You have to use the strings in TABLE1 to generate some CODE like the example above instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 21:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878565#M347117</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-31T21:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878598#M347132</link>
      <description>Thank you so much for your reply.&lt;BR /&gt;&lt;BR /&gt;As you mentioned the code in previous comment, it won't work since today() -5 and today() are in String variable and we are not using direct today() functions since we need to handle dynamically. I am writing query using variables not hard coded values. If I use direct variables SAS is not considering today()-5 and today() as SAS functions, still considering as strings values and throwing check_start and end variables are not numeric. &lt;BR /&gt;Please Imagine, check_start and check_end values are in oracle table varchar2 datatype and we need to use direct variable names to check maximum load date(timestamp) in between check_start and check_end date windows in SAS proc sql. My request is how to can we make SAS to understand check_start and check_end values as Functions and not Strings using below query. &lt;BR /&gt;&lt;BR /&gt;select case when datepart(max_load_dt) between check_start and check_end then 'Y' else 'N' end as ANSWER from&lt;BR /&gt;(select max(load_dt) as max_load_dt from store.customer).&lt;BR /&gt;;</description>
      <pubDate>Thu, 01 Jun 2023 03:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878598#M347132</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-06-01T03:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert STRING today() function to SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878599#M347133</link>
      <description>&lt;P&gt;Use the data to WRITE the code.&amp;nbsp; For example by using a PUT statement.&lt;/P&gt;
&lt;P&gt;For example this data step will write one INSERT statement for each observation in your&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  file code ;
  set table1 ;
  put 'insert into TABLE2 (db_nm,tbl_nm,data_availability_check)'
   /  'select ' db_nm :$quote. 
   /  '     , ' tbl_nm :$quote. 
   /  '     ,  case when datepart(max_load_dt) between ' check_start 'and ' check_end
        "then 'Y' else 'N' end"
   /  'from (select max(' load_col ') as max_load_dt from ' db_nm +(-1) '.' tbl_nm ')'
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then LOOK at the text file and make sure the generated code is correct.&amp;nbsp; Copy the first statement from the file and run it to see if it works to get the status of that table.&amp;nbsp; If not then modify the PUT statement so it writes the correct code.&amp;nbsp; For example&amp;nbsp;if DB_NM and TBL_NM mean the names of an Oracle SCHEMA and a TABLE or VIEW in that schema then you probably need to modify the select clause to use explicit pass thru SQL instead of the above that is assuming that DB_NM has a SAS LIBREF and TBL_NM has the name of SAS dataset or view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you get it to generate the right code then just use %INCLUDE to run it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
%include code / source2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2023 03:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-STRING-today-function-to-SAS-Date/m-p/878599#M347133</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-01T03:15:54Z</dc:date>
    </item>
  </channel>
</rss>

