<?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: Using arrays and substr function for sequencing DNA in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251670#M56736</link>
    <description>&lt;P&gt;How about this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dna2 (drop=dna i);
set dna;
array d(60) $1;
do i=1 to 60;
  d(i)=char(dna,i);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Alternatively, you could use the SUBSTR function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;d(i)=substr(dna,i,1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 22:40:14 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2016-02-22T22:40:14Z</dc:date>
    <item>
      <title>Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251667#M56733</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;I am new at arrasy, but I am trying to get the below 15 sequences of DNA, which are 60 characters, to be 60 variables, D1-D60, where D1 holds the first position, D2 the second position, and so on.  I have never used the substr function, so I am probably doing it incorrectly. Any help would be great&lt;BR /&gt;&lt;BR /&gt;data dna2 (drop=dna i);
set dna;

array d(60);
do i=1 to 60;
	d(i)=d(4/(i));
	dna=substr (dna, 1, 15);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;data dna;
	length dna $ 60;
	input dna $;
datalines;
TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACA
TGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTG
CTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAA
CAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGT
GTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTA
CTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGG
GAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGC
TGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTG
GCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAG
TGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAG
TGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGA
GGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCG
GCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTG
CGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGC
CAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAAC
;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251667#M56733</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2016-02-22T22:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251670#M56736</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dna2 (drop=dna i);
set dna;
array d(60) $1;
do i=1 to 60;
  d(i)=char(dna,i);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Alternatively, you could use the SUBSTR function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;d(i)=substr(dna,i,1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251670#M56736</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-22T22:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251671#M56737</link>
      <description>That works, I almost had it, but do you know how to use the substr function doing it at all?</description>
      <pubDate>Mon, 22 Feb 2016 22:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251671#M56737</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2016-02-22T22:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251672#M56738</link>
      <description>&lt;P&gt;Please see the edited post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The CHAR function syntax is a bit shorter. With SUBSTR you have to specify&amp;nbsp;where to start the substring (second argument) and how many characters it should contain (third argument). The latter is implied to be 1 with the CHAR function.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251672#M56738</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-22T22:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251674#M56740</link>
      <description>Thank you, that makes sense to use the char over the substr.....and thank you for your help</description>
      <pubDate>Mon, 22 Feb 2016 22:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251674#M56740</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2016-02-22T22:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251701#M56751</link>
      <description>&lt;P&gt;This maybe a little obscured for you, but depending on the size of your data set, it will save you some time considerably.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set dna;
array d(60) $1;
call pokelong(dna, addrlong(d(1)),60);
drop dna;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 02:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251701#M56751</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-02-23T02:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251743#M56756</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt;: Thanks for pointing out this interesting alternative. I had never used this call routine. The warnings in the &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl/en/lefunctionsref/67960/HTML/default/p0r4cpj922216nn1p3mmidjazcte.htm" target="_blank"&gt;documentation&lt;/A&gt;&amp;nbsp;are quite intimidating, though ("devastating problems ... destroying a vital element ..."). So, maybe a bit too advanced for someone who had "never used the substr function."&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 09:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251743#M56756</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-23T09:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251744#M56757</link>
      <description>&lt;P&gt;You could read the data directly into the array like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dna;
array dna {60} $1 dna1-dna60;
do i = 1 to 60;
input dna{i} $1.@;
end;
drop i;
datalines;
TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACA
TGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTG
CTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAA
CAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGT
GTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTA
CTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGG
GAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGC
TGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTG
GCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAG
TGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAG
TGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGA
GGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCG
GCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTG
CGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGC
CAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAAC
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 10:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251744#M56757</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-23T10:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays and substr function for sequencing DNA</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251764#M56758</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;, True and agreed. Direct memory write-operation has&amp;nbsp;inherited risk. We implemented a few in the case where huge amount of data&amp;nbsp;manipulation is required, and it does help. Here is just to add some new elements to the discussion, after all, besides seeking answers for specific questions, people also want to learn.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 13:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-arrays-and-substr-function-for-sequencing-DNA/m-p/251764#M56758</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-02-23T13:54:21Z</dc:date>
    </item>
  </channel>
</rss>

