<?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: Loading submits to GRID via macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/361846#M274774</link>
    <description>&lt;P&gt;Doing RSUBMITs inside macros can be problematic and I wouldn't recommmend it as the remote sessions know nothing about your macro and SAS can get confused where step boundaries are. A better approach would be to get the macro to write a file containing "normal" SAS code containing the RSUBMIT blocks, then %INCLUDE that later outside of all macro processing.&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2017 07:25:52 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2017-05-26T07:25:52Z</dc:date>
    <item>
      <title>Loading submits to GRID via macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/361782#M274773</link>
      <description>&lt;P&gt;So I have a program below &amp;nbsp;that essentrially breaks up what would be a rather large data pull into smaller ones based on admit dates. This is flowsheet data (everything from vitals-weight, height, how much you urinate, position of bed at meals)-In essence it generates a lot of data. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote a macro that does actually work per se-but it is only submitting one job at a time vs all 24 simutaneously-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is still running mach faster than a normal data pull if I grouped all two years together- However- if I can run all 24 then boom-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions helpful-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%let rc=%sysfunc(grdsvc_enable(_all_,resource=NAApp));&lt;BR /&gt;data months;&lt;BR /&gt; &lt;BR /&gt; do date = '01JAN2015'd to '31DEC16'd by 1;&lt;BR /&gt; dayx=day(date);&lt;BR /&gt; startx=intnx('month',date,0);&lt;BR /&gt; endx=intnx('month',date,0,'end');&lt;BR /&gt; sasdate1=compress("'"||translate(put(startx,yymmdd10.),'-','-')||"'");&lt;BR /&gt; sasdate2=compress("'"||translate(put(endx,yymmdd10.),'-','-')||"'");&lt;/P&gt;
&lt;P&gt;if dayx=1 then output;&lt;BR /&gt; format date mmddyy10.;&lt;BR /&gt; keep sasdate1 sasdate2; &lt;BR /&gt; end;&lt;BR /&gt; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%let time3=%SYSFUNC(time(),tod8.);&lt;/P&gt;
&lt;P&gt;%macro sendR2 (data=, var=, var1=);&lt;BR /&gt; proc sort data=&amp;amp;data(keep=&amp;amp;var &amp;amp;var1) out=values nodupkey ;&lt;BR /&gt; by &amp;amp;var &amp;amp;var1;&lt;BR /&gt; run;&lt;BR /&gt; data _null_;&lt;BR /&gt; set values end=last;&lt;BR /&gt; call symputx('sx'||left(_n_),&amp;amp;var);&lt;BR /&gt; call symputx('sxb'||left(_n_),&amp;amp;var1);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; if last then call symputx('countr',_n_,'g');&lt;BR /&gt; run;&lt;BR /&gt;%put _local_;&lt;/P&gt;
&lt;P&gt;%do i=1 %to &amp;amp;countr;&lt;BR /&gt;signon sx&amp;amp;i;&lt;BR /&gt;%SYSLPUT table=sx&amp;amp;i;&lt;BR /&gt;%SYSLPUT start_dx =&amp;amp;&amp;amp;sx&amp;amp;i;&lt;BR /&gt;%SYSLPUT end_dx=&amp;amp;&amp;amp;sxb&amp;amp;i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rsubmit sx&amp;amp;i wait=no;&lt;/P&gt;
&lt;P&gt;libname hold '/apps/sas/datasets/xxxx/dev/nc_qos_sandbox/data/CAUTI/';&lt;BR /&gt;libname hold1 '/apps/sas/datasets/xxxx/dev/nc_qos_sandbox/data/CAUTI1/';&lt;BR /&gt;PROC SQL;&lt;BR /&gt; CONNECT TO teradata AS tera(authdomain="Tera_TDP1_HCCLNC_Auth" mode=teradata tdpid=tdp1.kp.org fastload = yes);&lt;/P&gt;
&lt;P&gt;CREATE TABLE HOLD.&amp;amp;table as &lt;BR /&gt; SELECT * FROM connection to tera&lt;BR /&gt; (SELECT DISTINCT &lt;BR /&gt; C.pat_enc_csn_id,&lt;BR /&gt; A.FLO_MEAS_ID, FLO_MEAS_NAME,&lt;BR /&gt; B.FSD_ID,B.LINE, RECORDED_TIME, ENTRY_TIME,&lt;BR /&gt; OCCURANCE,&lt;BR /&gt; MEAS_VALUE &lt;BR /&gt; FROM HCCLNC_USHARE.&amp;amp;sysuserid._CAUTI AS Z &lt;BR /&gt; LEFT JOIN pat_enc_hsp C ON Z.PAT_ENC_CSN_ID = C.PAT_ENC_CSN_ID&lt;BR /&gt; LEFT JOIN IP_FLWSHT_REC D ON C.INPATIENT_DATA_ID=D.INPATIENT_DATA_ID&lt;BR /&gt; LEFT JOIN IP_FLWSHT_MEAS B ON D.FSD_ID=B.FSD_ID&lt;BR /&gt; LEFT JOIN IP_FLO_GP_DATA A ON A.FLO_MEAS_ID=B.FLO_MEAS_ID&lt;BR /&gt; &lt;BR /&gt; WHERE &lt;BR /&gt; A.FLO_MEAS_ID IN ('12113672','12418219','12418220','12418221','12418222','12418223')&lt;BR /&gt; AND CAST(ENTRY_TIME AS DATE) BETWEEN cast(&amp;amp;start_dx aS date) and cast(&amp;amp;end_dx aS date)&lt;BR /&gt; ORDER BY C.pat_enc_csn_id, ENTRY_TIME); &lt;BR /&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LIBNAME USHARE TERADATA &lt;BR /&gt; DATABASE=HCCLNC_USHARE &lt;BR /&gt; DBINDEX=YES &lt;BR /&gt; authdomain="Tera_TDP1_HCCLNC_Auth" mode=teradata&lt;BR /&gt; TDPID=tdp1.kp.org&lt;BR /&gt; BULKLOAD=YES;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;
&lt;P&gt;CREATE TABLE USHARE.&amp;amp;table._CAUTIX (FASTLOAD=YES SLEEP=1 TENACITY=15) AS &lt;BR /&gt; SELECT DISTINCT PAT_ENC_CSN_ID,OCCURANCE &lt;BR /&gt; from HOLD.&amp;amp;table;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt; CONNECT TO teradata AS tera(authdomain="Tera_TDP1_HCCLNC_Auth" mode=teradata tdpid=tdp1.kp.org fastload = yes);&lt;BR /&gt; &lt;BR /&gt; CREATE TABLE HOLD1.&amp;amp;table as &lt;BR /&gt; SELECT * FROM connection to tera&lt;BR /&gt; (SELECT DISTINCT &lt;BR /&gt; C.pat_enc_csn_id,&lt;BR /&gt; A.FLO_MEAS_ID, FLO_MEAS_NAME,&lt;BR /&gt; B.FSD_ID,B.LINE, RECORDED_TIME, ENTRY_TIME,&lt;BR /&gt; B.OCCURANCE,&lt;BR /&gt; MEAS_VALUE &lt;BR /&gt; FROM HCCLNC_USHARE.&amp;amp;table._CAUTIX AS Z &lt;BR /&gt; LEFT JOIN pat_enc_hsp C ON Z.PAT_ENC_CSN_ID = C.PAT_ENC_CSN_ID&lt;BR /&gt; LEFT JOIN IP_FLWSHT_REC D ON C.INPATIENT_DATA_ID=D.INPATIENT_DATA_ID&lt;BR /&gt; LEFT JOIN IP_FLWSHT_MEAS B ON D.FSD_ID=B.FSD_ID&lt;BR /&gt; LEFT JOIN IP_FLO_GP_DATA A ON A.FLO_MEAS_ID=B.FLO_MEAS_ID AND Z.OCCURANCE=B.OCCURANCE&lt;BR /&gt; &lt;BR /&gt; WHERE &lt;BR /&gt; A.FLO_MEAS_ID IN ('900700','900701','900702','900703') &lt;BR /&gt; ORDER BY C.pat_enc_csn_id, ENTRY_TIME); &lt;BR /&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;endrsubmit; &lt;BR /&gt;waitfor _all_ sx&amp;amp;i;&lt;/P&gt;
&lt;P&gt;signoff _all_;&lt;/P&gt;
&lt;P&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%sendR2(data=months, var=sasdate1, var1=sasdate2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 21:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/361782#M274773</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-05-25T21:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Loading submits to GRID via macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/361846#M274774</link>
      <description>&lt;P&gt;Doing RSUBMITs inside macros can be problematic and I wouldn't recommmend it as the remote sessions know nothing about your macro and SAS can get confused where step boundaries are. A better approach would be to get the macro to write a file containing "normal" SAS code containing the RSUBMIT blocks, then %INCLUDE that later outside of all macro processing.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 07:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/361846#M274774</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-05-26T07:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Loading submits to GRID via macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/362907#M274775</link>
      <description>&lt;P&gt;Thanks Saswiki-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That thought did come to my mind-Ok I can certainly write it out to a file.&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 22:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-submits-to-GRID-via-macro/m-p/362907#M274775</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2017-05-30T22:28:29Z</dc:date>
    </item>
  </channel>
</rss>

