Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 28 Sep 2004 @ 13:12:03 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Embedded Teradata calls in REXX
 
From:   Geoffrey Rommel

  Just wondering if anyone can point me in the right direction of an example Teradata call embedded within REXX (i.e. RXSQL).  


A fascinating question. Unfortunately, I have no time to research it, but here are some ideas.

First, as John Street suggested, you could just call BTEQ and then capture the output from it. That would go something like this:

     "ALLOC FI(SYSPRINT) DA(mybteq.temp) NEW CATALOG SP(10 10) TR RELEASE",
        "UNIT(SYSDA) RECFM(F B A) LRECL(133) BLKSIZE(0) REUSE"
     "ALLOC FI(SYSTERM)  DA(*) REUSE"
     "ALLOC FI(SYSIN)    DA("bteq_script") SHR REUSE"

     "CALL 'MYTDP.APPLOAD(BTQMAIN)' "; bteq_rc = rc
     "FREE FI(SYSPRINT SYSTERM SYSIN)"

     "ALLOC FI(SYSPRINT) DA(mybteq.temp) SHR REUSE"
     "EXECIO * DISKR SYSPRINT (STEM BTEQOUT. FINIS"
     do I = 1 to BTEQOUT.0
        say "output:" BTEQOUT.I             /* PARSE THE BTEQ OUTPUT HERE */
     end

Clumsy, perhaps, but it gets the job done.

What you really want, I take it, is an interface that will read directly from Teradata through the TDP and put the results into REXX variables, much as the REXX/DB2 interface does. I don't know of any commercial product that does this. I believe there would be two possible approaches:

     REXX -> C (or maybe Cobol or PL/I?) routine with embedded SQL -> ppcmain
     REXX -> Assembler routine with CLIv2

Of course you would need to be familiar with the REXX programming interface (described, for instance, in the z/OS TSO/E REXX Reference, SA22-7790-01, Chap. 12). Not for the faint of heart!



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2014 - All Rights Reserved    
Last Modified: 24 Feb 2014