<?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: Mismatched data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450210#M113358</link>
    <description>&lt;P&gt;Art, thanks for your reply. I've attached the html file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code for the first program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data MMMdata. uberdrivermessagepagetest;&amp;nbsp;&lt;BR /&gt;filename fileref url '&lt;A href="https://forum.mrmoneymustache.com/antimustachian-wall-of-shame-and-comedy/uber-driver/" target="_blank"&gt;https://forum.mrmoneymustache.com/antimustachian-wall-of-shame-and-comedy/uber-driver/&lt;/A&gt;';&lt;BR /&gt;infile fileref length=len;&lt;BR /&gt;input record $varying10000. len;&amp;nbsp;&lt;BR /&gt;file "c:\MMM\uberdrivermessagepagetest.txt" mod lrecl=10000;&lt;BR /&gt;put record;&lt;/P&gt;&lt;P&gt;*avatarflag=0;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #') ne 0 then do;&lt;BR /&gt;startreplynum=find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #')+45;&lt;BR /&gt;endreplynum=find(record,' on:');&lt;BR /&gt;lengthreplynum=endreplynum-startreplynum;&lt;BR /&gt;replynum=substr(record,startreplynum,lengthreplynum);&lt;BR /&gt;replynumcheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="avatar"&amp;gt;') then avatarflag = 1;&lt;/P&gt;&lt;P&gt;if find(record,'title="View the profile of ') ne 0 then do;&lt;BR /&gt;startposter=find(record,'"&amp;gt;')+2;&lt;BR /&gt;endposter=find(record,'&amp;lt;/a&amp;gt;');&lt;BR /&gt;lengthposter=endposter-startposter;&lt;BR /&gt;poster=substr(record,startposter,lengthposter);&lt;BR /&gt;postercheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postgroup"&amp;gt;') ne 0 then do;&lt;BR /&gt;startstache=find(record,'li class="postgroup"&amp;gt;')+21;&lt;BR /&gt;endstache=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthstache=endstache-startstache;&lt;BR /&gt;stache=substr(record,startstache,lengthstache);&lt;BR /&gt;stachecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Location: ') ne 0 then do;&lt;BR /&gt;startlocation=find(record,'Location: ')+10;&lt;BR /&gt;endlocation=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthlocation=endlocation-startlocation;&lt;BR /&gt;location=substr(record,startlocation,lengthlocation);&lt;BR /&gt;locationcheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Posts: ') ne 0 then do;&lt;BR /&gt;startnumposts=find(record,'Posts: ')+7;&lt;BR /&gt;endnumposts=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthnumposts=endnumposts-startnumposts;&lt;BR /&gt;numposts=substr(record,startnumposts,lengthnumposts);&lt;BR /&gt;numpostscheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;') ne 0 then do;&lt;BR /&gt;startpostdatetime=find(record,'on:&amp;lt;/strong&amp;gt; ')+13;&lt;BR /&gt;endpostdatetime=find(record,' &amp;amp;#');&lt;BR /&gt;lengthpostdatetime=endpostdatetime-startpostdatetime;&lt;BR /&gt;postdatetime=substr(record,startpostdatetime,lengthpostdatetime);&lt;BR /&gt;postdatetimecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="signature" ') ne 0 then do;&lt;BR /&gt;startsignature=find(record,'&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;')+12;&lt;BR /&gt;endsignature=find(record,'&amp;lt;/div&amp;gt;');&lt;BR /&gt;lengthsignature=endsignature-startsignature;&lt;BR /&gt;signature=substr(record,startsignature,lengthsignature);&lt;BR /&gt;signaturecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Age: ') ne 0 then do;&lt;BR /&gt;startage=find(record,'Age: ')+5;&lt;BR /&gt;endage=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthage=endage-startage;&lt;BR /&gt;age=substr(record,startage,lengthage);&lt;BR /&gt;agecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record, '&amp;lt;div class="postarea"&amp;gt;') then endcheck=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the code for the retain program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data MMMdata. uberdriverclean;&amp;nbsp;&lt;BR /&gt;set MMMdata. uberdrivermessagepagetest;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format replynumtemp best12. avatarflagtemp best12.;&amp;nbsp;&lt;BR /&gt;retain replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&amp;nbsp;&lt;BR /&gt;final=0;&lt;/P&gt;&lt;P&gt;format replynumtemp best12. avatarflagtemp best12.;&lt;BR /&gt;retain replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&amp;nbsp;&lt;BR /&gt;final=0;&lt;BR /&gt;if replynum ne "" then replynumtemp=replynum;&amp;nbsp;&lt;BR /&gt;if avatarflag ne "" then avatarflagtemp=avatarflag;&lt;BR /&gt;if poster ne "" then postertemp=poster;&lt;BR /&gt;if stache ne "" then stachetemp=stache;&lt;BR /&gt;if location ne "" then locationtemp=location;&lt;BR /&gt;if numposts ne "" then numpoststemp=numposts;&lt;BR /&gt;if postdatetime ne "" then postdatetimetemp=postdatetime;&lt;BR /&gt;if signature ne "" then signaturetemp=signature;&lt;BR /&gt;if age ne "" then agetemp=age;&lt;/P&gt;&lt;P&gt;if endcheck ne "" then do;&lt;BR /&gt;endchecktemp=endchek;&lt;/P&gt;&lt;P&gt;final=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if final=0 then delete;&lt;BR /&gt;keep replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Sun, 01 Apr 2018 03:42:00 GMT</pubDate>
    <dc:creator>CASLU</dc:creator>
    <dc:date>2018-04-01T03:42:00Z</dc:date>
    <item>
      <title>Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450194#M113355</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a SAS beginner and am experiencing an issue that I'm not sure how to resolve. Part of the problem is my lack of technical vocabulary to even explain what I think it happening. Hopefully you can help me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract data from an internet forum, but several of my columns are mismatched to the proper user, where it seems that it's attaching the html for the previous case to the next one.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For example, the html is structured like this:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;User1name&lt;/DIV&gt;&lt;DIV&gt;User1Reply#&lt;/DIV&gt;&lt;DIV&gt;User1postdate&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;User2name&lt;/DIV&gt;&lt;DIV&gt;User2Reply#&lt;/DIV&gt;&lt;DIV&gt;User2postdate&lt;/DIV&gt;&lt;DIV&gt;etc...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But when it gathers the data into a spreadsheet it shows user2 having user1's info, and all the following ones are behind. For example:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;User2name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;User1Reply#&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User1postdate&lt;/DIV&gt;&lt;DIV&gt;User3name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;User2Reply#&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User2postdate&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is the result of using 2 different programs; the first one is a series of find commands, while the second is a retain command to get all data into one spreadsheet; however, I'm not sure which program needs to be adjusted or how to fix it.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Hopefully this makes sense. Thanks in advance for your help!&lt;/DIV&gt;</description>
      <pubDate>Sat, 31 Mar 2018 20:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450194#M113355</guid>
      <dc:creator>CASLU</dc:creator>
      <dc:date>2018-03-31T20:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450196#M113356</link>
      <description>&lt;P&gt;You'd have to post both your code and the html file. More than likely you're simply outputting each record upon capturing the data for the next record.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 21:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450196#M113356</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-31T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450210#M113358</link>
      <description>&lt;P&gt;Art, thanks for your reply. I've attached the html file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code for the first program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data MMMdata. uberdrivermessagepagetest;&amp;nbsp;&lt;BR /&gt;filename fileref url '&lt;A href="https://forum.mrmoneymustache.com/antimustachian-wall-of-shame-and-comedy/uber-driver/" target="_blank"&gt;https://forum.mrmoneymustache.com/antimustachian-wall-of-shame-and-comedy/uber-driver/&lt;/A&gt;';&lt;BR /&gt;infile fileref length=len;&lt;BR /&gt;input record $varying10000. len;&amp;nbsp;&lt;BR /&gt;file "c:\MMM\uberdrivermessagepagetest.txt" mod lrecl=10000;&lt;BR /&gt;put record;&lt;/P&gt;&lt;P&gt;*avatarflag=0;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #') ne 0 then do;&lt;BR /&gt;startreplynum=find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #')+45;&lt;BR /&gt;endreplynum=find(record,' on:');&lt;BR /&gt;lengthreplynum=endreplynum-startreplynum;&lt;BR /&gt;replynum=substr(record,startreplynum,lengthreplynum);&lt;BR /&gt;replynumcheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="avatar"&amp;gt;') then avatarflag = 1;&lt;/P&gt;&lt;P&gt;if find(record,'title="View the profile of ') ne 0 then do;&lt;BR /&gt;startposter=find(record,'"&amp;gt;')+2;&lt;BR /&gt;endposter=find(record,'&amp;lt;/a&amp;gt;');&lt;BR /&gt;lengthposter=endposter-startposter;&lt;BR /&gt;poster=substr(record,startposter,lengthposter);&lt;BR /&gt;postercheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postgroup"&amp;gt;') ne 0 then do;&lt;BR /&gt;startstache=find(record,'li class="postgroup"&amp;gt;')+21;&lt;BR /&gt;endstache=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthstache=endstache-startstache;&lt;BR /&gt;stache=substr(record,startstache,lengthstache);&lt;BR /&gt;stachecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Location: ') ne 0 then do;&lt;BR /&gt;startlocation=find(record,'Location: ')+10;&lt;BR /&gt;endlocation=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthlocation=endlocation-startlocation;&lt;BR /&gt;location=substr(record,startlocation,lengthlocation);&lt;BR /&gt;locationcheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Posts: ') ne 0 then do;&lt;BR /&gt;startnumposts=find(record,'Posts: ')+7;&lt;BR /&gt;endnumposts=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthnumposts=endnumposts-startnumposts;&lt;BR /&gt;numposts=substr(record,startnumposts,lengthnumposts);&lt;BR /&gt;numpostscheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;') ne 0 then do;&lt;BR /&gt;startpostdatetime=find(record,'on:&amp;lt;/strong&amp;gt; ')+13;&lt;BR /&gt;endpostdatetime=find(record,' &amp;amp;#');&lt;BR /&gt;lengthpostdatetime=endpostdatetime-startpostdatetime;&lt;BR /&gt;postdatetime=substr(record,startpostdatetime,lengthpostdatetime);&lt;BR /&gt;postdatetimecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;div class="signature" ') ne 0 then do;&lt;BR /&gt;startsignature=find(record,'&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;')+12;&lt;BR /&gt;endsignature=find(record,'&amp;lt;/div&amp;gt;');&lt;BR /&gt;lengthsignature=endsignature-startsignature;&lt;BR /&gt;signature=substr(record,startsignature,lengthsignature);&lt;BR /&gt;signaturecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record,'&amp;lt;li class="postcount"&amp;gt;Age: ') ne 0 then do;&lt;BR /&gt;startage=find(record,'Age: ')+5;&lt;BR /&gt;endage=find(record,'&amp;lt;/li&amp;gt;');&lt;BR /&gt;lengthage=endage-startage;&lt;BR /&gt;age=substr(record,startage,lengthage);&lt;BR /&gt;agecheck=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if find(record, '&amp;lt;div class="postarea"&amp;gt;') then endcheck=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the code for the retain program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data MMMdata. uberdriverclean;&amp;nbsp;&lt;BR /&gt;set MMMdata. uberdrivermessagepagetest;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format replynumtemp best12. avatarflagtemp best12.;&amp;nbsp;&lt;BR /&gt;retain replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&amp;nbsp;&lt;BR /&gt;final=0;&lt;/P&gt;&lt;P&gt;format replynumtemp best12. avatarflagtemp best12.;&lt;BR /&gt;retain replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&amp;nbsp;&lt;BR /&gt;final=0;&lt;BR /&gt;if replynum ne "" then replynumtemp=replynum;&amp;nbsp;&lt;BR /&gt;if avatarflag ne "" then avatarflagtemp=avatarflag;&lt;BR /&gt;if poster ne "" then postertemp=poster;&lt;BR /&gt;if stache ne "" then stachetemp=stache;&lt;BR /&gt;if location ne "" then locationtemp=location;&lt;BR /&gt;if numposts ne "" then numpoststemp=numposts;&lt;BR /&gt;if postdatetime ne "" then postdatetimetemp=postdatetime;&lt;BR /&gt;if signature ne "" then signaturetemp=signature;&lt;BR /&gt;if age ne "" then agetemp=age;&lt;/P&gt;&lt;P&gt;if endcheck ne "" then do;&lt;BR /&gt;endchecktemp=endchek;&lt;/P&gt;&lt;P&gt;final=1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if final=0 then delete;&lt;BR /&gt;keep replynumtemp avatarflagtemp postertemp stachetemp locationtemp numpoststemp postdatetimetemp signaturetemp agetemp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 03:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450210#M113358</guid>
      <dc:creator>CASLU</dc:creator>
      <dc:date>2018-04-01T03:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450212#M113359</link>
      <description>&lt;P&gt;You didn't post the full code for either of the programs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post the missing lines for each program. I can only presume that they're something like:&lt;/P&gt;
&lt;P&gt;data whatever;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; infile whaterver specs;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; input record;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 03:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450212#M113359</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-01T03:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450214#M113361</link>
      <description>&lt;P&gt;I just edited the previous post to include the beginning of each program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 03:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450214#M113361</guid>
      <dc:creator>CASLU</dc:creator>
      <dc:date>2018-04-01T03:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450220#M113364</link>
      <description>&lt;P&gt;Are you sure you posted exactly what you ran. When I ran your first datastep I got a much smaller file and all of the variables in the SAS dataset had missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 04:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450220#M113364</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-01T04:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450237#M113370</link>
      <description>&lt;P&gt;I looked at the text file you originally posted. It contains multiples of the same web page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you may be looking at the wrong field to determine the end of a post. Try the following (of course you'll have to change the library, filenames and revert back to the url as I analyzed the text file you attached:&lt;/P&gt;
&lt;PRE&gt;data MMMdata.uberdrivermessagepagetest; 
/* filename fileref url 'https://forum.mrmoneymustache.com/antimustachian-wall-of-shame-and-comedy/uber-driver/'; */
filename fileref '/folders/myfolders/xuberdrivermessagepagetest.txt';
infile fileref length=len;
input record $varying10000. len; 
file "/folders/myfolders/uberdrivermessagepagetest.txt" mod lrecl=10000;
put record;

retain 
 startreplynum
 endreplynum
 lengthreplynum
 replynum
 replynumcheck

 startposter
 endposter
 lengthposter
 poster
 postercheck
 
 startstache
 endstache
 lengthstache
 stache
 stachecheck

 startlocation
 endlocation
 lengthlocation
 location
 locationcheck

 startnumposts
 endnumposts
 lengthnumposts
 numposts
 numpostscheck

 startpostdatetime
 endpostdatetime
 lengthpostdatetime
 postdatetime
 postdatetimecheck

 startsignature
 endsignature
 lengthsignature
 signature
 signaturecheck

 startage
 endage
 lengthage
 age
 agecheck
 ;
*avatarflag=0;

if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #') ne 0 then do;
startreplynum=find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;Reply #')+45;
endreplynum=find(record,' on:');
lengthreplynum=endreplynum-startreplynum;
replynum=substr(record,startreplynum,lengthreplynum);
replynumcheck=1;
end;

if find(record,'&amp;lt;li class="avatar"&amp;gt;') then avatarflag = 1;

if find(record,'title="View the profile of ') ne 0 then do;
startposter=find(record,'"&amp;gt;')+2;
endposter=find(record,'&amp;lt;/a&amp;gt;');
lengthposter=endposter-startposter;
poster=substr(record,startposter,lengthposter);
postercheck=1;
end;

if find(record,'&amp;lt;li class="postgroup"&amp;gt;') ne 0 then do;
startstache=find(record,'li class="postgroup"&amp;gt;')+21;
endstache=find(record,'&amp;lt;/li&amp;gt;');
lengthstache=endstache-startstache;
stache=substr(record,startstache,lengthstache);
stachecheck=1;
end;

if find(record,'&amp;lt;li class="postcount"&amp;gt;Location: ') ne 0 then do;
startlocation=find(record,'Location: ')+10;
endlocation=find(record,'&amp;lt;/li&amp;gt;');
lengthlocation=endlocation-startlocation;
location=substr(record,startlocation,lengthlocation);
locationcheck=1;
end;

if find(record,'&amp;lt;li class="postcount"&amp;gt;Posts: ') ne 0 then do;
startnumposts=find(record,'Posts: ')+7;
endnumposts=find(record,'&amp;lt;/li&amp;gt;');
lengthnumposts=endnumposts-startnumposts;
numposts=substr(record,startnumposts,lengthnumposts);
numpostscheck=1;
end;

if find(record,'&amp;lt;div class="smalltext"&amp;gt;&amp;amp;#171; &amp;lt;strong&amp;gt;') ne 0 then do;
startpostdatetime=find(record,'on:&amp;lt;/strong&amp;gt; ')+13;
endpostdatetime=find(record,' &amp;amp;#');
lengthpostdatetime=endpostdatetime-startpostdatetime;
postdatetime=substr(record,startpostdatetime,lengthpostdatetime);
postdatetimecheck=1;
/**/
endcheck=1;
output;
call missing(startreplynum);
call missing(endreplynum);
call missing(lengthreplynum);
call missing(replynum);
call missing(replynumcheck);

call missing(startposter);
call missing(endposter);
call missing(lengthposter);
call missing(poster);
call missing(postercheck);

call missing(startstache);
call missing(endstache);
call missing(lengthstache);
call missing(stache);
call missing(stachecheck);

call missing(startlocation);
call missing(endlocation);
call missing(lengthlocation);
call missing(location);
call missing(locationcheck);

call missing(startnumposts);
call missing(endnumposts);
call missing(lengthnumposts);
call missing(numposts);
call missing(numpostscheck);

call missing(startpostdatetime);
call missing(endpostdatetime);
call missing(lengthpostdatetime);
call missing(postdatetime);
call missing(postdatetimecheck);

call missing(startsignature);
call missing(endsignature);
call missing(lengthsignature);
call missing(signature);
call missing(signaturecheck);

call missing(startage);
call missing(endage);
call missing(lengthage);
call missing(age);
call missing(agecheck);

call missing(endcheck);
/**/
end;

if find(record,'&amp;lt;div class="signature" ') ne 0 then do;
startsignature=find(record,'&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;')+12;
endsignature=find(record,'&amp;lt;/div&amp;gt;');
lengthsignature=endsignature-startsignature;
signature=substr(record,startsignature,lengthsignature);
signaturecheck=1;
end;

if find(record,'&amp;lt;li class="postcount"&amp;gt;Age: ') ne 0 then do;
startage=find(record,'Age: ')+5;
endage=find(record,'&amp;lt;/li&amp;gt;');
lengthage=endage-startage;
age=substr(record,startage,lengthage);
agecheck=1;
end;

*if find(record, '&amp;lt;div class="postarea"&amp;gt;') then endcheck=1;

run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 15:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450237#M113370</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-01T15:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Mismatched data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450242#M113371</link>
      <description>&lt;P&gt;That did it! Thank you so much, Art!--I really appreciate your help!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 16:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mismatched-data/m-p/450242#M113371</guid>
      <dc:creator>CASLU</dc:creator>
      <dc:date>2018-04-01T16:06:29Z</dc:date>
    </item>
  </channel>
</rss>

