<?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: Producing a report for each record in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72155#M20892</link>
    <description>Thanks everyone for the help so far!&lt;BR /&gt;
&lt;BR /&gt;
I am working with electronic laboratory reports for infectious disease surveillance.  I wrote a SAS program that goes through all the lab reports and keeps only the ones we need.  When it is done, I have lists of tests to send to other databases.  It looks something like this when I use PROC PRINT or export it to an Excel file:&lt;BR /&gt;
&lt;BR /&gt;
ID#           LName       FName    TestDate         TestResult&lt;BR /&gt;
12356       Doe            John       06/31/2013      Positive&lt;BR /&gt;
98895       Doe            Jane       04/31/2013      Positive&lt;BR /&gt;
&lt;BR /&gt;
Some of the tests must be entered by hand into their final destinations.  The staff member who is responsible for this does not like the format above.  I tried this:&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=updates;&lt;BR /&gt;
by id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods pdf file='L:\elr\updates_20100329.pdf;&lt;BR /&gt;
proc print data=updates noobs;&lt;BR /&gt;
by id;&lt;BR /&gt;
title 'ELR Updates';&lt;BR /&gt;
run;&lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
&lt;BR /&gt;
This would work if I could figure out a way to control where each field went, like this:&lt;BR /&gt;
&lt;BR /&gt;
LName    FName&lt;BR /&gt;
Doe        John&lt;BR /&gt;
&lt;BR /&gt;
TestDate        TestResult&lt;BR /&gt;
06/31/2013     Positive&lt;BR /&gt;
&lt;BR /&gt;
I'll play around with it more and welcome any further suggestions.  Thanks again!</description>
    <pubDate>Mon, 29 Mar 2010 21:54:29 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-03-29T21:54:29Z</dc:date>
    <item>
      <title>Producing a report for each record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72152#M20889</link>
      <description>I posted this question in the DATA step forum, but I think it might belong here.&lt;BR /&gt;
&lt;BR /&gt;
I produce a weekly SAS data set for which I would like to print one record per page for the staff member who will be using it. I'd like it to look something like this:&lt;BR /&gt;
&lt;BR /&gt;
Page 1:&lt;BR /&gt;
ID #: &lt;BR /&gt;
XXXXXX&lt;BR /&gt;
Name: &lt;BR /&gt;
XXXXX, XXX&lt;BR /&gt;
City: &lt;BR /&gt;
XXXXXXXX&lt;BR /&gt;
&lt;BR /&gt;
Page 2:&lt;BR /&gt;
ID #: &lt;BR /&gt;
YYYYYYY&lt;BR /&gt;
Name: &lt;BR /&gt;
YYYYY, YYY&lt;BR /&gt;
City: &lt;BR /&gt;
YYYYY&lt;BR /&gt;
&lt;BR /&gt;
I know I can use the Reports function in Microsoft Access or Mail Merge in MS Word, but is there a way to get SAS to do this? I tried using PROC PRINT with a BY statement. However, the staff member specifically asked for it not to be a line listing, and I haven't been able to get PROC PRINT to give me anything else.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 29 Mar 2010 19:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72152#M20889</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-29T19:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Producing a report for each record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72153#M20890</link>
      <description>DATA step or likely PROC REPORT can do this for you - doubt you can get PROC PRINT to go vertical with variables, easily.&lt;BR /&gt;
&lt;BR /&gt;
Explain more about what type of output destination you are generating - suggest sharing whatever code you have related to the rqmt.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 29 Mar 2010 20:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72153#M20890</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-29T20:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Producing a report for each record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72154#M20891</link>
      <description>Hi &lt;BR /&gt;
&lt;BR /&gt;
If I understand your requirement correctly. Please use below logic. I took an example as per your posting.&lt;BR /&gt;
&lt;BR /&gt;
Note: Last put statement may not be efficient logic but you can use this logic as per your requirements.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data ddprint;&lt;BR /&gt;
infile datalines;&lt;BR /&gt;
input id Name $ City $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
111 Name1 City1&lt;BR /&gt;
222 Name2 City2&lt;BR /&gt;
333 Name3 City3&lt;BR /&gt;
444 Name4 City4&lt;BR /&gt;
555 Name5 City5&lt;BR /&gt;
666 Name6 City6&lt;BR /&gt;
;&lt;BR /&gt;
Filename pr "&lt;FILE path=""&gt;";&lt;BR /&gt;
options pagesize=1;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set ddprint;&lt;BR /&gt;
by id;&lt;BR /&gt;
file pr N=1;&lt;BR /&gt;
put id =;&lt;BR /&gt;
put Name=;&lt;BR /&gt;
put City= ;&lt;BR /&gt;
put //////////////;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
let me know if you need any other inputs.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Deendayal Cheni&lt;BR /&gt;
Oracle Corporation (Formerly: Sun Microsystems Inc.)&lt;/FILE&gt;</description>
      <pubDate>Mon, 29 Mar 2010 21:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72154#M20891</guid>
      <dc:creator>Deendayal</dc:creator>
      <dc:date>2010-03-29T21:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Producing a report for each record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72155#M20892</link>
      <description>Thanks everyone for the help so far!&lt;BR /&gt;
&lt;BR /&gt;
I am working with electronic laboratory reports for infectious disease surveillance.  I wrote a SAS program that goes through all the lab reports and keeps only the ones we need.  When it is done, I have lists of tests to send to other databases.  It looks something like this when I use PROC PRINT or export it to an Excel file:&lt;BR /&gt;
&lt;BR /&gt;
ID#           LName       FName    TestDate         TestResult&lt;BR /&gt;
12356       Doe            John       06/31/2013      Positive&lt;BR /&gt;
98895       Doe            Jane       04/31/2013      Positive&lt;BR /&gt;
&lt;BR /&gt;
Some of the tests must be entered by hand into their final destinations.  The staff member who is responsible for this does not like the format above.  I tried this:&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=updates;&lt;BR /&gt;
by id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods pdf file='L:\elr\updates_20100329.pdf;&lt;BR /&gt;
proc print data=updates noobs;&lt;BR /&gt;
by id;&lt;BR /&gt;
title 'ELR Updates';&lt;BR /&gt;
run;&lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
&lt;BR /&gt;
This would work if I could figure out a way to control where each field went, like this:&lt;BR /&gt;
&lt;BR /&gt;
LName    FName&lt;BR /&gt;
Doe        John&lt;BR /&gt;
&lt;BR /&gt;
TestDate        TestResult&lt;BR /&gt;
06/31/2013     Positive&lt;BR /&gt;
&lt;BR /&gt;
I'll play around with it more and welcome any further suggestions.  Thanks again!</description>
      <pubDate>Mon, 29 Mar 2010 21:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72155#M20892</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-29T21:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Producing a report for each record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72156#M20893</link>
      <description>I posted an answer to this in your other thread.  You could use ODS to put the output into Excel, which strikes me as much easier to work with than pdf.&lt;BR /&gt;
&lt;BR /&gt;
It would help if you would specify the exact format desired; in your other post you didn't.  You could still use the approach there, using the "header" file statement option and n=ps;&lt;BR /&gt;
&lt;BR /&gt;
It would help if you elaborated "other databases."  Enter by hand?! Anathema.&lt;BR /&gt;
&lt;BR /&gt;
Jonathan&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Thanks everyone for the help so far!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I am working with electronic laboratory reports for&lt;BR /&gt;
&amp;gt; infectious disease surveillance.  I wrote a SAS&lt;BR /&gt;
&amp;gt; program that goes through all the lab reports and&lt;BR /&gt;
&amp;gt; keeps only the ones we need.  When it is done, I have&lt;BR /&gt;
&amp;gt; lists of tests to send to other databases.  It looks&lt;BR /&gt;
&amp;gt; something like this when I use PROC PRINT or export&lt;BR /&gt;
&amp;gt; it to an Excel file:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; ID#           LName       FName    TestDate&lt;BR /&gt;
&amp;gt;         TestResult&lt;BR /&gt;
&amp;gt; Doe            John       06/31/2013&lt;BR /&gt;
&amp;gt;       Positive&lt;BR /&gt;
&amp;gt; Doe            Jane       04/31/2013&lt;BR /&gt;
&amp;gt;       Positive&lt;BR /&gt;
&amp;gt; of the tests must be entered by hand into their&lt;BR /&gt;
&amp;gt; final destinations.  The staff member who is&lt;BR /&gt;
&amp;gt; responsible for this does not like the format above.&lt;BR /&gt;
&amp;gt;   I tried this:&lt;BR /&gt;
&amp;gt; proc sort data=updates;&lt;BR /&gt;
&amp;gt; by id;&lt;BR /&gt;
&amp;gt; run;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; ods pdf file='L:\elr\updates_20100329.pdf;&lt;BR /&gt;
&amp;gt; proc print data=updates noobs;&lt;BR /&gt;
&amp;gt; by id;&lt;BR /&gt;
&amp;gt; title 'ELR Updates';&lt;BR /&gt;
&amp;gt; run;&lt;BR /&gt;
&amp;gt; ods pdf close;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; This would work if I could figure out a way to&lt;BR /&gt;
&amp;gt; control where each field went, like this:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; LName    FName&lt;BR /&gt;
&amp;gt; Doe        John&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; TestDate        TestResult&lt;BR /&gt;
&amp;gt; 06/31/2013     Positive&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I'll play around with it more and welcome any further&lt;BR /&gt;
&amp;gt; suggestions.  Thanks again!</description>
      <pubDate>Tue, 30 Mar 2010 17:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Producing-a-report-for-each-record/m-p/72156#M20893</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-30T17:18:40Z</dc:date>
    </item>
  </channel>
</rss>

