<?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: Input data with embedded delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428626#M105842</link>
    <description>Sorry, I forgot to mention that there were additional spaces in between values as below -&lt;BR /&gt;&lt;BR /&gt;data multiple(drop=x);&lt;BR /&gt;input #1 @1 name $50.&lt;BR /&gt;#2 @1 address $50.;&lt;BR /&gt;input @;&lt;BR /&gt;x=anyalpha(_infile_,-50)-2;&lt;BR /&gt;_infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);&lt;BR /&gt;input #3 @1 city $50.&lt;BR /&gt;state $3.&lt;BR /&gt;zip $7.;&lt;BR /&gt;name=compbl(name);&lt;BR /&gt;address=compbl(address);&lt;BR /&gt;city=compbl(city);&lt;BR /&gt;datalines;&lt;BR /&gt;Ron Cody&lt;BR /&gt;89 Lazy Brook Road&lt;BR /&gt;Flemington NJ 08822&lt;BR /&gt;Tim Brown&lt;BR /&gt;35 Peak Dr&lt;BR /&gt;New York City NY 19454&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;How to deal with these extra blanks in city value?</description>
    <pubDate>Wed, 17 Jan 2018 22:05:50 GMT</pubDate>
    <dc:creator>PoojaP1</dc:creator>
    <dc:date>2018-01-17T22:05:50Z</dc:date>
    <item>
      <title>Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426961#M105250</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying the following program to create the dataset avgcelcius by inputting the records mentioned in datalines section. But, since it contains embedded spaces I tried using "&amp;amp;" format modifier of list input but it doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I manually adjusted the records in fixed columns, it worked! But, I want to know how can I do it by using any other way ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA avgcelsius;&lt;BR /&gt;input City &amp;amp;$17. jan feb mar apr may jun&lt;BR /&gt;jul aug sep oct nov dec;&lt;BR /&gt;DATALINES;&lt;BR /&gt;State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1&lt;BR /&gt;Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20&lt;BR /&gt;St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1&lt;BR /&gt;New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12&lt;BR /&gt;Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5&lt;BR /&gt;Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12&lt;BR /&gt;Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12&lt;BR /&gt;Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6&lt;BR /&gt;San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11&lt;BR /&gt;San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 19:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426961#M105250</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-11T19:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426976#M105256</link>
      <description>&lt;P&gt;fun stuff, just play:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; avgcelsius;&lt;/P&gt;&lt;P&gt;infile datalines ;&lt;/P&gt;&lt;P&gt;length city $&lt;STRONG&gt;30&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;input @;&lt;/P&gt;&lt;P&gt;city=strip(substr(_infile_,&lt;STRONG&gt;1&lt;/STRONG&gt;,anydigit(_infile_)-&lt;STRONG&gt;2&lt;/STRONG&gt;)) ;&lt;/P&gt;&lt;P&gt;input @(length(city)+&lt;STRONG&gt;1&lt;/STRONG&gt;) jan feb mar apr may jun&lt;/P&gt;&lt;P&gt;jul aug sep oct nov dec;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1&lt;/P&gt;&lt;P&gt;Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20&lt;/P&gt;&lt;P&gt;St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1&lt;/P&gt;&lt;P&gt;New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12&lt;/P&gt;&lt;P&gt;Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5&lt;/P&gt;&lt;P&gt;Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12&lt;/P&gt;&lt;P&gt;Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12&lt;/P&gt;&lt;P&gt;Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6&lt;/P&gt;&lt;P&gt;San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11&lt;/P&gt;&lt;P&gt;San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 19:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426976#M105256</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-11T19:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426986#M105259</link>
      <description>&lt;P&gt;The &amp;amp; will only do what you want if there are at least two spaces separating the fields. You can force an extra space as follows:&lt;/P&gt;
&lt;PRE&gt;data avgcelsius (drop=x);
  informat City $17.;
  input @;
  x=anyalpha(_infile_,-50);
  _infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);
  input City &amp;amp; jan feb mar apr may jun jul aug sep oct nov dec;
  DATALINES;
State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1
Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20
St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1
New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12
Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5
Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12
Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12
Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6
San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11
San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14
;
RUN;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 20:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426986#M105259</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-11T20:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426995#M105262</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA avgcelsius;
length city $ 17;
infile cards col=col;
input @'2c'x + 4 @;
city = substr(_infile_,1,col-2);
input jan feb mar apr may jun jul aug sep oct nov dec;
DATALINES;
State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1
Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20
St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1
New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12
Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5
Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12
Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12
Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6
San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11
San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 20:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/426995#M105262</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2018-01-11T20:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/427183#M105328</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data avgcelsius ;
infile datalines dlm=' ' truncover;
  input @;
  _infile_=prxchange('s/(\s[a-z][a-z]\s)/$1 /i',1,_infile_);
  input City &amp;amp; $20. jan feb mar apr may jun jul aug sep oct nov dec;
DATALINES;
State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1
Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20
St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1
New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12
Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5
Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12
Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12
Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6
San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11
San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jan 2018 13:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/427183#M105328</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-12T13:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/427198#M105338</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data avgcelsius ;
infile datalines dlm=' ' truncover;
  input @;
  p=findc(_infile_,',');
  city=substr(_infile_,1,p+4);
  input @p+4 jan feb mar apr may jun jul aug sep oct nov dec;
  drop p;
DATALINES;
State College, PA -2 -2 2 8 14 19 21 20 16 10 4 -1
Miami, FL 20 20 22 23 26 27 28 28 27 26 23 20
St. Louis, MO -1 1 6 13 18 23 26 25 21 15 7 1
New Orleans, LA 11 13 16 20 23 27 27 27 26 21 16 12
Madison, WI -8 -5 0 7 14 19 22 20 16 10 2 -5
Houston, TX 10 12 16 20 23 27 28 28 26 21 16 12
Phoenix, AZ 12 14 16 21 26 31 33 32 30 23 16 12
Seattle, WA 5 6 7 10 13 16 18 18 16 12 8 6
San Francisco, CA 10 12 12 13 14 15 15 16 17 16 14 11
San Diego, CA 13 14 15 16 17 19 21 22 21 19 16 14
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/427198#M105338</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-12T14:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428465#M105789</link>
      <description>Thank you so much for your help. It works fine now.</description>
      <pubDate>Wed, 17 Jan 2018 16:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428465#M105789</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T16:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428470#M105792</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thank you for your help. I have never used this function prxchange. I learnt about it a bit, but I am not able to understand what you have done here. Could you please explain this ?&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Wed, 17 Jan 2018 16:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428470#M105792</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T16:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428501#M105804</link>
      <description>&lt;P&gt;Regular expressions are good to learn, but a bit complex (at first) to understand.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s for example:&lt;/P&gt;
&lt;PRE&gt;  _infile_=prxchange('s/(\s[a-z][a-z]\s)/$1 /i',1,_infile_);
&lt;/PRE&gt;
&lt;P&gt;reading from left to right, the function uses s/ to indicate that it is a search/replace instance&lt;/P&gt;
&lt;PRE&gt;(\s[a-z][a-z]\s)&lt;/PRE&gt;
&lt;P&gt;is looking for a string that begins with a space, followed by a character between a and z, followed by another&amp;nbsp;&lt;SPAN&gt;character between a and z, followed by a space&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;/$1 &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;says that, when found add one character, namely a space&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;/i'&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;says to ignore case (thus search for either a thru z and/or A thru Z)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Finally, the 1 instructs the function to only do the operation once, and then the _infile_ says to do it on the _infile_ variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Art, CEO, AnalystFinder.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 17:28:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428501#M105804</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-17T17:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428556#M105822</link>
      <description>Thank you sir. It's very helpful.&lt;BR /&gt;&lt;BR /&gt;Really appreciate explaining this.</description>
      <pubDate>Wed, 17 Jan 2018 19:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428556#M105822</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T19:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428559#M105823</link>
      <description>I am facing same difficulty again -&lt;BR /&gt;&lt;BR /&gt;I want to input following data into a dataset. The values have embedded spaces but in this case I am unable to apply a solution similar to what you suggested. Please help.&lt;BR /&gt;&lt;BR /&gt;data multiple;&lt;BR /&gt;input city $30. state $2. zip $7.;&lt;BR /&gt;datalines;&lt;BR /&gt;Flemington NJ 08822&lt;BR /&gt;North City NY 11518&lt;BR /&gt;Atlantic city NJ 08823&lt;BR /&gt;Rancho Santa Margarita CA 78556&lt;BR /&gt;;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 17 Jan 2018 19:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428559#M105823</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T19:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428562#M105825</link>
      <description>&lt;P&gt;Same suggestion, but just change where you're adding the extra space. e.g.:&lt;/P&gt;
&lt;PRE&gt;data multiple (drop=x);
  input @;
  x=anyalpha(_infile_,-50)-2;
  _infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);
  input city &amp;amp; $30. state $2. zip $7.;
datalines;
Flemington NJ 08822
North City NY 11518
Atlantic city NJ 08823
Rancho Santa Margarita CA 78556
;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 19:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428562#M105825</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-17T19:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428618#M105838</link>
      <description>&lt;P&gt;Thank you sir!&lt;BR /&gt;With the help of what you told I was trying the following -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data multiple(drop=x);&lt;BR /&gt;input #1 @1 name $50.&lt;BR /&gt;#2 @1 address $50.;&lt;BR /&gt;input @;&lt;BR /&gt;x=anyalpha(_infile_,-50)-2;&lt;BR /&gt;_infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);&lt;BR /&gt;input #3 @1 city $50.&lt;BR /&gt;state $3.&lt;BR /&gt;zip $7.;&lt;BR /&gt;name=compbl(name);&lt;BR /&gt;address=compbl(address);&lt;BR /&gt;city=compbl(city);&lt;BR /&gt;datalines;&lt;BR /&gt;Ron Cody&lt;BR /&gt;89 Lazy Brook Road&lt;BR /&gt;Flemington NJ 08822&lt;BR /&gt;Tim Brown&lt;BR /&gt;35 Peak Dr&lt;BR /&gt;New York City NY 19454&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The city, state, zip variables are not coming up correctly.&lt;/P&gt;&lt;P&gt;Could you guide me.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 21:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428618#M105838</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T21:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428624#M105840</link>
      <description>&lt;P&gt;Here is one way:&lt;/P&gt;
&lt;PRE&gt;data multiple(drop=x rawin);
  infile cards truncover;
  informat name address city rawin $50.;
  informat state $2.;
  informat zip $5.;
  input name &amp;amp; /
      address &amp;amp; /
      rawin &amp;amp; @;
  x=anyalpha(_infile_,-50)-2;
  _infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);
  input @1 city &amp;amp; state zip;
  datalines;
Ron Cody
89 Lazy Brook Road
Flemington NJ 08822
Tim Brown
35 Peak Dr
New York City NY 19454
;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 21:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428624#M105840</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-17T21:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428626#M105842</link>
      <description>Sorry, I forgot to mention that there were additional spaces in between values as below -&lt;BR /&gt;&lt;BR /&gt;data multiple(drop=x);&lt;BR /&gt;input #1 @1 name $50.&lt;BR /&gt;#2 @1 address $50.;&lt;BR /&gt;input @;&lt;BR /&gt;x=anyalpha(_infile_,-50)-2;&lt;BR /&gt;_infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);&lt;BR /&gt;input #3 @1 city $50.&lt;BR /&gt;state $3.&lt;BR /&gt;zip $7.;&lt;BR /&gt;name=compbl(name);&lt;BR /&gt;address=compbl(address);&lt;BR /&gt;city=compbl(city);&lt;BR /&gt;datalines;&lt;BR /&gt;Ron Cody&lt;BR /&gt;89 Lazy Brook Road&lt;BR /&gt;Flemington NJ 08822&lt;BR /&gt;Tim Brown&lt;BR /&gt;35 Peak Dr&lt;BR /&gt;New York City NY 19454&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;How to deal with these extra blanks in city value?</description>
      <pubDate>Wed, 17 Jan 2018 22:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428626#M105842</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T22:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428635#M105846</link>
      <description>&lt;P&gt;Your extra spaces were and again are lost in your post because you didn't past them in a code box (i.e., the {i} icon).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, here is one way:&lt;/P&gt;
&lt;PRE&gt;data multiple(drop=x);
  infile cards truncover;
  informat name address city $50.;
  informat state $2.;
  informat zip $5.;
  retain name address;
  input @;
  _infile_=compbl(_infile_);
  input name &amp;amp;;
  input @;
  _infile_=compbl(_infile_);
  input address &amp;amp;;
  input @;
  _infile_=compbl(_infile_);
  x=anyalpha(_infile_,-50)-2;
  _infile_=substr(_infile_,1,x)||' '||substr(_infile_,x+1);
  input @1 city &amp;amp; state zip;
  output;
  datalines;
Ron     Cody
89   Lazy   Brook   Road
Flemington     NJ    08822
Tim   Brown
35     Peak Dr
New   York    City   NY    19454
;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 22:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428635#M105846</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-17T22:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Input data with embedded delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428637#M105847</link>
      <description>Thank you so much sir!</description>
      <pubDate>Wed, 17 Jan 2018 22:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-data-with-embedded-delimiter/m-p/428637#M105847</guid>
      <dc:creator>PoojaP1</dc:creator>
      <dc:date>2018-01-17T22:24:36Z</dc:date>
    </item>
  </channel>
</rss>

