<?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: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699641#M37634</link>
    <description>&lt;P&gt;This statement -&amp;nbsp;%do i = &amp;amp;firstgrp. %to &amp;amp;lastgrp.; - repeats the logic in your loop starting at the first group, then adding 1 to i for each loop until it reaches last group. That's why it is doing all number between 1 and 10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading the documentation will improve your understanding:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0ri72c3ud2fdtn1qzs2q9vvdiwk.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0ri72c3ud2fdtn1qzs2q9vvdiwk.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2020 00:04:31 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-11-18T00:04:31Z</dc:date>
    <item>
      <title>Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699323#M37597</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a loan history from different SAS datasets using Enterprise Guide. I have one dataset that has the borrower name and address.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elwayfan446_3-1605563848965.png" style="width: 1004px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51739i3B4CDE13E635BBF2/image-dimensions/1004x71?v=v2" width="1004" height="71" role="button" title="elwayfan446_3-1605563848965.png" alt="elwayfan446_3-1605563848965.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have another dataset that has the loan history.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elwayfan446_1-1605563578485.png" style="width: 1042px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51737i44FE3766B67191A8/image-dimensions/1042x99?v=v2" width="1042" height="99" role="button" title="elwayfan446_1-1605563578485.png" alt="elwayfan446_1-1605563578485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I am trying to figure out a way to so somewhat of a merge where the address record has the appearance of an address on a letter and the history records pull in just as they are in this dataset on the bottom section of the page.&amp;nbsp; I want to export an individual PDF file for each ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;John Doe&lt;/P&gt;
&lt;P&gt;123 Somewhere Street&lt;/P&gt;
&lt;P&gt;Apt B&lt;/P&gt;
&lt;P&gt;Somewhere, CA 11111&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then pull in the records from the second dataset here below the address.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help with this would be greatly appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 22:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699323#M37597</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-16T22:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699502#M37623</link>
      <description>&lt;P&gt;Bumping this post hoping someone will see and can help.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 14:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699502#M37623</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-17T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699563#M37628</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do any of you have any suggestions?&amp;nbsp; I am desperate to figure out the best way to do this for a project that I am told needed to be done ASAP.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699563#M37628</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-17T16:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699568#M37629</link>
      <description>&lt;P&gt;Data.&lt;/P&gt;
&lt;P&gt;We can't code from pictures and having to make up too much data really eats into the volunteer time we have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Might give someone enough to work on.&lt;/P&gt;
&lt;P&gt;And actual example of the output document may help as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once upon a time SAS supported Forms and had sort of mail merge functionality with those, which I think comes close to what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be ahead to export the data from SAS and use a mail merge. Maybe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't work in EG so any solution I come up with would be code and when you have TWO data sets synchronizing the two for this sort of bit can be tricky because you need to use two different report generating steps with a common WHERE to use the ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might try transposing the address information and using a data step with a File Print ODS to get that output and any of Proc Print or Report with an appropriate Where would display the history information.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 17:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699568#M37629</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-17T17:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699630#M37631</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; Yes, I have posted code many times.&amp;nbsp; I just thought I would post the end result of what I wanted to pull together to see if there was a quick way to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found this old post and the code mostly works for what I want.&amp;nbsp; My biggest issue is that I am using loan numbers for the min and max variables to loop by.&amp;nbsp; Even though there are only 2 loans (the actual min and max) enterprise guide thinks that it is exporting a PDF for every number between the 2 ID's. It makes the results take forever to generate.&amp;nbsp; The crazy thing is, it only creates the 2 pdf files I want (for the min and the max loan number).&amp;nbsp; If I had 3 loans, I would want a file generated for each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;PRE&gt;options orientation=landscape nodate nonumber;
%macro reporting;
proc sql;
	select min(loan_number)format=best10.,max(loan_number) format=best10. into :firstgrp, :lastgrp 
	from work.address;
quit;

	%do i = &amp;amp;firstgrp. %to &amp;amp;lastgrp.;
	    ods pdf file="/.../history_epo_&amp;amp;i..pdf" style=htmlblue startpage=never;

		proc report data=work.address nowd;
		    where loan_number = &amp;amp;i.;
		    /*by loan_number;*/
          run;

		proc report data=work.paytran nowd;
		    where loan_number = &amp;amp;i.;
		   /*by loan_number;*/
		run;

	   ods pdf close;
	%end;
%mend reporting;
%reporting;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 22:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699630#M37631</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-17T22:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699634#M37632</link>
      <description>&lt;P&gt;If I use the ods results off option it keeps it from taking so long in EG.&amp;nbsp; I still wonder why it is trying to run it for all numbers between (for example) 1 and 10 if there is ONLY a 1 and a 10.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 22:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699634#M37632</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-17T22:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699641#M37634</link>
      <description>&lt;P&gt;This statement -&amp;nbsp;%do i = &amp;amp;firstgrp. %to &amp;amp;lastgrp.; - repeats the logic in your loop starting at the first group, then adding 1 to i for each loop until it reaches last group. That's why it is doing all number between 1 and 10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading the documentation will improve your understanding:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0ri72c3ud2fdtn1qzs2q9vvdiwk.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p0ri72c3ud2fdtn1qzs2q9vvdiwk.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 00:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699641#M37634</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-18T00:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699647#M37638</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;.&amp;nbsp; That makes sense.&amp;nbsp; Now I need to figure out how to make the loop only look at 1 &amp;amp; 10, or 1, 10, and 18 if need be.&amp;nbsp; Basically I have a list of loan numbers... I only want results for the actual numbers.&amp;nbsp; I can convert the loan numbers to character but I haven't figured out how I would be able to do loop through with a character variable.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 00:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699647#M37638</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-18T00:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699870#M37653</link>
      <description>Data _null_ or ODS Report Writer offers capabilities. Personally, Data _null_ would work. There's an old paper from Cynthia Zender, called Creating Complex Reports or if you check lexjansen.com and search "form letters" you'll get the information you need. I would suggest you consider a Word/Excel mail merge though as that would be very trivial to implement (half a day) whereas formatting and layout via code will definitely take time. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.lexjansen.com/nesug/nesug05/cc/ccx4.pdf" target="_blank"&gt;https://www.lexjansen.com/nesug/nesug05/cc/ccx4.pdf&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D09.pdf" target="_blank"&gt;https://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D09.pdf&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.lexjansen.com/wuss/2009/app/APP-OConnor.pdf" target="_blank"&gt;https://www.lexjansen.com/wuss/2009/app/APP-OConnor.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 18 Nov 2020 16:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699870#M37653</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-18T16:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699875#M37655</link>
      <description>&lt;P&gt;I figured out how to do this part by using the retain statement to create a sequence number for ever loan number in my dataset.&amp;nbsp; This insures that the same sequence number is tied to each loan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.address;
	set work.address;
	by loan_number;
retain seq_id 0;
if first.loan_number then seq_id=seq_id + 1;
run;
&lt;/PRE&gt;
&lt;P&gt;Once that is done, then I can select the max and min into the variables and it prints the pdf files correctly (without treating the loan numbers as the min and max and printing all of the loan numbers that would be in between).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the new code that works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options orientation=landscape nodate nonumber;
ods results off;

%macro reporting;
proc sql;
	select min(seq_id)format=best10.,max(seq_id) format=best10. into :firstgrp, :lastgrp 
	from work.address a1;
quit;

	%do i = &amp;amp;firstgrp. %to &amp;amp;lastgrp.;
	     ods pdf file="/sae/aal_labapm/01/mortgage/msracq/DEVELOPMENT/history_epo_&amp;amp;i..pdf" style=htmlblue startpage=never bookmarklist=hide;
		title "^S={font_size=14pt} LOAN HISTORY";
		ods escapechar='^';
		ods pdf text="^{style[just=left preimage='/sae/aal_labapm/01/mortgage/msracq/DEVELOPMENT/logo.jpg']}";

		proc report data=work.address nowd;
		    where seq_id = &amp;amp;i.;
		    by loan_number;&lt;BR /&gt;                run;

		proc report data=work.paytran nowd;
		    where seq_id = &amp;amp;i.;
		    by loan_number;
                run;

	   ods pdf close;
	%end;
%mend reporting;
%reporting;&lt;/PRE&gt;
&lt;P&gt;However, now that the variable &amp;amp;i is the seq_id, that is what is printing as part of the .pdf file name instead of the loan number.&amp;nbsp; Is there a way to print the loan number that is tied to that particular seq_id from the dataset in the .pdf file name?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 16:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699875#M37655</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-18T16:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699884#M37656</link>
      <description>Use a format to map the number to each name and then apply that format using PUTC in the ODS PDF statement.&lt;BR /&gt;&lt;BR /&gt;"/sae/aal_labapm/01/mortgage/msracq/DEVELOPMENT/%sysfunc(putc(history_epo_&amp;amp;i, yourFmt).pdf"</description>
      <pubDate>Wed, 18 Nov 2020 16:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699884#M37656</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-18T16:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699887#M37657</link>
      <description>Ah, cool.  I have not used formats believe it or not.  I will look into it but is it difficult to use one to map to the name?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Nov 2020 16:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699887#M37657</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-18T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699892#M37658</link>
      <description>No, it is not difficult, the code is above once you create the format.</description>
      <pubDate>Wed, 18 Nov 2020 16:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699892#M37658</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-18T16:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699901#M37659</link>
      <description>Sounds good.  I will give it a shot.  Once I have it I will come back and mark this thread answered.  I appreciate everyone.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Nov 2020 17:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/699901#M37659</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-11-18T17:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/702796#M37775</link>
      <description>&lt;P&gt;Good morning &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;.&amp;nbsp; Could you help me with creating a format to do this?&amp;nbsp; I have tried to follow along with the SAS documentation and I just can't figure it out.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 13:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/702796#M37775</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-12-01T13:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/702839#M37782</link>
      <description>Post what you tried and I'll be happy to help from there.</description>
      <pubDate>Tue, 01 Dec 2020 17:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/702839#M37782</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-12-01T17:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704177#M37811</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; for getting back to me.&amp;nbsp; I got tied up last week with end of month work and didn't have a chance to post until now.&amp;nbsp; Here is what I have so far.&amp;nbsp; This includes my entire script.&amp;nbsp; The section I am trying to create a format with is in between comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options orientation=landscape nodate nonumber;
ods results off;

%macro reporting;
proc sql;
	select min(seq_id)format=best10.,max(seq_id) format=best10. into :firstgrp, :lastgrp 
	from work.address a1;
quit;

/****TRYING TO CREATE A FORMAT SO I CAN INSERT LOAN NUMBER INTO PDF FILE NAME****/

data cntlin(keep= fmtname type hlo start label);
	retain fmtname 'loannum' type 'C';
	set work.address end= lastrec;
	start = seq_id; label = pnc_loan_number;
	output;

	if lastrec then do;
	  hlo = '0'; label = 'loan_number';
	  output;
end;
run;

/********************************************************/



	%do i = &amp;amp;firstgrp. %to &amp;amp;lastgrp.;
	     ods pdf file="/sae/aal_labapm/01/mortgage/msracq/DEVELOPMENT/history_epo_&amp;amp;i..pdf" style=htmlblue startpage=never bookmarklist=hide;
		title "^S={font_size=14pt} LOAN HISTORY";
		ods escapechar='^';
		ods pdf text="^{style[just=left preimage='/sae/aal_labxxx/01/mortgage/msracq/DEVELOPMENT/logo.jpg']}";

		proc report data=work.address nowd;
		    where seq_id = &amp;amp;i.;
		    by pnc_loan_number;

          run;

		proc report data=work.paytran nowd;
		    where seq_id = &amp;amp;i.;
		   by loan_number;

		run;

	   ods pdf close;
	%end;
%mend reporting;
%reporting;
&lt;/PRE&gt;
&lt;P&gt;Here are the results (numbers blurred a little for privacy).&amp;nbsp; I just can't put it all together.&amp;nbsp; I may be making this harder than it should be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elwayfan446_0-1607356726866.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52410i12664E07B6A35A52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elwayfan446_0-1607356726866.png" alt="elwayfan446_0-1607356726866.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 16:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704177#M37811</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-12-07T16:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704402#M37818</link>
      <description>&lt;P&gt;Good morning, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;.&amp;nbsp; Wondering if you will have a minute to take a look at this for me today?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 14:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704402#M37818</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-12-08T14:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704454#M37820</link>
      <description>&lt;P&gt;1. Add a PROC FORMAT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data yourCustomFormat (keep= fmtname type hlo start label);
	retain fmtname 'loannum' type 'C';
	set work.address end= lastrec;
	start = seq_id; label = pnc_loan_number;
	output;

	if lastrec then do;
	  hlo = '0'; label = 'loan_number';
	  output;
       end;
run;

proc format cntlin =yourCustomFormat;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Use your format&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf file="/sae/aal_labapm/01/mortgage/msracq/DEVELOPMENT/history_epo_%sysfunc(putn(&amp;amp;i, loannum)).pdf"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS. Test your format, assuming sequence values of 1 and 8 are valid:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(putn(1, loannum));
%put %sysfunc(putn(8, loannum));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704454#M37820</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-12-08T17:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Loan History and Exporting it to PDF from SAS Enterprise Guide 8.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704541#M37823</link>
      <description>&lt;P&gt;I am a little closer but I am running into a new issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, I had to comment out the following code because it was creating a record that was throwing an error due to multiple seq_id's that were the same.&amp;nbsp; No problems there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the updated code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data namefmt(keep= fmtname type /*hlo*/ start label);
	retain fmtname 'loannum' type 'C';
	set work.address end= lastrec;
	start = seq_id; label = pnc_loan_number;
	output;

	/*if lastrec then do;
	  hlo = '0'; label = 'loan_number';
	  output;
	end;*/
run;

proc format cntlin =namefmt;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the output of the format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elwayfan446_0-1607458808708.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52440i7CFC5565BBE1182A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elwayfan446_0-1607458808708.png" alt="elwayfan446_0-1607458808708.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the rest of the code, I am getting a file name that looks like these instead of including the loan number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elwayfan446_1-1607458897436.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52441i652BE34A1D2574D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elwayfan446_1-1607458897436.png" alt="elwayfan446_1-1607458897436.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To test, I tried to run this but it isn't giving me a result in the log, just printing the function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(putn(1, loannum));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*** Edit to add that the loan number (what is showing in the label field of the format results above) is what I am trying to get into the pdf file name.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 20:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-Loan-History-and-Exporting-it-to-PDF-from-SAS/m-p/704541#M37823</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2020-12-08T20:30:10Z</dc:date>
    </item>
  </channel>
</rss>

