<?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: PROC REPORT: Question on producing the Report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67124#M19184</link>
    <description>Hi.&lt;BR /&gt;
In mine sense, Cynthia has the ability to offer you some example code,&lt;BR /&gt;
but do not know why she not do it.&lt;BR /&gt;
&lt;BR /&gt;
the following is reference example.&lt;BR /&gt;
If your data just looks like that.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp ;&lt;BR /&gt;
 infile datalines dlm=' ' dsd;&lt;BR /&gt;
 input tport $ dzone $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
DROP Tran&lt;BR /&gt;
-ZON spor&lt;BR /&gt;
E ter&lt;BR /&gt;
DZAC 1552&lt;BR /&gt;
 1553&lt;BR /&gt;
 1602&lt;BR /&gt;
 1603&lt;BR /&gt;
 1604&lt;BR /&gt;
DZAG 1554&lt;BR /&gt;
 1555&lt;BR /&gt;
 1556&lt;BR /&gt;
 1605&lt;BR /&gt;
 1606&lt;BR /&gt;
 1607&lt;BR /&gt;
;run; &lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 retain _temp;&lt;BR /&gt;
 if not missing(tport) then _temp=tport;&lt;BR /&gt;
 if missing(tport) then tport=_temp;&lt;BR /&gt;
 drop _temp;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 if tport ne lag(tport) then count+1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data result;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 by count;&lt;BR /&gt;
 length _dzone $ 100;&lt;BR /&gt;
 retain _dzone ;&lt;BR /&gt;
 if first.count then call missing(_dzone);&lt;BR /&gt;
 _dzone=catx(' ',_dzone,dzone);&lt;BR /&gt;
 if last.count then  output;&lt;BR /&gt;
 drop dzone count;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print noobs;run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Tue, 15 Feb 2011 08:28:50 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-02-15T08:28:50Z</dc:date>
    <item>
      <title>PROC REPORT: Question on producing the Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67122#M19182</link>
      <description>My requirement is to generate report Transporter values by Dropzone. I have used below code&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;&lt;B&gt;Code:&lt;/B&gt;&lt;/U&gt;&lt;BR /&gt;
&lt;BR /&gt;
 OPTIONS NOCENTER;                                   &lt;BR /&gt;
 data tpdzone;                                       &lt;BR /&gt;
 infile INFL;                                        &lt;BR /&gt;
 input DZONE $ 112-115                               &lt;BR /&gt;
       TPORT $ 270-273;                              &lt;BR /&gt;
*;                                                   &lt;BR /&gt;
 PROC SORT nodupkey DATA=tpdzone;                    &lt;BR /&gt;
           BY DZONE TPORT;                           &lt;BR /&gt;
 RUN;                                                &lt;BR /&gt;
*;                                                   &lt;BR /&gt;
*proc print data=tpdzone;                            &lt;BR /&gt;
*;                                                   &lt;BR /&gt;
 PROC REPORT DATA=tpdzone;                           &lt;BR /&gt;
      column DZONE TPORT;                            &lt;BR /&gt;
      define TPORT / 'Transporter'  center;          &lt;BR /&gt;
      define DZONE / order 'DROP-ZONE' center;       &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I am getting the output like this:&lt;BR /&gt;
              &lt;BR /&gt;
   DROP  Tran &lt;BR /&gt;
   -ZON  spor &lt;BR /&gt;
    E    ter  &lt;BR /&gt;
   DZAC  1552 &lt;BR /&gt;
              1553 &lt;BR /&gt;
              1602 &lt;BR /&gt;
              1603 &lt;BR /&gt;
              1604 &lt;BR /&gt;
   DZAG  1554 &lt;BR /&gt;
              1555 &lt;BR /&gt;
              1556 &lt;BR /&gt;
              1605 &lt;BR /&gt;
              1606 &lt;BR /&gt;
&lt;BR /&gt;
Now the requirement is changed to produce the output like this:&lt;BR /&gt;
&lt;BR /&gt;
  DROP  Tran   &lt;BR /&gt;
  -ZON  spor   &lt;BR /&gt;
   E    ter    &lt;BR /&gt;
DZAC  1552  1553 1602 1603 1604&lt;BR /&gt;
DZAG  1554  1555 1556 1605 1606 1607&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Please help me how I can get the above result. Also please let me how I can suppress message '1THE SAS SYSTEM' messages.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Kris</description>
      <pubDate>Mon, 31 Jan 2011 13:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67122#M19182</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-31T13:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT: Question on producing the Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67123#M19183</link>
      <description>Hi:&lt;BR /&gt;
  Your second question first. You asked: " Also please let me how I can suppress message 'THE SAS SYSTEM' messages."&lt;BR /&gt;
&lt;BR /&gt;
  This is the standard SAS System Title. If you investigate the use of the TITLE statement, you can blank out the default title using the first example or you can reset the title using the second example.&lt;BR /&gt;
[pre]&lt;BR /&gt;
** 1) Blank out Title;&lt;BR /&gt;
title;&lt;BR /&gt;
        &lt;BR /&gt;
** 2) Reset Title to Other String;&lt;BR /&gt;
title1 'This is My New Title';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                        &lt;BR /&gt;
Your first question is a bit more difficult to answer. Normally, the reporting procedures, such as PROC PRINT, PROC REPORT and PROC TABULATE operate on your variables in pre-determined manner. Your data seems "long and skinny" I suspect it looks like this when you do a simple PROC PRINT:&lt;BR /&gt;
[pre]&lt;BR /&gt;
 DZONE TPORT&lt;BR /&gt;
 DZAC   1552 &lt;BR /&gt;
 DZAC   1553 &lt;BR /&gt;
 DZAC   1602 &lt;BR /&gt;
 DZAC   1603 &lt;BR /&gt;
 DZAC   1604 &lt;BR /&gt;
 DZAG   1554 &lt;BR /&gt;
 DZAG   1555 &lt;BR /&gt;
 DZAG   1556 &lt;BR /&gt;
 DZAG   1605 &lt;BR /&gt;
 DZAG   1606 &lt;BR /&gt;
[/pre]&lt;BR /&gt;
      &lt;BR /&gt;
This shows that you have one variable or column called DZONE and another variable or column called TPORT and you have multiple rows or observations. PROC PRINT will show you every single row (with or without OBServation numbers at the far left).&lt;BR /&gt;
 &lt;BR /&gt;
PROC REPORT, as you discovered, adds a little cosmetic flourish by showing only the first DZONE in an ordered group because you have defined a usage of  ORDER for the DZONE variable. If you were to leave DZONE as an ORDER variable, but define TPORT as an ACROSS variable, then PROC REPORT would want to COUNT the unique values of TPORT (how many 1552, how many 1553), etc, which is not what you want. PROC TABULATE would want to do the same thing.&lt;BR /&gt;
 &lt;BR /&gt;
Also, you haven't really described what your final result is -- is it a report or an output dataset??? If all you want is a report, then you might need to consider a procedure other than PROC REPORT. I assume that something like this is NOT what you want:&lt;BR /&gt;
[pre]&lt;BR /&gt;
                                    Transporter&lt;BR /&gt;
  DROP-ZONE  1552  1553  1554  1555  1556  1602  1603  1604  1605  1606&lt;BR /&gt;
    DZAC        1     1     .     .     .     1     1     1     .     .&lt;BR /&gt;
    DZAG        .     .     1     1     1     .     .     .     1     1&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                 &lt;BR /&gt;
But instead you want something more like this. Note that instead of 1 variable called TPORT, there are multiple numbered variables called TPORT1-TPORT5:&lt;BR /&gt;
[pre]&lt;BR /&gt;
   DZONE     tport1    tport2    tport3    tport4    tport5&lt;BR /&gt;
   DZAC       1552      1553      1602      1603      1604&lt;BR /&gt;
   DZAG       1554      1555      1556      1605      1606&lt;BR /&gt;
[/pre]&lt;BR /&gt;
        &lt;BR /&gt;
The first example above would be created with PROC REPORT; the second example would be created by turning the data from "long and skinny" data into "wide" data by using PROC TRANSPOSE and then using a simple PROC PRINT on the transposed data. &lt;BR /&gt;
  &lt;BR /&gt;
You might want a report that shows just 1 big character variable that was the concatenation of all your unique values for the TPORT variable and this is possible, but it is a more complicated DATA step or SQL program.&lt;BR /&gt;
 &lt;BR /&gt;
Useful information to know would be:&lt;BR /&gt;
1) what operating system you are using &lt;BR /&gt;
2) what your ultimate use of the output file/report file is -- you want to print, you are FTPing the file to another platform, or ???&lt;BR /&gt;
3) what you really want -- a report with TITLES or a dataset without TITLES&lt;BR /&gt;
---3a) if you want a report -- what are you going to do with the report -- print it, put it into Word, put it on a web site, email to people, open with Excel&lt;BR /&gt;
---3b) if you want a dataset -- what is the final disposition of the dataset and what is the final structure of the output dataset&lt;BR /&gt;
 &lt;BR /&gt;
If all you need is a report, then the simplest method would be to use the PROC TRANSPOSE/PROC PRINT method. If you need an output dataset in a different structure than the input dataset, then you will have to look to other techniques.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 31 Jan 2011 16:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67123#M19183</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-31T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT: Question on producing the Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67124#M19184</link>
      <description>Hi.&lt;BR /&gt;
In mine sense, Cynthia has the ability to offer you some example code,&lt;BR /&gt;
but do not know why she not do it.&lt;BR /&gt;
&lt;BR /&gt;
the following is reference example.&lt;BR /&gt;
If your data just looks like that.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp ;&lt;BR /&gt;
 infile datalines dlm=' ' dsd;&lt;BR /&gt;
 input tport $ dzone $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
DROP Tran&lt;BR /&gt;
-ZON spor&lt;BR /&gt;
E ter&lt;BR /&gt;
DZAC 1552&lt;BR /&gt;
 1553&lt;BR /&gt;
 1602&lt;BR /&gt;
 1603&lt;BR /&gt;
 1604&lt;BR /&gt;
DZAG 1554&lt;BR /&gt;
 1555&lt;BR /&gt;
 1556&lt;BR /&gt;
 1605&lt;BR /&gt;
 1606&lt;BR /&gt;
 1607&lt;BR /&gt;
;run; &lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 retain _temp;&lt;BR /&gt;
 if not missing(tport) then _temp=tport;&lt;BR /&gt;
 if missing(tport) then tport=_temp;&lt;BR /&gt;
 drop _temp;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 if tport ne lag(tport) then count+1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data result;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 by count;&lt;BR /&gt;
 length _dzone $ 100;&lt;BR /&gt;
 retain _dzone ;&lt;BR /&gt;
 if first.count then call missing(_dzone);&lt;BR /&gt;
 _dzone=catx(' ',_dzone,dzone);&lt;BR /&gt;
 if last.count then  output;&lt;BR /&gt;
 drop dzone count;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print noobs;run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 15 Feb 2011 08:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-Question-on-producing-the-Report/m-p/67124#M19184</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-15T08:28:50Z</dc:date>
    </item>
  </channel>
</rss>

