<?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 dataset modification by using variable values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297569#M62507</link>
    <description>Thank you so much. it is working as expected</description>
    <pubDate>Sun, 11 Sep 2016 01:44:00 GMT</pubDate>
    <dc:creator>jayakumarmm</dc:creator>
    <dc:date>2016-09-11T01:44:00Z</dc:date>
    <item>
      <title>SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297547#M62496</link>
      <description>&lt;P&gt;I need to modfiy my dataset based on specifc variables&amp;nbsp;values. Given below is the dataset&lt;/P&gt;
&lt;P&gt;Please share your thoughts on this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Logic: Consider only the highlighted portion of the current dataset and drop the remaining variable values&amp;nbsp;for creating a new dataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Current dataset:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;COLUMN1 COLUMN2 COLUMN3&lt;BR /&gt;&lt;/STRONG&gt;TEAM&lt;BR /&gt;CLASS&lt;BR /&gt;DEPT&lt;BR /&gt;&lt;STRONG&gt;CUST1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AGE &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;MANA2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YES&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AGE_1 &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EMPLOY3 &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AGE_2 &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;90&lt;/STRONG&gt;&lt;BR /&gt;LOC&lt;BR /&gt;GEO&lt;BR /&gt;STATE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Expected dataset&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;COLUMN1 COLUMN2 COLUMN3&lt;BR /&gt;CUST1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&lt;BR /&gt;MANA2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&lt;BR /&gt;EMPLOY3 &amp;nbsp; &amp;nbsp; &amp;nbsp; NO &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;90&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 18:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297547#M62496</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-10T18:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297549#M62497</link>
      <description>&lt;P&gt;Did you read this dataset from a text file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, it would be easier to modify the read in process.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 18:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297549#M62497</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-10T18:41:29Z</dc:date>
    </item>
    <item>
      <title>Convert excel data into SAS dataset in transposed format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297554#M62512</link>
      <description>&lt;P&gt;I am struggling for 4 to 5 hrs &amp;nbsp;to build a dataset in SAS , I have attached the current and expected dataset. Now I am need of expertise advise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 22:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297554#M62512</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-10T22:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297556#M62500</link>
      <description>&lt;P&gt;if you can rely on the structure of the incoming data, here's a way to go about it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;do i=1 to 2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if column1 in ('TEAM', 'CLASS', 'DEPT', 'LOC', 'GEO', 'STATE') then delete;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if i=1 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; col1 = column1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; col2 = column2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;else col3 = column3;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;keep col1-col3;&lt;/P&gt;
&lt;P&gt;rename col1-col3 = column1-column3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's untested. &amp;nbsp;It's ugly. &amp;nbsp;But it should work.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 22:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297556#M62500</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-10T22:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert excel data into SAS dataset in transposed format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297565#M62513</link>
      <description>&lt;P&gt;You received a solution to this problem. Did that not work? If not, please explain how so we don't waste time on things that don't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post sample data as text, preferably a data step, in your post rather than as an attachment.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2016 01:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297565#M62513</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-11T01:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297569#M62507</link>
      <description>Thank you so much. it is working as expected</description>
      <pubDate>Sun, 11 Sep 2016 01:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297569#M62507</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-11T01:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert excel data into SAS dataset in transposed format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297570#M62514</link>
      <description>Issue is resolved in this post "SAS dataset modification by using variable values". Thank you so much.</description>
      <pubDate>Sun, 11 Sep 2016 01:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297570#M62514</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-11T01:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297571#M62509</link>
      <description>&lt;PRE&gt;

data have;
infile cards truncover;
input (COLUMN1 COLUMN2 COLUMN3) ($);
cards;
TEAM
CLASS
DEPT
CUST1            YES 
AGE                .                    45
MANA2           YES
AGE_1              .                   60
EMPLOY3      NO
AGE_2             .                     90
LOC
GEO
STATE
;
run;
data temp;
 set have;
 if cmiss(column2,column3) ne 2 then do;
  n+1;
  if mod(n,2)=1 then group+1;
  output;
 end;
 drop n;
run;
data want;
 merge temp temp(firstobs=2 keep=group column3 
 rename=(group=_group column3=_column3));
 if group=_group then do;
  column3=_column3;
  output;
 end;
drop _: group;
run;

&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Sep 2016 02:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297571#M62509</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-11T02:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dataset modification by using variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297572#M62510</link>
      <description>&lt;PRE&gt;

data have;
infile cards truncover;
input (COLUMN1 COLUMN2 COLUMN3) ($);
cards;
TEAM
CLASS
DEPT
CUST1            YES 
AGE                .                    45
MANA2           YES
AGE_1              .                   60
EMPLOY3      NO
AGE_2             .                     90
LOC
GEO
STATE
;
run;
data temp;
 set have;
 if cmiss(column2,column3) ne 2 then do;
  n+1;
  if mod(n,2)=1 then group+1;
  output;
 end;
 drop n;
run;
data want;
 merge temp temp(firstobs=2 keep=group column3 
 rename=(group=_group column3=_column3));
 if group=_group then do;
  column3=_column3;
  output;
 end;
drop _: group;
run;

&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Sep 2016 02:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-dataset-modification-by-using-variable-values/m-p/297572#M62510</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-11T02:09:41Z</dc:date>
    </item>
  </channel>
</rss>

