<?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: Skip over a variable and continue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35025#M6916</link>
    <description>This works but I also added spaces following the drug name and company.  These fields have more than one blank delimited word and with LIST input you need two spaces to delimit those fields. I don't know if this is an issue in your actual data or not.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test;&lt;BR /&gt;
   length Rank 3 Drug $25 Manufacturer $25 Sales 8 PerChg 8;&lt;BR /&gt;
   infile cards;&lt;BR /&gt;
   input rank @;&lt;BR /&gt;
   if index(_infile_,')') then input @(')') @;&lt;BR /&gt;
   input (Drug Manufacturer)(&amp;amp;) (Sales PerChg) (:comma.);&lt;BR /&gt;
   cards;&lt;BR /&gt;
3 Plavix  Bristol-Myers Squibb Company  4,223,124 11.2% &lt;BR /&gt;
4 Advair Diskus  GlaxoSmithKline  3,653,410 2.3% &lt;BR /&gt;
5 (1) Seroquel  AstraZeneca Pharmaceuticals  3,117,591 7.2% &lt;BR /&gt;
6 (6) Abilify  Bristol-Myers Squibb Company  3,083,351 30.0% &lt;BR /&gt;
7 Singulair  Merck &amp;amp; Co., Inc.  3,027,378 4.5% &lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]

Message was edited by: data _null_;</description>
    <pubDate>Tue, 22 Mar 2011 13:52:44 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-03-22T13:52:44Z</dc:date>
    <item>
      <title>Skip over a variable and continue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35024#M6915</link>
      <description>I wrote the following code to extract a flat file into sas&lt;BR /&gt;
data lib.test2;&lt;BR /&gt;
length Rank 3 Code1 $3 Drug $25 Manufacturer $25 Sales 8 PerChg 8;&lt;BR /&gt;
infile 'c:\Test2.txt' DLM=' ()';&lt;BR /&gt;
input Rank Code1  Drug  Manufacturer Sales PerChg ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Here is a sample of what the data looks like in the flat file&lt;BR /&gt;
&lt;BR /&gt;
3 Plavix  Bristol-Myers Squibb Company  4,223,124 11.2% &lt;BR /&gt;
4 Advair Diskus  GlaxoSmithKline 3,653,410 2.3% &lt;BR /&gt;
5 (1) Seroquel  AstraZeneca Pharmaceuticals 3,117,591 7.2% &lt;BR /&gt;
6 (6) Abilify  Bristol-Myers Squibb Company  3,083,351 30.0% &lt;BR /&gt;
7 Singulair  Merck &amp;amp; Co., Inc. 3,027,378 4.5% &lt;BR /&gt;
The reason I have a variable called Code1 is because some of the entries have a number with parenthesis.   Two of the entries have such a sequence.  Is there a way to skip the numbers with a parenthesis.  All I really want is&lt;BR /&gt;
Rank&lt;BR /&gt;
Drug&lt;BR /&gt;
Manufacturer&lt;BR /&gt;
Sales&lt;BR /&gt;
Percentage</description>
      <pubDate>Tue, 22 Mar 2011 13:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35024#M6915</guid>
      <dc:creator>omega1983</dc:creator>
      <dc:date>2011-03-22T13:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Skip over a variable and continue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35025#M6916</link>
      <description>This works but I also added spaces following the drug name and company.  These fields have more than one blank delimited word and with LIST input you need two spaces to delimit those fields. I don't know if this is an issue in your actual data or not.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test;&lt;BR /&gt;
   length Rank 3 Drug $25 Manufacturer $25 Sales 8 PerChg 8;&lt;BR /&gt;
   infile cards;&lt;BR /&gt;
   input rank @;&lt;BR /&gt;
   if index(_infile_,')') then input @(')') @;&lt;BR /&gt;
   input (Drug Manufacturer)(&amp;amp;) (Sales PerChg) (:comma.);&lt;BR /&gt;
   cards;&lt;BR /&gt;
3 Plavix  Bristol-Myers Squibb Company  4,223,124 11.2% &lt;BR /&gt;
4 Advair Diskus  GlaxoSmithKline  3,653,410 2.3% &lt;BR /&gt;
5 (1) Seroquel  AstraZeneca Pharmaceuticals  3,117,591 7.2% &lt;BR /&gt;
6 (6) Abilify  Bristol-Myers Squibb Company  3,083,351 30.0% &lt;BR /&gt;
7 Singulair  Merck &amp;amp; Co., Inc.  3,027,378 4.5% &lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]

Message was edited by: data _null_;</description>
      <pubDate>Tue, 22 Mar 2011 13:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35025#M6916</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-22T13:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Skip over a variable and continue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35026#M6917</link>
      <description>Hello Omega1983,&lt;BR /&gt;
&lt;BR /&gt;
A solution could be to exclude the Code1 variable including (1) and (6) into the Drug variable and then use the following code:&lt;BR /&gt;
&lt;BR /&gt;
Drug=SUBSTR(Drug,ANYALPHA(Drug));&lt;BR /&gt;
&lt;BR /&gt;
that excludes (1) and (6) or anything else up to the first letter in the Drug variable.&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Tue, 22 Mar 2011 14:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Skip-over-a-variable-and-continue/m-p/35026#M6917</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-22T14:04:17Z</dc:date>
    </item>
  </channel>
</rss>

