IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Summarising a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nithinlenin

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Wed Sep 05, 2007 12:51 pm
Reply with quote

Hi I need help regarding the following

There is a table with some 20 million records .. It is estimated that if the table is summarized with respect to some fields, the number of records will get considerably reduced.
I need to write a JCL to do the same . As far as i have figured out , we require 3 steps

1)Dowloads data from table to flat file
2)Runs a sort job using SUMFILEDS to summarise the file
3)Uploads the job back to a table

Am i moving in the right direction.. Is there any other way out


The table i need to summarise is MSPPOC.MST_INTL_POS_SUM with the following layout

OUTL_ID CHAR ( 7 ) NOT NULL
, SVC_PROD_CLS CHAR ( 1 ) NOT NULL
, ACCT_DT DATE NOT NULL
, LEG_ACCT_DT DATE NOT NULL
, POS_DIV CHAR ( 3 ) NOT NULL
, REVNU_CTRCT_TYPE CHAR ( 2 ) NOT NULL
, REVNU_SRC CHAR ( 3 ) NOT NULL
, CNTRY_NM CHAR ( 15 ) NOT NULL
, HOST_REVNU_DSTRC CHAR ( 3 ) NOT NULL
, ND_FO_ORIG CHAR ( 3 ) NOT NULL
, ND_FO_DEST CHAR ( 3 ) NOT NULL
, ND_LEG_ORIG CHAR ( 3 ) NOT NULL
, ND_LEG_DEST CHAR ( 3 ) NOT NULL
, USE_AL CHAR ( 3 ) NOT NULL
, PLATE_AL CHAR ( 3 ) NOT NULL
, JNT_VNTR_CD CHAR ( 1 ) NOT NULL
, MATCH_STAT CHAR ( 1 ) NOT NULL
, MKT_ENT_ABBR CHAR ( 1 ) NOT NULL
, MKT_SUBENT_ABBR CHAR ( 6 ) NOT NULL
, LEG_ENT_ABBR CHAR ( 1 ) NOT NULL
, LEG_SUBENT_ABBR CHAR ( 6 ) NOT NULL
, USE_RAMT DECIMAL ( 13 , 2 ) NOT NULL
, FE_BASE_CAMT DECIMAL ( 11 , 2 ) NOT NULL
, FE_OVRD_CAMT DECIMAL ( 11 , 2 ) NOT NULL
, BEST_BE_CAMT DECIMAL ( 11 , 2 ) NOT NULL
, BEST_BE_GSA_CAMT DECIMAL ( 11 , 2 ) NOT NULL
, FO_PCNT INTEGER NOT NULL
, LEG_PCNT INTEGER NOT NULL
, FUEL_SCHRG_AMT DECIMAL ( 11 , 2 ) NOT NULL


I need to summarise the table with following fields

SVC_PROD_CLS
,ACCT_DT
,LEG_ACCT_DT
,POS_DIV
,REVNU_CTRCT_TYPE
,REVNU_SRC
,CNTRY_NM
,HOST_REVNU_DSTRC
,ND_FO_ORIG
,ND_FO_DEST
,ND_LEG_ORIG
,ND_LEG_DEST
,USE_AL
,PLATE_AL
,JNT_VNTR_CD
,MATCH_STAT
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 05, 2007 1:07 pm
Reply with quote

Yes, you are moving in the right direction...
You need to come up with the field locations and sizes on the flat file.
You need the fields that are to be added together when the other fields are equal.....
Back to top
View user's profile Send private message
nithinlenin

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Wed Sep 05, 2007 1:43 pm
Reply with quote

Thank you .
Also is there any utility job to download a table into a flat file .. or else how to do abt it..
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 05, 2007 2:54 pm
Reply with quote

Here's a concept, "manual", as in DB2 UDB for z/OS V8 Utility Guide and Reference....

I do think you can select and sum while unloading, eliminating the need for a summerizing sort.....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top