Date: Fri, 27 Mar 2009 13:27:01 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Proc Report again
Not sure where the reason exactly is. It looks like something with memory
problems (?).
However, what you should do independant of that:
the sequence and the types of your columns are strange. Not sure what you
want to do. GROUP makes something like PROC SUMMARY. The obs are cumulated
with the statistics of the right columns, if there are some (eg timebid /
sum). The result are all distinct values of the groups together with the
summary of the statistic variables. ORDER does not calculate any summaries
and does not cumulate for the groups. It simply orders the obs and has
influence on the visible output. E.g only the distinct values of the order
variables are displayed and not repeated for all obs, with the exception
of page-changes.
Using both, ORDER and GROUP is not necessary and not "legal" (? not sure,
but it makes no sense).
To the order of your columns: like you see in the warning, GROUP does not
work as long as you have display-variables in! How should GROUPing be
done, eg
A B stat
1 a 1.2
1 b 1.3
1 c 2.3
1 d 3.2
2 e 1.7
2 f 2.7
2 g 7.2
A is a GROUP variable, B is display and STAT is of type SUM
Now you want to see as result (that's what GROUP is meant for):
1 8.1
2 11.3
but what about B? You see, DISPLAY for B makes no sense!
Maybe you wanted to see something different:
1 a 1.2
b 1.3
c 2.3
d 3.2
2 e 1.7
f 2.7
g 7.2
also possible to insert breaks after the ORDER - change with the
appropriate sums for each group 1, 2, ...
That is ORDER! not GROUP!
That should be changed in your program and I think that should run without
problems.
By the way: do you know that you can fit your report together in
interactive mode? In that mode the statements are generated in background
and you don't need to struggle with them. You can store them in a file and
use that as template for further programming. And you see on the screen
how each klick changes the resulting report. Nice thing, try it out!
Gerhard
On Fri, 27 Mar 2009 10:37:36 -0500, Masoud Pajoh <mpajoh@ODOT.ORG> wrote:
>The following is the log for two proc reports run on the same data set.
>The first one runs fine.
>
>Question: Why does the second one go so wrong?!!
>
>/* The following is added the second time */
>COMPUTE TimeBid;
>putlog 'Here';
>ENDCOMP;
>
>Thanks for all the help.
>
>
> =======================================================================
>13 + proc report data=BCDBidsRep19mar09 list nowd list;
>14 + column CallOrder order VendorName Vendor TimeBid MaxTime;
>15 + define CallOrder / order group style(COLUMN)={just=center};
>16 + define Order / display noprint order;
>17 + define VendorName / order group;
>18 + define MaxTime / display style(COLUMN)={just=center};
>19 + define TimeBid / style(COLUMN)={just=center};
>20 + compute Order;
>21 + if Order=0 then
>22 + call define(_row_,"style","style=[background=yellow]");
>23 + endcomp;
>24 + run;
>
>NOTE: Groups are not created because the usage of VENDOR is DISPLAY.
>NOTE: Multiple concurrent threads will be used to summarize data.
>PROC REPORT DATA=WORK.BCDBIDSREP19MAR09 LS=121 PS=500 SPLIT="/" CENTER ;
>COLUMN ( CALLORDER order VendorName VENDOR TimeBid MaxTime );
>
>DEFINE CALLORDER / GROUP FORMAT= $3. WIDTH=3 SPACING=2 LEFT "Call
>Order" ;
>DEFINE order / ORDER FORMAT= BEST9. WIDTH=9 SPACING=2 NOPRINT RIGHT
>"order" ;
>DEFINE VendorName / GROUP FORMAT= $40. WIDTH=40 SPACING=2 LEFT
>"Bidder" ;
>DEFINE VENDOR / DISPLAY FORMAT= $14. WIDTH=14 SPACING=2 LEFT
>"Bidder" ;
>DEFINE TimeBid / SUM FORMAT= 5. WIDTH=5 SPACING=2 RIGHT "Time Bid"
>;
>DEFINE MaxTime / DISPLAY FORMAT= 5. WIDTH=5 SPACING=2 RIGHT
>"Maximum Time" ;
>
>COMPUTE order;
>if Order = 0 then call define(_row_, "style",
>"style=[background=yellow]");
>ENDCOMP;
>
>RUN;
>
>NOTE: There were 22 observations read from the data set
>WORK.BCDBIDSREP19MAR09.
>NOTE: PROCEDURE REPORT used (Total process time):
> real time 0.65 seconds
> user cpu time 0.01 seconds
> system cpu time 0.06 seconds
> Memory 281k
>
>
>
==========================================================================
===============================
>13 + proc report data=BCDBidsRep19mar09 list nowd list;
>14 + column CallOrder order VendorName Vendor TimeBid MaxTime;
>15 + define CallOrder / order group style(COLUMN)={just=center};
>16 + define Order / display noprint order;
>17 + define VendorName / order group;
>18 + define MaxTime / display style(COLUMN)={just=center};
>19 + define TimeBid / style(COLUMN)={just=center};
>20 + compute TimeBid;
>21 + putlog 'Here';
>22 + endcomp;
>23 + compute Order;
>24 + if Order=0 then
>25 + call define(_row_,"style","style=[background=yellow]");
>26 + endcomp;
>27 + run;
>
>NOTE: Groups are not created because the usage of VENDOR is DISPLAY.
>NOTE: Multiple concurrent threads will be used to summarize data.
>PROC REPORT DATA=WORK.BCDBIDSREP19MAR09 LS=121 PS=500 SPLIT="/" CENTER ;
>COLUMN ( CALLORDER order VendorName VENDOR TimeBid MaxTime );
>
>DEFINE CALLORDER / GROUP FORMAT= $3. WIDTH=3 SPACING=2 LEFT "Call
>Order" ;
>DEFINE order / ORDER FORMAT= BEST9. WIDTH=9 SPACING=2 NOPRINT RIGHT
>"order" ;
>DEFINE VendorName / GROUP FORMAT= $40. WIDTH=40 SPACING=2 LEFT
>"Bidder" ;
>DEFINE VENDOR / DISPLAY FORMAT= $14. WIDTH=14 SPACING=2 LEFT
>"Bidder" ;
>DEFINE TimeBid / SUM FORMAT= 5. WIDTH=5 SPACING=2 RIGHT "Time Bid"
>;
>DEFINE MaxTime / DISPLAY FORMAT= 5. WIDTH=5 SPACING=2 RIGHT
>"Maximum Time" ;
>
>COMPUTE order;
>if Order = 0 then call define(_row_, "style",
>"style=[background=yellow]");
>ENDCOMP;
>
>/* the following is the only difference this time arround */
>COMPUTE TimeBid;
>putlog 'Here';
>ENDCOMP;
>
>RUN;
>
>ERROR: Read Access Violation In Task [ REPORT )
>Exception occurred at (05198A26)
>Task Traceback
>Address Frame (DBGHELP API Version 4.0 rev 5)
>01258375 0711E834 sashost:Main+0xB16E5
>663DEF37 0711E874 sasrepmn:mcn_main+0x3DF37
>663C215C 0711E92C sasrepmn:mcn_main+0x2115C
>663C0E6E 0711EB10 sasrepmn:mcn_main+0x1FE6E
>663BBD73 0711EBBC sasrepmn:mcn_main+0x1AD73
>663A63D8 0711EC24 sasrepmn:mcn_main+0x53D8
>66419ECB 0711ED50 sasrep7:mcn_main+0x8ECB
>6641A2CB 0711EF44 sasrep7:mcn_main+0x92CB
>6714DF14 0711EFAC sasoda:mcn_main+0xCF14
>671419AD 0711F0A4 sasoda:mcn_main+0x9AD
>674DE11C 0711F140 sasods:mcn_main+0x4D11C
>674A27DA 0711F294 sasods:mcn_main+0x117DA
>663A4066 0711FB54 sasrepmn:mcn_main+0x3066
>663910B5 0711FF88 sasrepor:mcn_main+0xB5
>011B2B1A 0711FFA0 sashost:Main+0xBE8A
>011B6C38 0711FFB4 sashost:Main+0xFFA8
>7C80B50B 0711FFEC kernel32:GetModuleFileNameA+0x1B4
>
>NOTE: The SAS System stopped processing this step because of errors.
>NOTE: There were 22 observations read from the data set
>WORK.BCDBIDSREP19MAR09.
>NOTE: PROCEDURE REPORT used (Total process time):
> real time 0.20 seconds
> user cpu time 0.04 seconds
> system cpu time 0.03 seconds
> Memory 6444k