<?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: Insert a character in a string after a certain Length in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869598#M343476</link>
    <description>&lt;P&gt;Your pattern is not discernable.&lt;/P&gt;
&lt;P&gt;What is the actual goal?&amp;nbsp; Are you trying to flow text ?&lt;/P&gt;
&lt;P&gt;The PUT statement can do that pretty easily.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename text temp;
data _null_;
  file text lrecl=14 ;
  set have;
  put string;
run;
data _null_;
  infile text;
  input ;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         I have a very  14
2         long string le 14
3         ngth, I want t 14
4         o insert a cha 14
5         racter after e 14
6         very 15 charac 14
7         ters. If not e 14
8         nough characte 14
9         rs at the end  14
10        then, ignore i 14
11        t. 2
NOTE: 11 records were read from the infile TEXT.
&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Apr 2023 15:25:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-04-13T15:25:59Z</dc:date>
    <item>
      <title>Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869590#M343469</link>
      <description>&lt;P&gt;&amp;nbsp;Thank you for looking for the post.&amp;nbsp; I am unsure if this can be achievable, but I Want to put it out there to decide whether it is feasible?&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;My order of preference, If you think at any step it's too much work or not possible or too many conditions involved please ignore that point.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. I want to insert a Character (let's say '@') after every 15 characters. How we can do this?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;String:&lt;/STRONG&gt;&amp;nbsp;&lt;FONT color="#0000FF"&gt;I have a very long string length, I want to insert a character after every 15 characters. If not enough characters at the end then, ignore it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Want:&amp;nbsp;&lt;/STRONG&gt;&lt;FONT color="#0000FF"&gt;I have a very &lt;STRONG&gt;@&lt;/STRONG&gt;long string len&lt;STRONG&gt;@&lt;/STRONG&gt;gth, I want to&lt;STRONG&gt; @&lt;/STRONG&gt;insert a charac&lt;STRONG&gt;@&lt;/STRONG&gt;ter after ever&lt;STRONG&gt;@&lt;/STRONG&gt;y 15 character.&lt;STRONG&gt;@&lt;/STRONG&gt; If not enough &lt;STRONG&gt;@&lt;/STRONG&gt;characters at t&lt;STRONG&gt;@&lt;/STRONG&gt;he end then, i&lt;STRONG&gt;@&lt;/STRONG&gt;gnore it.&lt;/FONT&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Next, if we reach the end of the string and the characters are less than 15, then we have to ignore it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Next, if the 15th character becomes the ' Blank space' in the string, then we have to ignore it ( Not sure if this is possible)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note :&lt;/STRONG&gt; in the above 'Want' string "&lt;FONT color="#0000FF"&gt;ever&lt;STRONG&gt;@&lt;/STRONG&gt;y 15 character.&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;@&lt;/FONT&gt;If ".&amp;nbsp;&lt;FONT color="#FF00FF"&gt;@ &lt;/FONT&gt;&lt;/STRONG&gt;character comes in blank space , is it possible to ignore it? but the next character (@) should be from the blank space.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869590#M343469</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-13T14:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869598#M343476</link>
      <description>&lt;P&gt;Your pattern is not discernable.&lt;/P&gt;
&lt;P&gt;What is the actual goal?&amp;nbsp; Are you trying to flow text ?&lt;/P&gt;
&lt;P&gt;The PUT statement can do that pretty easily.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename text temp;
data _null_;
  file text lrecl=14 ;
  set have;
  put string;
run;
data _null_;
  infile text;
  input ;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         I have a very  14
2         long string le 14
3         ngth, I want t 14
4         o insert a cha 14
5         racter after e 14
6         very 15 charac 14
7         ters. If not e 14
8         nough characte 14
9         rs at the end  14
10        then, ignore i 14
11        t. 2
NOTE: 11 records were read from the infile TEXT.
&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869598#M343476</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-13T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869599#M343477</link>
      <description>&lt;P&gt;Hi Tom, Thanks for your Response. I'm sorry if I am not clear. My goal is to create the string into the Macro variable and use it as a footnote in the RTF, and I have indentation issues ( not regular alignment issues, So I came up with this idea). so I was thinking of inserting the 'white space ' after a specific length. so I need the string after inserting the characters in it.&lt;/P&gt;
&lt;P&gt;Reference: this is what I am trying to achieve in my overall goal&lt;/P&gt;
&lt;P&gt;&lt;A href="https://comp.soft-sys.sas.narkive.com/Lc7LuFXk/getting-indent-in-a-footnote" target="_blank"&gt;https://comp.soft-sys.sas.narkive.com/Lc7LuFXk/getting-indent-in-a-footnote&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data str;
x = "I have a very long string length, I want to insert a character after every 15 character. If not enough characters at the end then, ignore it.";
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>Thu, 13 Apr 2023 15:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869599#M343477</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-13T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869609#M343481</link>
      <description>&lt;P&gt;I would look into whether there is an RTF command you could embed that would tell WORD (or whatever program you use to convert the text of the RTF file into something human readable) would interpret as doing a hanging indent of the text.&amp;nbsp; Then you don't need to split the string yourself.&amp;nbsp; And the rendering will be done taking into account any proportional space fonts you might be using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps some of the codes used in this example:&amp;nbsp;&lt;A href="https://support.sas.com/kb/42/377.html" target="_blank"&gt;https://support.sas.com/kb/42/377.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869609#M343481</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-13T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869618#M343488</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom, Thanks for your Response. I'm sorry if I am not clear. My goal is to create the string into the Macro variable and use it as a footnote in the RTF, and I have indentation issues ( not regular alignment issues, So I came up with this idea). so I was thinking of inserting the 'white space ' after a specific length. so I need the string after inserting the characters in it.&lt;/P&gt;
&lt;P&gt;Reference: this is what I am trying to achieve in my overall goal&lt;/P&gt;
&lt;P&gt;&lt;A href="https://comp.soft-sys.sas.narkive.com/Lc7LuFXk/getting-indent-in-a-footnote" target="_blank" rel="noopener"&gt;https://comp.soft-sys.sas.narkive.com/Lc7LuFXk/getting-indent-in-a-footnote&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data str;
x = "I have a very long string length, I want to insert a character after every 15 character. If not enough characters at the end then, ignore it.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which specific character to you want to insert. Since you say "macro variable" the specific character can be of concern as the macro processor may interpret your character in some manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are going to build the macro variable in a data step then then you need to define a variable long enough to hold the longest expected text &lt;STRONG&gt;plus &lt;/STRONG&gt;the maximum number of inserted characters.&lt;/P&gt;
&lt;P&gt;Since you say the destination is RTF you may be able to use the Escapechar and RAW function to insert the specific RTF code string that would indent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this code intended to produce something that actually goes into the FOOTNOTE "field" or what ever they call it on each page of a document or just something to place the text once at the end of a table or report section?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 16:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869618#M343488</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-13T16:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869619#M343489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following should give you a starting point&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have(KEEP= string want);
	Length String Want $400 char $1 str $15;
	Array sixteens {1000} $16 _temporary_;

	string = 'I have a very long string length, I want to insert a character after every 15 characters. If not enough characters at the end then, ignore it.';
	/* Set some defaults */
	char='@';
	maxStrLen = 15;
	minStrLen = 14;
	numStrChunk = ceil(length(string)/maxStrLen);
	put numStrChunk=;

	Do i=1 to numStrChunk;
		start=(((i-1) * maxStrLen)+1);
		end=(i * maxStrLen);

		str =substr(string,start,maxStrLen);
		sixteens[i]= ifc((length(str)GE minStrLen),cat(str,char),str);
	end;
	Want= cats(of sixteens(*));
	put want=;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might be able to modify it to fit your custom needs&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 16:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869619#M343489</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-04-13T16:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869631#M343498</link>
      <description>&lt;P&gt;Thanks, @Tom, for directing the resources. I will look and see how I can use it per my needs. For this query&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13868"&gt;@AhmedAl_Attar&lt;/a&gt;, the solution work what I asked for. Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13868"&gt;@AhmedAl_Attar&lt;/a&gt;&amp;nbsp;. Not sure I can achieve what I am looking for in the RTFs, but I will keep trying it in different ways.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869631#M343498</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-13T17:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869635#M343502</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;. You guessed it correctly. I am trying to insert the 'White space' or unprintable characters (along with 'escapechar') or other options I am looking at&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;White space --&amp;nbsp;&lt;SPAN&gt;^w^w^w^w^w^w^w^w^w^w&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;unprintable character 'a0a0a0a0a0a0'x&amp;nbsp;'&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;other option-^R/RTF'\ql&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reminding me to look over the length of the variable after inserting it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp; could not understand what you meant in the last part of your question.&amp;nbsp; We have a macro that Automatically creates the dataset of the footnotes reading from the xlsx file. and these footnotes convert into footnote variables and will be placed at the end of the&amp;nbsp; RTF figures or tables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We have the intermediate codes where it takes care of the splitting the string based on the length or next lines, but we having the indentation&amp;nbsp; which is a new thing to achieve like example below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;our code produce the footnote like this&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Abbreviation&amp;nbsp; a:&lt;/STRONG&gt; This is a long string ...................................................... contains'''''''''&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;solution to find the the problems.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Abbreviation b:&lt;/STRONG&gt; This is a long string ...................................................... contains'''''''''&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;solution to find the the problems.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What I am trying to achieve ( Include the the white space or rtf char to indent, we have some thing in code that makes the string goes to next line when there is a word with 'Abbreviation')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Abbreviation a :&lt;/STRONG&gt; This is a long string ...................................................... contains'''''''''&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;FONT color="#FF00FF"&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; &lt;/FONT&gt;&amp;nbsp; solution to find the the problems.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Abbreviation b:&lt;/STRONG&gt; This is a long string ...................................................... contains'''''''''&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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; solution to find the the problems.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 18:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869635#M343502</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-13T18:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869639#M343503</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13868"&gt;@AhmedAl_Attar&lt;/a&gt;&amp;nbsp;. It worked as per my request Post.&amp;nbsp; I hope I can make good use of it. Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 18:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869639#M343503</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-13T18:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869658#M343513</link>
      <description>&lt;P&gt;My question about whether it needs to be a Footnote or not relates to how different programs may treat footnotes.&lt;/P&gt;
&lt;P&gt;The word processor programs have areas where they display text at the bottom of the page and if you have a long section of text, tables or images the text is displayed at the bottom of the page until you force a section change or similar.&lt;/P&gt;
&lt;P&gt;For some ODS destinations the SAS Footnote can end up in this status. There are other ways to place text into a document than a Footnote statement that might fit your purpose better such as Proc ODSLIST or ODSTEXT. These two procs can use data in a data step and can generate bullet list type items.&lt;/P&gt;
&lt;P&gt;You might find the section on Nested Lists in this paper of interest: &lt;A href="https://support.sas.com/resources/papers/proceedings20/4526-2020.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings20/4526-2020.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the need is to display text after output and not in that special part of the document there might be other choices.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tab characters might align but appearance can change based on document default tab settings. Any other character is going to deal with the vagaries of justified text and varying behavior of different font face and size. Not to mention that some of the ODS features by default ignore leading spaces. There are other ways to place text into a document than a Footnote statement that might fit your purposee&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 20:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869658#M343513</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-13T20:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869758#M343560</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data str;
x = "I have a very long string length, I want to insert a character after every 15 character. If not enough characters at the end then, ignore it.";

length want $ 400;
want=prxchange('s/(.{15})/\1@/',-1,x);
run;

proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869758#M343560</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-14T11:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869851#M343595</link>
      <description>&lt;P&gt;Oh, Wowwwwwwwwwwwww, I didn't see this coming.. one step, everything is done. Thank you. I do have a request. Can you please explain what characters/ options were used in it designated? I got some basic ideas after reading online, but I need more. Can you also refer me to some good references to learn these Pearl Expressions? I read on the SAS page, but the explanation needs to be more detailed. Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 16:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869851#M343595</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-14T16:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869857#M343598</link>
      <description>&lt;P&gt;Try this website&amp;nbsp;&lt;A title="regular expressions 101" href="https://regex101.com/" target="_blank" rel="noopener"&gt;regular expressions 101&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plus these papers:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title="Understanding regular expression and its application in SAS using  PRX (PERL regEx) functions" href="https://www.lexjansen.com/phuse/2019/ct/CT12.pdf" target="_blank" rel="noopener"&gt;Understanding regular expression and its application in SAS using PRX (PERL regEx) functions&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A title="RegExing in SAS® for Pattern Matching and Replacement" href="https://support.sas.com/resources/papers/proceedings20/5172-2020.pdf" target="_blank" rel="noopener"&gt;RegExing in SAS® for Pattern Matching and Replacement&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 14 Apr 2023 17:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869857#M343598</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-04-14T17:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869957#M343633</link>
      <description>OK.&lt;BR /&gt;/(.{15})/\1@/&lt;BR /&gt;&lt;BR /&gt;dot(.) means any one single character,&lt;BR /&gt;{15} means repeat dot(.) exactly 15 times,&lt;BR /&gt;that means matching exactly 15 characters.&lt;BR /&gt;\1 represent  (.{15})&lt;BR /&gt;\1@ means replace these 15 characters  with these 15 characters and @ . That meet your requirement.&lt;BR /&gt;&lt;BR /&gt;About good "good references to learn these Pearl Expressions"&lt;BR /&gt;You could search Pearl Expression at support.sas.com , you could find some good stuff .</description>
      <pubDate>Sat, 15 Apr 2023 09:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/869957#M343633</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-15T09:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/870798#M343965</link>
      <description>&lt;P&gt;Thank you very much. Can you clarify this&lt;/P&gt;
&lt;P&gt;Instead of 1 character, I want to place 'two "@@"' characters after 15 characters.&amp;nbsp; &amp;nbsp;how will this work?&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data str;
x = "I have a very long string length, I want to insert a character after every 15 character. If not enough characters at the end then, ignore it.";

length want $ 400;
want=prxchange('s/(.{15})/\1@/',-1,x);
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 14:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/870798#M343965</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-20T14:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/870853#M343998</link>
      <description>&lt;P&gt;Replace the&amp;nbsp;@ with any string you want.&amp;nbsp; Just make sure that you aren't using something that regex considers a command.&amp;nbsp; You can use backslash to escape special characters like \ or / or * or + etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/870853#M343998</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-20T18:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871072#M344082</link>
      <description>As Tom said replace @ with double @.&lt;BR /&gt;want=prxchange('s/(.{15})/\1@/',-1,x);&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;want=prxchange('s/(.{15})/\1@@/',-1,x);</description>
      <pubDate>Fri, 21 Apr 2023 11:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871072#M344082</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-21T11:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871076#M344085</link>
      <description>&lt;P&gt;OK. I found an interesting ERROR information.&lt;/P&gt;
&lt;P&gt;Try this nested one :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data str;
x = "I have a very long string length, I want to insert a character after every 15 character. If not enough characters at the end then, ignore it.";
length want $ 400;
want= prxchange('s/(.{16})/\1@/',-1,prxchange('s/(.{15})/\1@/',-1,x));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1682078511549.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82951i31F18D4753829B13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1682078511549.png" alt="Ksharp_0-1682078511549.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 12:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871076#M344085</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-21T12:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871176#M344114</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871176#M344114</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-21T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a character in a string after a certain Length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871182#M344116</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-a-character-in-a-string-after-a-certain-Length/m-p/871182#M344116</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-04-21T15:54:37Z</dc:date>
    </item>
  </channel>
</rss>

