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 SAS access

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


Joined: 04 Nov 2003
Posts: 22
Topics: 15

PostPosted: Tue Nov 04, 2003 1:44 am    Post subject: DB2 SAS access Reply with quote

My requirement is to access DB2 columns from the SAS programs. Here SAS 8.1 E is used. I can connect to DB2 but it is showing 'No rows found' although number of records are present in the table.
The JCL I have used is as below:
Code:

//JOB CARD
//STEP050 EXEC SAS8
//WORK     DD UNIT=DISK,SPACE=(CYL,(2000,100),RLSE)
//SASLOG   DD SYSOUT=*
//SASLIST  DD SYSOUT=*
//INCLIB   DD DSN=UD.SI.SAS.INCLIB,DISP=SHR
//INCLIB1  DD DSN=UD.SI.SDLABEL.SASCODE,DISP=SHR
//SASDSN   DD DSN=UD.SI.SASLIB.MAINFRAM.EXTRACTS,DISP=SHR
//SYSIN    DD *
  PROC SQL;
  CONNECT TO DB2 (SSID = T2D1);
       SELECT * FROM CONNECTION TO DB2
       (SELECT * FROM D21TDEADS.STDC_WTCONEAN);
  DISCONNECT FROM DB2;
 QUIT;

The output is :
NOTE: The initialization phase used 0.06 CPU seconds and 7559K.
Code:

1            PROC SQL;
1        !
2            CONNECT TO DB2 (SSID = D2T1);
2        !
3                 SELECT * FROM CONNECTION TO DB2
4                 (SELECT * FROM D2T1ADMU.WSPC_STANDARD);
NOTE: No rows were selected.
4        !
5            DISCONNECT FROM DB2;
5        !
6            QUIT;

NOTE: The PROCEDURE SQL used 0.02 CPU seconds and 8189K.
6 !
NOTE: The SAS session used 0.08 CPU seconds and 8189K.
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: Wed Nov 05, 2003 3:56 am    Post subject: Reply with quote

nivedita,

try this

Code:


PROC SQL;
  CONNECT TO DB2 (SSID = T2D1);
  CREATE TABLE WORK.SASDSN AS
    SELECT * FROM CONNECTION TO DB2
      (SELECT * FROM D21TDEADS.STDC_WTCONEAN);
  DISCONNECT FROM DB2;
QUIT;



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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