MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 pgm needed

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Tue Jan 03, 2006 7:10 am    Post subject: DB2 pgm needed Reply with quote

Hi All,

I have a requirement where in i have to replacing an existing Proc with a pgm / icetool if possible whichever is best suited in terms of performance.Actually every employee takes in exam in some / all subjects and gets the marks which are summed up as total to get the report.The .... indicates that like values. My assumption is that the report can be produced first by

Code:

//STEP1.UNLOADING THE DATA TO A FILE
//STEP2.EXECUTE A PGM WHICH WILL READ THE FILE AND PRODUCE THE REPORT.


Can anybody help me out as how should be my approach to get the desired report ?

The query which is being used to generate the existing report looks like this

Code:

SELECT DEPT,SUBDEPT,MONTH,EMPLOYEENO,MONTH,MARKS,SUM(MARKS) FROM EMPLOYEE
WHERE DEPT = 'ABC' AND SUBDEPT IN ('A1','A2','B1','B2')                   
GROUP BY DEPT, SUBDEPT, MONTH, EMPLOYEENO, MARKS
ORDER BY DEPT, SUBDEPT, MONTH, EMPLOYEENO, MARKS


PROC:

Code:

 NUM COLUMN HEADING                           USAGE   INDENT WIDTH EDIT  SEQ   
 --- ---------------------------------------- ------- ------ ----- ----- ---   
   1 DEPT                                    BREAK1  2      3     C     1     
   2 SUBDEPT                                 BREAK1  2      2     C     2     
   3 MONTH                                   BREAK1  2      3     C     3     
   4 EMPLOYEENO                              GROUP   2      4     C     4     
   5 MARKS                                   ACROSS  2      5     L     5     
   6 COL1                                    SUM     2      10    L2    6     
     *** END *** 



Morever i am not clear with what is the meaning of the terms BREAK1,ACROOS ,GROUP in the USAGE column and what is the significance of the terms L,L2 in the EDIT column ? Can anybody help me out where do i get the information on these following terms.

Code:

REPORT LOOKS LIKE THIS:
DEPT SUBDEPT  MONTH EMPLOYEENO SUB1 SUB2 SUB3 SUB4 SUB5        SUM     
---  -------  ----- ---------- ---  ---- ---- --- ---- .....   -----   
ABC  A1       JAN   1001       -10  -20  40   60   80           150     
                    1002       -10  -20  40   60   50           120     
                    1003        20   -5      -10  -10                   
     A2       JAN   2001       .... ... ...   ..  ..            200     
                    2002                                        300     
                    ....                                               
              FEB   3001                                               
                    3002 
                    ....                                               
     B1       JAN   ....                                               
                    XXXX                                               
                    XXXX                                               
                    XXXX                                               
                    ....                                               
              FEB   XXXX                                               
                    XXXX                                               
                                                                       
     B2       JAN   XXXX                                               
                    XXXX                                               
                    XXXX                                               
              FEB   XXXX                                               
                    XXXX                                               
                    XXXX                                               
                    XXXX                                               
              MAR   XXXX                                               
                    XXXX

Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Jan 03, 2006 7:54 am    Post subject: Reply with quote

mfuser,

Please use meaningful topic title. This is your second topic with the same title. An approriate title would be "Summary Report in DB2" or "Convert QMF proc to a DB2 pgm or Sort utility"

The report you have shown does NOT match the Query you have shown. ex: sub1 thru sub5 columns

Quote:

Morever i am not clear with what is the meaning of the terms BREAK1,ACROOS ,GROUP in the USAGE column and what is the significance of the terms L,L2 in the EDIT column ? Can anybody help me out where do i get the information on these following terms.


Check this link which explains in detail about all the features of a FORM USAGE Codes.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSQRF071/3.15?SHELF=&DT=20000828131906&CASE=

Quote:

My assumption is that the report can be produced first by
//STEP1.UNLOADING THE DATA TO A FILE
//STEP2.EXECUTE A PGM WHICH WILL READ THE FILE AND PRODUCE THE REPORT.

Can anybody help me out as how should be my approach to get the desired report ?


You are on the right track. Unload and use that file with cobol pgm or Sort utility to get the desired results.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Tue Jan 03, 2006 8:33 am    Post subject: Summary Report in DB2 Reply with quote

Kolusu,

If i were to achieve the results using SORT utility ,how can i achive the results as we are having ACROSS as one of the option for the marks for different subjects.Can you please guide me how do i achive the results using SORT utility as my knowledge on using SORT is very limited.

Can you guide me about how the pgm flow should be done to get the results as in the dataset created by the DB2 data does not contain grouped data ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group