<?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 Seperate Files in Hierarchical Delimiters in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307013#M20762</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm having quite a bit of trouble prepping the data. It's a text file. Trying to workout it out using SAS Enterprise Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the input is such&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"AI0":[-1755,-4320,-6965,-4770,-2053,-4515,-6242,-1785,1766,10582],"AI1":[582,1002,1118,-625,-2439]},{"AI0":[496,-3393,-2131,-7,-909,-1164,1272],"AI1":[1642,-462,-1147,224,13,49,696,-985]}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish returned a result as such&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AI0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AI1&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-1755 &amp;nbsp; &amp;nbsp; &amp;nbsp; 582&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-4320 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1002&lt;/P&gt;
&lt;P&gt;until the end of row 1 and continue with row 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 496 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1642&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-3393 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-462&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2016 03:01:41 GMT</pubDate>
    <dc:creator>Varma8</dc:creator>
    <dc:date>2016-10-25T03:01:41Z</dc:date>
    <item>
      <title>Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307013#M20762</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm having quite a bit of trouble prepping the data. It's a text file. Trying to workout it out using SAS Enterprise Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the input is such&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"AI0":[-1755,-4320,-6965,-4770,-2053,-4515,-6242,-1785,1766,10582],"AI1":[582,1002,1118,-625,-2439]},{"AI0":[496,-3393,-2131,-7,-909,-1164,1272],"AI1":[1642,-462,-1147,224,13,49,696,-985]}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish returned a result as such&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AI0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AI1&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-1755 &amp;nbsp; &amp;nbsp; &amp;nbsp; 582&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-4320 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1002&lt;/P&gt;
&lt;P&gt;until the end of row 1 and continue with row 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 496 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1642&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-3393 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-462&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 03:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307013#M20762</guid>
      <dc:creator>Varma8</dc:creator>
      <dc:date>2016-10-25T03:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307028#M20763</link>
      <description>&lt;P&gt;This task will be reasonably complex. &amp;nbsp;I'm not sure that you can do it using only the prepackaged capabilities of Enterprise Guide. &amp;nbsp;You will likely need some custom code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get started, you will need to sketch out the result you want in more detail. &amp;nbsp;You have a different number of values for AI0 vs. AI1 in the incoming data. &amp;nbsp;Which ones do you use and which do you discard? &amp;nbsp;How do they match up? &amp;nbsp;How do you determine the value of NO? &amp;nbsp;For your sample input data, you will need to sketch out the entire result not just a representative sample.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 05:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307028#M20763</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-25T05:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307031#M20764</link>
      <description>&lt;P&gt;Hi Astounding,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply. I was wondering the same too that if I'm able to perform that thru EG without writing any codes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets assume that AI0 and AI1 are two sensors submitting its values. Every second, it transmits hundreds of inputs. The &lt;STRONG&gt;{ }&amp;nbsp;&lt;/STRONG&gt;represents one second as in the data submitted by sensors.&amp;nbsp;&lt;SPAN&gt;{"AI0":[-1755,-4320,-6965,-4770,-2053,-4515,-6242,&lt;/SPAN&gt;&lt;WBR /&gt;&lt;SPAN&gt;-1785,1766,10582],"AI1":[582,1002,1118,-625,-2439]&lt;/SPAN&gt;&lt;WBR /&gt;&lt;SPAN&gt;} means that in second 1, AI0 submitted -1755 till 10582 and AI1 submitted the values 582 till -2439.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And the next&amp;nbsp;{"AI0":[496,-3393,-2131,-7,-909,-1164,1272],"AI1&lt;WBR /&gt;&lt;SPAN&gt;":[1642,-462,-1147,224,13,49,696,-985]} means data from the sensors at second 2.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The data comes in a ASC file and thus the Delimiter for the seconds are {} and for the sensors are []&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;I would like to arrange the data thru EG in this format&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Second &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AI0 &amp;nbsp; &amp;nbsp; &amp;nbsp; AI1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-1755 &amp;nbsp; &amp;nbsp; &amp;nbsp; 582&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-4320 &amp;nbsp; &amp;nbsp; &amp;nbsp;1002&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6965 &amp;nbsp; &amp;nbsp; &amp;nbsp;1118&lt;/P&gt;
&lt;P&gt;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ....&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 496 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1642&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-3393 &amp;nbsp; &amp;nbsp; &amp;nbsp;-462&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you could enlighten me&lt;/P&gt;
&lt;P&gt;I know it could be a tedious process&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 05:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307031#M20764</guid>
      <dc:creator>Varma8</dc:creator>
      <dc:date>2016-10-25T05:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307034#M20766</link>
      <description>&lt;P&gt;The details are important here. &amp;nbsp;You will need to sketch out the complete final result (for the limited amount of data that you have already typed in. &amp;nbsp;A sample with "..." included will not be sufficient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are questions about how to line up the data when each sensor sends a different number of measurements per second. &amp;nbsp;So you will need to define the final result in more detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No programming is required at this point, but a crystal clear picture of the final outcome is mandatory.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 05:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307034#M20766</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-25T05:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307036#M20767</link>
      <description>&lt;P&gt;I would like to display the aggregate of the data of each second of the result&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5467i67F40F34F1641D7E/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Results.png" title="Results.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date time column is what I mentioned as seconds earlier. As you can see, I to find the average of the values of each of the seconds of each sensors. From the data I've given, the first two rows of result will be the output. 15:14 and 15:15&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 06:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307036#M20767</guid>
      <dc:creator>Varma8</dc:creator>
      <dc:date>2016-10-25T06:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307061#M20768</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noquotelenmax;
data have;
  infile "/folders/myfolders/SeriesDataOut.txt" lrecl=200000 dlm='}{';
  input STR : $800. @@;
  if _N_=1 then 
    call execute ('data temp; length  AI0 AI1 $ 200;');
  if STR=:'"AI0"' then do;
    STR=translate(STR,'""','[]' ); 
    STR=tranwrd(STR,'","','";"');
    STR=tranwrd(STR,'":"','"n="');
    call execute(cats(STR,';n+1;output;'));
  end;  
run;

data want;
 set temp;
 do i=1 to max(countw(AI0,','),countw(AI1,','));
  _AI0=input(scan(AI0,i,','),best32.);
  _AI1=input(scan(AI1,i,','),best32.);
  output;
 end;
 keep _: n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Oct 2016 08:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307061#M20768</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-25T08:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307342#M20786</link>
      <description>&lt;P&gt;Hi KSharp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code works perfectly with the given string. But, my data has s&lt;SPAN&gt;tring longer than 32767&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call&amp;nbsp;execute&amp;nbsp;('data temp; length&amp;nbsp; AI0 AI1 $ 32767;');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the cmd length is limiting the character read to just 32767. My data string is around 40000 as in&amp;nbsp;&lt;SPAN&gt;{"AI0":[-1755,-4320,-6965,-4770,-2053,-4515,-6242,&lt;/SPAN&gt;&lt;WBR /&gt;&lt;SPAN&gt;-1785,1766,10582],"AI1":[582,1002,1118,-625,-2439]&lt;/SPAN&gt;&lt;WBR /&gt;&lt;SPAN&gt;} is longer than 32767&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any workaround for this request. Maybe a different call function?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 09:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307342#M20786</guid>
      <dc:creator>Varma8</dc:creator>
      <dc:date>2016-10-26T09:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Seperate Files in Hierarchical Delimiters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307350#M20787</link>
      <description>&lt;P&gt;OK. It looks like you need more code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have(where=(str is not missing));
  infile "/folders/myfolders/SeriesDataOut.txt" dsd lrecl=2000000 dlm='}{[],:';
  input STR : $100. @@;
  length name $ 100;
  retain name;
  if upcase(str) =: 'AI' then do;name=str;delete;end;
 run;
proc transpose data=have out=temp(drop=_name_);
 by name notsorted;
 var str;
run;
data temp;
 set temp;
 if name='AI0' then n+1;
run;
proc transpose data=temp out=want(drop=_name_);
 by n;
 id name;
 var col:;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 10:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Seperate-Files-in-Hierarchical-Delimiters/m-p/307350#M20787</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-26T10:21:38Z</dc:date>
    </item>
  </channel>
</rss>

