<?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: SAS Thread Reading in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290524#M59754</link>
    <description>&lt;P&gt;Thank you! &amp;nbsp;I will try it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2016 17:42:01 GMT</pubDate>
    <dc:creator>SAS5</dc:creator>
    <dc:date>2016-08-09T17:42:01Z</dc:date>
    <item>
      <title>SAS Thread Reading</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290500#M59750</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to multi-threading in SAS. &amp;nbsp;I know the table is locked if editing a table but is it possible to read (only) a table at the same time from multiple threads?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 15:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290500#M59750</guid>
      <dc:creator>SAS5</dc:creator>
      <dc:date>2016-08-09T15:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Thread Reading</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290505#M59751</link>
      <description>&lt;P&gt;Have you looked at PROC DS2? &amp;nbsp;Multithreading is baked in. &amp;nbsp;See &lt;A href="http://blogs.sas.com/content/sastraining/2015/04/25/jedi-sas-tricks-warp-speed-data-steps-ds2/" target="_self"&gt;this blog post for an example&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The benefit is bigger when the process is CPU bound, not I/O bound. &amp;nbsp;But if parallel processing is what you're after, DS2 is worth a look.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 16:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290505#M59751</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-08-09T16:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Thread Reading</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290509#M59752</link>
      <description>&lt;P&gt;OK! Thanks. I will take a look at DS2. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, &amp;nbsp;to give you some context:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are using ( rsubmit, signoff) to submit multiple threads. &amp;nbsp;Each thread need to access exactly the same table for reading only. &amp;nbsp;Currently we are duplicating each table multiple times for each thread. &amp;nbsp;I was wondering if it is possible to not do this - just read the table directly from different threads at the same time. &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 16:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290509#M59752</guid>
      <dc:creator>SAS5</dc:creator>
      <dc:date>2016-08-09T16:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Thread Reading</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290512#M59753</link>
      <description>&lt;P&gt;I don't see why not...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, here's a program that we can run in 3 sessions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.cars(where=(Origin='Asia'));
run;

proc means data=sashelp.cars(where=(Origin='Europe'));
run;

proc means data=sashelp.cars(where=(Origin='USA'));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For such a simple program this is a lot of overhead, but I used EG's &lt;STRONG&gt;Analyze Program&lt;/STRONG&gt; feature to create a grid-ready version of the program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*----------------------------------------------------------------------------*/
/* There are 3 tasks in this job.                                             */
/* 3 of these tasks can be RSUBMITed.                                         */
/* These 3 tasks used 22 units of time.                                       */
/* The longest task took 10 units of time, 45.5% of total time.               */
/* Based on dependencies, a maximum of 3 tasks might run in parallel.         */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* This is the user-modifiable number of connect sessions                     */
/*----------------------------------------------------------------------------*/
%let SCAPROC_SESSIONS_COUNT=3;

/*----------------------------------------------------------------------------*/
/* *** Please don't edit anything below this line.                            */
/* *** Regenerate the file if you need to make changes.                       */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* Enable grid service                                                        */
/*----------------------------------------------------------------------------*/
%let rc=%sysfunc(grdsvc_enable(_all_, resource=SASMKT));

/*----------------------------------------------------------------------------*/
/* This macro starts up the connect sessions                                  */
/*----------------------------------------------------------------------------*/
%macro scaproc_start_sessions(count);
  %do i = 1 %to &amp;amp;count;
    signon sess&amp;amp;i signonwait=no connectwait=no cmacvar=scaproc_signon_&amp;amp;i;
  %end;
%mend scaproc_start_sessions;

/*----------------------------------------------------------------------------*/
/* Start up our connect sessions.                                             */
/*----------------------------------------------------------------------------*/
%scaproc_start_sessions(&amp;amp;SCAPROC_SESSIONS_COUNT);

/*----------------------------------------------------------------------------*/
/* This function call initializes data structures for our SCAGRID functions.  */
/* We pass in the number of sessions and the number tasks in this job.        */
/*----------------------------------------------------------------------------*/
proc scaproc; startup 3 &amp;amp;SCAPROC_SESSIONS_COUNT; run; 

/*----------------------------------------------------------------------------*/
/* TASK 1 run in rsubmit                                                      */
/*----------------------------------------------------------------------------*/
/* I/O Activity                                                               */
/*----------------------------------------------------------------------------*/
/* DATASET    INPUT  SEQ   created in task 0 #C00003.CARS.DATA                */
/*----------------------------------------------------------------------------*/
/* Symbol activity                                                            */
/*----------------------------------------------------------------------------*/
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYS_IOUSEEE             */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMSTACKODS          */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMTRACE             */
/*----------------------------------------------------------------------------*/
/* ELAPSED 10                                                                 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get an available session                                                   */
/*----------------------------------------------------------------------------*/
proc scaproc; getsession 1 "sess"; run; 
%put sess=&amp;amp;sess; 
/*----------------------------------------------------------------------------*/
/* rsubmit for task 1                                                         */
/*----------------------------------------------------------------------------*/
rsubmit &amp;amp;sess sysrputsync=yes cmacvar=scagrid_task_1;
/* task 1 rsubmit */
proc means data=sashelp.cars(where=(Origin='Asia'));
run;


/* for incomplete steps */ ;run; quit; run;
endrsubmit;


/*----------------------------------------------------------------------------*/
/* TASK 2 run in rsubmit                                                      */
/*----------------------------------------------------------------------------*/
/* I/O Activity                                                               */
/*----------------------------------------------------------------------------*/
/* DATASET    INPUT  SEQ   created in task 0 #C00003.CARS.DATA                */
/*----------------------------------------------------------------------------*/
/* Symbol activity                                                            */
/*----------------------------------------------------------------------------*/
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYS_IOUSEEE             */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMSTACKODS          */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMTRACE             */
/*----------------------------------------------------------------------------*/
/* ELAPSED 6                                                                  */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Dependencies                                                               */
/* Highest task depended on: 0                                                */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get an available session                                                   */
/*----------------------------------------------------------------------------*/
proc scaproc; getsession 2 "sess"; run; 
%put sess=&amp;amp;sess; 
/*----------------------------------------------------------------------------*/
/* rsubmit for task 2                                                         */
/*----------------------------------------------------------------------------*/
rsubmit &amp;amp;sess sysrputsync=yes cmacvar=scagrid_task_2;
/* task 2 rsubmit */
proc means data=sashelp.cars(where=(Origin='Europe'));
run;


/* for incomplete steps */ ;run; quit; run;
endrsubmit;


/*----------------------------------------------------------------------------*/
/* TASK 3 run in rsubmit                                                      */
/*----------------------------------------------------------------------------*/
/* I/O Activity                                                               */
/*----------------------------------------------------------------------------*/
/* DATASET    INPUT  SEQ   created in task 0 #C00003.CARS.DATA                */
/* FILE       OUTPUT       created in task 3 /sas/work/SAS_work038D0000658E_misci01p/#LN00023  */
/*----------------------------------------------------------------------------*/
/* Symbol activity                                                            */
/*----------------------------------------------------------------------------*/
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYS_IOUSEEE             */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMSTACKODS          */
/* SYMBOL GET task:0 used by subsequent task:no  Name:SYSSUMTRACE             */
/*----------------------------------------------------------------------------*/
/* ELAPSED 6                                                                  */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Dependencies                                                               */
/* Highest task depended on: 0                                                */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get an available session                                                   */
/*----------------------------------------------------------------------------*/
proc scaproc; getsession 3 "sess"; run; 
%put sess=&amp;amp;sess; 
/*----------------------------------------------------------------------------*/
/* rsubmit for task 3                                                         */
/*----------------------------------------------------------------------------*/
rsubmit &amp;amp;sess sysrputsync=yes cmacvar=scagrid_task_3;
/* task 3 rsubmit */
proc means data=sashelp.cars(where=(Origin='USA'));
run;

;*';*";*/;quit;run; /*Quote and Comment Killer*/

/* for incomplete steps */ ;run; quit; run;
endrsubmit;


/*----------------------------------------------------------------------------*/
/* This macro issues waitfors and signoffs for our sessions.                  */
/*----------------------------------------------------------------------------*/
%macro scagrid_waitfors(count);
  %do i = 1 %to &amp;amp;count;
    waitfor sess&amp;amp;i;
    signoff sess&amp;amp;i;
  %end;
%mend scagrid_waitfors;

/*----------------------------------------------------------------------------*/
/* Wait for and sign off all sessions.                                        */
/*----------------------------------------------------------------------------*/
%scagrid_waitfors(&amp;amp;SCAPROC_SESSIONS_COUNT);

/*----------------------------------------------------------------------------*/
/* Termination for our  SCAGRID functions.                                    */
/*----------------------------------------------------------------------------*/
proc scaproc; shutdown; run;

/*----------------------------------------------------------------------------*/
/* All done.                                                                  */
/*----------------------------------------------------------------------------*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 16:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290512#M59753</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-08-09T16:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Thread Reading</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290524#M59754</link>
      <description>&lt;P&gt;Thank you! &amp;nbsp;I will try it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 17:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Thread-Reading/m-p/290524#M59754</guid>
      <dc:creator>SAS5</dc:creator>
      <dc:date>2016-08-09T17:42:01Z</dc:date>
    </item>
  </channel>
</rss>

