<?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: re: Separate PDF Files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202514#M37791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You likely don't want:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; i = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%EVAL&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;(&amp;amp;i + 1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;The start of the loop&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%DO&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%TO&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;(COUNTW(&amp;amp;WHENS));&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;will automatically increment the loop counter when the matching %end is executed. By incrementing it yourself you actually skip the second value in the lists. If you only have two items then it will appear to be missing:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 19:56:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-06-10T19:56:17Z</dc:date>
    <item>
      <title>re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202513#M37790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..I am trying to genarate separate pdf files based on the Client_ID. The code does generate the results for the first Client_ID in the list but does not loop to continue with the remaining Client_ID's on the list. Am I missing something.....Any help or suggestions would greatly appreciated....Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%MACRO&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;STRONG&gt;&lt;EM&gt;DO_CLIENTS&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%DO&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%TO&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(COUNTW(&amp;amp;WHENS));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_CLIENT = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;WHENS, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_NOBS = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;NEXT_NOBS, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_FILENAME = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;FILENAMELIST, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_NAME = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;NAMELIST, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_FROMDATE3 = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;FROMDATE2LIST, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_TODATE3 = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;TODATE2LIST, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; RUNDATE = &amp;amp;RUNDATE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; DATA SALES;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET SUMMARYFINAL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF CLIENT_ID = &amp;amp;NEXT_CLIENT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;ODS _ALL_ CLOSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;ODS LISTING CLOSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;ODS NORESULTS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;OPTIONS ORIENTATION=PORTRAIT CENTER NODATE NONUMBER NOBYLINE &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOPMARGIN=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;".5IN"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOTTOMMARGIN=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;".5IN"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFTMARGIN=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;".5IN"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RIGHTMARGIN=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;".5IN"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; RSTR = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%STR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;( ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; TSTR = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(REPEAT(&amp;amp;RSTR,50));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;ODS ESCAPECHAR=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'^'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;ODS PDF FILE=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"%sysfunc(pathname(project))\&amp;amp;NEXT_FILENAME Report (&amp;amp;rundate).PDF"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; STYLE=JOURNAL NOTOC BOOKMARKGEN=NO BOOKMARKLIST=NONE;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE1 JUSTIFY=CENTER BOLD HEIGHT=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;12&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;PT FONT=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"Arial"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"Client Purchases History"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE2 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE3 JUSTIFY=LEFT HEIGHT=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;9&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;PT FONT=Arial &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"Client Name: &amp;amp;NEXT_NAME"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; JUSTIFY=RIGHT &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"Report Date From: &amp;amp;NEXT_FROMDATE3"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE4 JUSTIFY=LEFT HEIGHT=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;9&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;PT FONT=Arial &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"CLIENT_ID #: &amp;amp;NEXT_CLIENT"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; JUSTIFY=RIGHT &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"Report Date End: &amp;amp;NEXT_TODATE3"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE5 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;TITLE6 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"^{style[bordertopwidth=2px bordertopcolor=black] &amp;amp;tstr}"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;DATA _NULL_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; CLIENT_ID = &amp;amp;NEXT_CLIENT AND &amp;amp;NEXT_NOBS = &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%THEN&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%DO&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE PRINT FLOWOVER N=PAGESIZE;&lt;/SPAN&gt;&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; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%PUT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; "A query for the Purchases History for &amp;amp;NEXT_NAME with CLIENT_ID: &amp;amp;NEXT_CLIENT for the period &amp;amp;next_fromdate3 to &amp;amp;next_todate3 has revealed that no purchases has been made for this client during this time period.";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%END&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;STOP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%IF&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; CLIENT_ID = &amp;amp;NEXT_PATIENT AND &amp;amp;NEXT_NOBS &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%THEN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;PROC REPORT DATA=SALES NOWD HEADLINE HEADSKIP MISSING ps=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;43&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; ls=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;108&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLE(REPORT)={frame=box}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLE(HEADER)={font_weight=bold background=lightgrey font_face=Arial&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; font_size=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;8&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;pt borderwidth=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;px bordercolor=black just=CENTER}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLE(COLUMN)={background=white font_face=Arial font_size=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;7&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;pt borderwidth=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;px &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bordercolor=black just=CENTER}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLE(LINES)={JUST=C FONT_WEIGHT=BOLD FONT_SIZE=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;11&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;PT};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;COLUMN (SALE_DATE CLIENT_SURNAME CLIENT_GIVEN PRODUCT_N PROD_G QTY AMOUNT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE SALE_DATE / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Sale Date'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE PRESCRIBER_SURNAME / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Prescriber Surname'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE PRESCRIBER_GIVEN / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Prescriber First Name'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE PRODUCT_N / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Product Number'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; STYLE(COLUMN)={TAGATTR=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'00000000'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE PROD_G / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Product Name'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE QTY / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Quantity'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFINE AMOUNT / DISPLAY &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;'Total Amount'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; i = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%EVAL&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;i + 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%END&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%MEND&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;%&lt;STRONG&gt;&lt;EM&gt;DO_CLIENTS&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ODS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;PDF&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;CLOSE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ODS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;LISTING&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;ODS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;RESULTS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202513#M37790</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-06-10T17:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202514#M37791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You likely don't want:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; i = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%EVAL&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;(&amp;amp;i + 1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;The start of the loop&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%DO&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%TO&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;(COUNTW(&amp;amp;WHENS));&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;will automatically increment the loop counter when the matching %end is executed. By incrementing it yourself you actually skip the second value in the lists. If you only have two items then it will appear to be missing:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 19:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202514#M37791</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-10T19:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202515#M37792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I deleted that statement and I am getting the following error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red;"&gt;ERROR: Macro function %SCAN has too many arguments.&amp;nbsp; The excess arguments will be ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red;"&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red;"&gt;ERROR: Argument 2 to macro function %SCAN is not a number.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 15:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202515#M37792</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-06-11T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202516#M37793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;Run your code with option MPRINT on to get a better idea where the macro errors are occurring.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;Issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;DATA _NULL_;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%IF&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; CLIENT_ID = &amp;amp;NEXT_CLIENT AND &amp;amp;NEXT_NOBS = &lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%THEN&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%DO&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE PRINT FLOWOVER N=PAGESIZE;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%PUT&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; "A query for the Purchases History for &amp;amp;NEXT_NAME with CLIENT_ID: &amp;amp;NEXT_CLIENT for the period &amp;amp;next_fromdate3 to &amp;amp;next_todate3 has revealed that no purchases has been made for this client during this time period.";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%END&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;STOP;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Since that data step does not have a SET statement there is no value for the variable Client_ID AND you wouldn't want to use a dataset variable in a MACRO %if. So the macro compiler is comparing the literal text CLIENT_ID to the current value of &amp;amp;Next_client. Bet that you never get a true result. I would expect there to be a macro variable Client_id somewhere but you don't define one. the IF CLIENT_ID = &amp;amp;NEXT_CLIENT; in the Data Sales works because it is using a data step IF with a data step variable and comparing to a value from the macro variable.&lt;/P&gt;&lt;P&gt;Since you are looking for a data step to write to FILE PRINT you do not want %PUT, use PUT.&lt;/P&gt;&lt;P&gt;You would be better to use RUN than STOP to end the data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also before the Proc report:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%IF&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; CLIENT_ID = &amp;amp;NEXT_PATIENT AND &amp;amp;NEXT_NOBS &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%THEN&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Same issue of not using a Macro variable. Also likely should be a %then %do;&lt;/P&gt;&lt;P&gt;and add another %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that you may be looking for a structure like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%IF&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;&lt;STRONG&gt; &amp;amp;&lt;/STRONG&gt;CLIENT_ID = &amp;amp;NEXT_CLIENT AND &amp;amp;NEXT_NOBS = &lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%THEN&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%DO;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;&amp;lt;the data _null_ to print&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%else %do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;&amp;lt;the proc report&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%end; /*ends the IF stuff*/&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 16:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202516#M37793</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-11T16:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202517#M37794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ballardw, I was able to isolate where the problem is. It has to with these 2 statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_FROMDATE3 = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;FROMDATE2LIST, &amp;amp;i);&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; NEXT_TODATE3 = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%SCAN&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;TODATE2LIST, &amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;The dates in both of these lists are in worddate format (January 10, 2015, for example). I guess I need to specify how many words are in the string and the delimiters.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 17:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202517#M37794</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-06-11T17:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: re: Separate PDF Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202518#M37795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ballardw.....Thanks for your suggestions and help. I made the changes as you had suggested. It works and loops through as I was hoping it would. I might play around and try and resolve the issue with the worddate but otherwise I can live with it as being in the yymmdd8. format. Thanks once again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 01:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Separate-PDF-Files/m-p/202518#M37795</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-06-12T01:33:36Z</dc:date>
    </item>
  </channel>
</rss>

