<?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: Is there an equivalent to PUT @29 X when creating a DATA STEP text string? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198394#M37155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use substr:&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length var $200;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var="Something here";&lt;/P&gt;&lt;P&gt;&amp;nbsp; substr(var,29,1)="A";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2015 14:18:57 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-08-13T14:18:57Z</dc:date>
    <item>
      <title>Is there an equivalent to PUT @29 X when creating a DATA STEP text string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198393#M37154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I want to write some data to a text file, where I have an ID variable and a numeric variable X, and I want X to begin in column 29, I can use code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file "myfile.txt";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put id $12. @29 X;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But suppose I am creating a text string as a data step variable, rather than writing to a text file, and I want X to always begin in column 29, regardless of the length of the ID variable (which can be any number of characters, but less than 29 characters).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an equivalent to the @29, something that works, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textstr=id||@29 X; /* I know this line doesn't work, but it illustrates what I am trying to do */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198393#M37154</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-08-13T14:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent to PUT @29 X when creating a DATA STEP text string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198394#M37155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use substr:&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length var $200;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var="Something here";&lt;/P&gt;&lt;P&gt;&amp;nbsp; substr(var,29,1)="A";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198394#M37155</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-13T14:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent to PUT @29 X when creating a DATA STEP text string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198395#M37156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data work.have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; length &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id $ 28&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text $ 30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input id text;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;1001 Bob&lt;/P&gt;&lt;P&gt;73 Susan&lt;/P&gt;&lt;P&gt;2434813 Bill&lt;/P&gt;&lt;P&gt;79746746734 Marry&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set work.have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; length mystr $ 100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format id $29.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; mystr = cat(id, text);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put mystr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put id $28. text;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198395#M37156</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2015-08-13T14:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent to PUT @29 X when creating a DATA STEP text string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198396#M37157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;RW9 wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Just use substr:&lt;/P&gt;
&lt;P&gt;data temp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; length var $200;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var="Something here";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; substr(var,29,1)="A";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;That works fine! Thank you! I have never used substr on the left hand side of the equal sign before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-to-PUT-29-X-when-creating-a-DATA-STEP/m-p/198396#M37157</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-08-13T14:40:28Z</dc:date>
    </item>
  </channel>
</rss>

