Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Summarising a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Summarising a table
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 05, 2007 1:07 pm    Post subject:
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    Post subject: Reply to: Summarising a table
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 05, 2007 2:54 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us