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
 

 

SAS: DB2 equivalent query for PROC SUMMARY.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Wed Nov 11, 2009 7:25 pm    Post subject: SAS: DB2 equivalent query for PROC SUMMARY.
Reply with quote

Hi all,


Is it possible to write a DB2 equivalent query for PROC SUMMARY...?

If so, could you kindly provide me the inputs about this topic...

I have a file which contains around 20 million records. Huge amount of time is consuming every time I sort these 20 million records and summarize them.

Thanks...
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7993
Location: Bellevue, IA

PostPosted: Wed Nov 11, 2009 7:48 pm    Post subject:
Reply with quote

If your site is licensed for SAS/ACCESS, there is a DB2 interface directly between SAS and DB2.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 11, 2009 11:55 pm    Post subject:
Reply with quote

Is it possible to extract the records via the SQL query in the correct order, whilst marking the SAS output table as SORTED BY ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7993
Location: Bellevue, IA

PostPosted: Wed Nov 11, 2009 11:59 pm    Post subject:
Reply with quote

I suspect so, expat, PROC SQL supports the ORDER BY clause and the SAS data set would therefore be sorted. But I don't have any good way to test it since we're not running DB2.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Nov 12, 2009 10:39 am    Post subject: Reply to: SAS: DB2 equivalent query for PROC SUMMARY.
Reply with quote

Yes, My site contains SAS/Access for DB2.

What is that interface and how can I implement it.. Could you please provide me some details..
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7993
Location: Bellevue, IA

PostPosted: Thu Nov 12, 2009 5:46 pm    Post subject:
Reply with quote

Go to http://www.sas.com then click on Support&Training then do some searches for exactly what you need to know. SAS has their complete documentation on their web site, along with Tech Notes, sample code, and a variety of other helpful tidbits.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Dec 07, 2009 6:16 pm    Post subject:
Reply with quote

Here is my finding..

Proc Summary code:
Code:


PROC SORT DATA = WORK.PREMIUM
                   OUT = WORK.PREMIUM1;
             BY  YEAR                                   
                   QUARTER                                   
                   MONTH                                   
                   POLICY_CENTER                                   
                   PARTNER_CODE     ;                       
RUN;

PROC SUMMARY DATA=WORK.PREMIUM1;                             
      OUTPUT  OUT=WORK.PREMIUM2 SUM=; 
             BY  YEAR                                   
                   QUARTER                                   
                   MONTH                                   
                   POLICY_CENTER                                   
                   PARTNER_CODE     ;                       
           VAR  USD_PREMIUMM   
                   USD_CLAIM;
RUN;


DB2 equivalent code:
Code:

PROC SQL;
CREATE TABLE WORK.PREMIUM2 AS
Select          YEAR,                                   
                   QUARTER,                                   
                   MONTH,                                   
                   POLICY_CENTER,                                   
                   PARTNER_CODE,                             
                   Sum(USD_PREMIUMM),   
                   Sum(USD_CLAIM),
from WORK.PREMIUM1
GROUP BY YEAR,                                   
                   QUARTER,                                   
                   MONTH,                                   
                   POLICY_CENTER,                                   
                   PARTNER_CODE,                             
;
QUIT;


I tried this but it(query) was unable to handle large data... :-(

Corrections are welcome...
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN/FREEMAIN query Suja.Sai CICS 9 Tue Jan 31, 2017 12:01 pm


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