<?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: variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309239#M66495</link>
    <description>&lt;P&gt;Your variable1 after the split contains more than 300 characters.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2016 12:48:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-11-04T12:48:52Z</dc:date>
    <item>
      <title>variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309238#M66494</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset variable having length 600 like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variable&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;An essay is generally a piece of writing that gives the authors own argument but the definition is vague overlapping with those of an article a pamphlet and a short story Essays have traditionally been subclassified as formal and informal Formal essays are characterized by serious purpose dignity logical organization length whereas the informal essay is characterized by the personal element selfrevelation individual tastes and experiences confidential manner humor graceful style rambling structure unconventionality or novelty of theme etc Essays can consist of a number of elements including literary criticism political manifestos learned arguments observations of daily life recollections and reflections of the author Almost all modern essays are written in prose but works in verse have been dubbed essays Alexander Popes An Essay on Criticism and An Essay on Man While brevity usually defines an essay voluminous works like John Lockes An Essay Concerning Human Understanding and Thomas Malthuss An Essay on the Principle of Population are counter examples In some countries the United States and Canada essays have become a formal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to split the variable values with length 300.&lt;/P&gt;&lt;P&gt;like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; variable1&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;&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;&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; &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; &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; variable 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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;An essay is generally a piece of writing that gives the authors&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; confidential manner humor graceful style rambling structure&lt;/P&gt;&lt;P&gt;own argument but the definition is vague overlapping with those&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unconventionality or novelty of theme etc Essays can consist of&lt;BR /&gt;of an article a pamphlet and a short story Essays have traditionally&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a number of elements including literary criticism political&lt;BR /&gt;been subclassified as formal and informal Formal essays are&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; dubbed essays Alexander Popes An Essay on Criticism&lt;BR /&gt;characterized by serious purpose dignity logical organization&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; like John Lockes An Essay Concerning Human Understanding&lt;BR /&gt;length whereas the informal essay is characterized by the personal&amp;nbsp;&amp;nbsp;&amp;nbsp; Thomas Malthuss An Essay on the Principle of Population are&lt;BR /&gt;element selfrevelation individual tastes and experiences&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; the United States and Canada essays have become a formal.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 12:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309238#M66494</guid>
      <dc:creator>Sabharish</dc:creator>
      <dc:date>2016-11-04T12:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309239#M66495</link>
      <description>&lt;P&gt;Your variable1 after the split contains more than 300 characters.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 12:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309239#M66495</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-04T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309240#M66496</link>
      <description>&lt;P&gt;I don't see how you're separating the string but assuming it's just 300&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var1 = SUBSTR (string, 1, 300);&lt;/P&gt;
&lt;P&gt;var2 = SUBSTR (string, 300);&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 12:50:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309240#M66496</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-04T12:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309245#M66497</link>
      <description>&lt;P&gt;If you want to avoid cutting inside of a word, you can proceed as follows :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
format text $600.;
text="An essay is generally a piece of writing that gives the authors own argument but the definition is vague overlapping with those of an article a pamphlet and a short story Essays have traditionally been subclassified as formal and informal Formal essays are characterized by serious purpose dignity logical organization length whereas the informal essay is characterized by the personal element selfrevelation individual tastes and experiences confidential manner humor graceful style rambling structure unconventionality or novelty of theme etc Essays can consist of a number of elements including literary criticism political manifestos learned arguments observations of daily life recollections and reflections of the author Almost all modern essays are written in prose but works in verse have been dubbed essays Alexander Popes An Essay on Criticism and An Essay on Man While brevity usually defines an essay voluminous works like John Lockes An Essay Concerning Human Understanding and Thomas Malthuss An Essay on the Principle of Population are counter examples In some countries the United States and Canada essays have become a formal.";
run;

data want (keep=text1 text2);
set have;
format text1 text2 $300.;
text1=prxchange("s/^([\w ]{1,300}) .*$/$1/",-1,text);
text2=substr(text,length(text1)+1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 13:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309245#M66497</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2016-11-04T13:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309254#M66502</link>
      <description>&lt;P&gt;There are more than 600.&lt;/P&gt;
&lt;P&gt;Sorry. found a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noquotelenmax;
data x;
a='
An essay is generally a piece of writing that gives the authors
 own argument but the definition is vague overlapping with those of
  an article a pamphlet and a short story Essays have traditionally 
  been subclassified as formal and informal Formal essays are characterized
   by serious purpose dignity logical organization length whereas the informal 
   essay is characterized by the personal element selfrevelation individual tastes
    and experiences confidential manner humor graceful style rambling structure
     unconventionality or novelty of theme etc Essays can consist of a number 
     of elements including literary criticism political manifestos learned 
     arguments observations of daily life recollections and reflections of 
     the author Almost all modern essays are written in prose but works in 
     verse have been dubbed essays Alexander Popes An Essay on Criticism and
      An Essay on Man While brevity usually defines an essay voluminous works 
      like John Lockes An Essay Concerning Human Understanding and Thomas 
      Malthuss An Essay on the Principle of Population are counter examples 
      In some countries the United States and Canada essays have become a formal.';
run;
data temp;
 set x;
 n+1;
 length temp $ 100;
 do i=1 to countw(a,' ');
  temp=scan(a,i,' ');
  output;
 end;
keep n temp;
run;
data temp;
 set temp;
 by n;
 if first.n then do;len=0;group=0;end;
 len+length(temp)+1;
 if len gt 300 then do;len=length(temp)+1;group+1;end;
run;
data temp1;
length var $ 400;
do until(last.group);
 set temp;
 by n group;
 var=catx(' ',var,temp);
end;
keep n var;
run;
proc transpose data=temp1 out=want(drop=_name_);
by n;
var var;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2016 13:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309254#M66502</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-04T13:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309260#M66503</link>
      <description>&lt;P&gt;To cut off at the last blank before the 300th character, do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
variable = 'An essay is generally a piece of writing that gives the authors own argument but the definition is vague overlapping with those of an article a pamphlet and a short story Essays have traditionally been subclassified as formal and informal Formal essays are characterized by serious purpose dignity logical organization length whereas the informal essay is characterized by the personal element selfrevelation individual tastes and experiences confidential manner humor graceful style rambling structure unconventionality or novelty of theme etc Essays can consist of a number of elements including literary criticism political manifestos learned arguments observations of daily life recollections and reflections of the author Almost all modern essays are written in prose but works in verse have been dubbed essays Alexander Popes An Essay on Criticism and An Essay on Man While brevity usually defines an essay voluminous works like John Lockes An Essay Concerning Human Understanding and Thomas Malthuss An Essay on the Principle of Population are counter examples In some countries the United States and Canada essays have become a formal.';
length variable1 variable2 $300;
i = 300;
do until (substr(variable,i,1) = ' ');
  i = i - 1;
end;
variable1 = substr(variable,1,i-1);
variable2 = substr(variable,i+1);
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2016 13:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable/m-p/309260#M66503</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-04T13:38:33Z</dc:date>
    </item>
  </channel>
</rss>

