<?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: Creating the same column but shifted by one position in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560435#M156721</link>
    <description>&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge have have(firstobs=2 keep=columna rename=(columna=last)) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 May 2019 10:53:13 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2019-05-21T10:53:13Z</dc:date>
    <item>
      <title>Creating the same column but shifted by one position</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560426#M156715</link>
      <description>&lt;P&gt;Hello I have the following data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
enfile cards turnover;
input columnA $ columnB $ columnC $;
datalines;
AAAA aaaa hello1
BBBB bbbb hello2
CCCC cccc hello3
DDDD dddd hello4
EEEE eeee hello5
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to add a column representing the leading ColumnA;&lt;/P&gt;&lt;P&gt;And have something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WANT;
enfile cards turnover;
input columnA $ columnB $ columnC $ leadingcolumnA $;
datalines;
AAAA aaaa hello1 BBBB
BBBB bbbb hello2 CCCC
CCCC cccc hello3 DDDD
DDDD dddd hello4 EEEE
EEEE eeee hello5 
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I do&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
merge have have(firstobs=2 Rename=columnA=LeadingColumnA);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It shifted the ColumnB and ColumnC as well, which is not what I want.&lt;BR /&gt;&lt;BR /&gt;Do you have any Idea how to do that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560426#M156715</guid>
      <dc:creator>Hugo_B</dc:creator>
      <dc:date>2019-05-21T10:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating the same column but shifted by one position</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560431#M156720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/272343"&gt;@Hugo_B&lt;/a&gt;&amp;nbsp; you missed &lt;STRONG&gt;keep=columnA. &lt;/STRONG&gt;So without that, you are allowing B,C to be overwritten.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;merge have have(firstobs=2 Rename=columnA=LeadingColumnA keep=columnA);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560431#M156720</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-05-21T10:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating the same column but shifted by one position</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560435#M156721</link>
      <description>&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge have have(firstobs=2 keep=columna rename=(columna=last)) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 10:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-the-same-column-but-shifted-by-one-position/m-p/560435#M156721</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-05-21T10:53:13Z</dc:date>
    </item>
  </channel>
</rss>

