Rexx interface to VSAM 
Author Message
 Rexx interface to VSAM

Quote:

> We will be creating an information repository in VSAM which will be used to
> configure applications (much like the Microsoft registry). I need to write an
> API which works like the MS functions.  It will require being able to pass
> back lots of values to the REXX exec (the C++ version passes handles of
> variables in order to get back values).  E.G.

>     GetValue( key, value_name, &type, &value, &length );
> // where type, value and length are in my program, the function
> // populates these variables.

> What would be the best way to pass back this data?  I don't have any TSO
> manuals available, but I remember an assembler program which could be used
> to access the current REXX variables and change their values.
> Would this be the cleanest?

You're going to need those manuals here. The program you are refering to
is the EXECCOM interface. The program name is IRXEXCOM. You will find
this in the REXX manuals under external interfaces.

mickey



Fri, 22 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM

Quote:


> > We will be creating an information repository in VSAM which will be used to
> > configure applications (much like the Microsoft registry). I need to write an
> > API which works like the MS functions.  It will require being able to pass
> > back lots of values to the REXX exec (the C++ version passes handles of
> > variables in order to get back values).  E.G.

> >     GetValue( key, value_name, &type, &value, &length );
> > // where type, value and length are in my program, the function
> > // populates these variables.

> > What would be the best way to pass back this data?  I don't have any TSO
> > manuals available, but I remember an assembler program which could be used
> > to access the current REXX variables and change their values.
> > Would this be the cleanest?

> You're going to need those manuals here. The program you are refering to
> is the EXECCOM interface. The program name is IRXEXCOM. You will find
> this in the REXX manuals under external interfaces.

> mickey

I have a working sample assembler program that demonstrates:

accessing the incoming parameter list
fetching variable values using IRXEXCOM
setting variable values using IRXEXCOM
returning a result

I can post it if anyone is interested. It is 325 lines and requires the
HL assembler, because I got carried away with mixed case and labeled
USINGs.
--

Beyond Software, Inc.      http://www.beyond-software.com
"Transforming Legacy Applications"



Fri, 22 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM

Wayne,

I'd be interested.  Feel free to send it via private e-mail if noone on the list is interested.

There are a number of cool things you can do with rexx, but I just haven't had time to
explore all of them.  (like interfaces to DB2, IMS, CICS....etc)

:)


Quote:


>> > We will be creating an information repository in VSAM which will be used to
>> > configure applications (much like the Microsoft registry). I need to write an
>> > API which works like the MS functions.  It will require being able to pass
>> > back lots of values to the REXX exec (the C++ version passes handles of
>> > variables in order to get back values).  E.G.

>> >     GetValue( key, value_name, &type, &value, &length );
>> > // where type, value and length are in my program, the function
>> > // populates these variables.

>> > What would be the best way to pass back this data?  I don't have any TSO
>> > manuals available, but I remember an assembler program which could be used
>> > to access the current REXX variables and change their values.
>> > Would this be the cleanest?

>> You're going to need those manuals here. The program you are refering to
>> is the EXECCOM interface. The program name is IRXEXCOM. You will find
>> this in the REXX manuals under external interfaces.

>> mickey

>I have a working sample assembler program that demonstrates:

>accessing the incoming parameter list
>fetching variable values using IRXEXCOM
>setting variable values using IRXEXCOM
>returning a result

>I can post it if anyone is interested. It is 325 lines and requires the
>HL assembler, because I got carried away with mixed case and labeled
>USINGs.
>--

>Beyond Software, Inc.      http://www.beyond-software.com
>"Transforming Legacy Applications"

John Schlatweiler
Senior Technical Specialist / Information Management Officer
Mercantile Bank


All views expressed here belong to someone.



Fri, 22 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM

Quote:

(snip)
> I have a working sample assembler program that demonstrates:

> accessing the incoming parameter list
> fetching variable values using IRXEXCOM
> setting variable values using IRXEXCOM
> returning a result

> I can post it if anyone is interested. It is 325 lines and requires the
> HL assembler, because I got carried away with mixed case and labeled
> USINGs.

Please post - HLASM isn't a problem for me.

Bill {*filter*}

Quote:
> --

> Beyond Software, Inc.       http://www.*-*-*.com/
> "Transforming Legacy Applications"



Fri, 22 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM


Quote:
>There are a number of cool things you can do with rexx, but I just haven't
>had time to
>explore all of them.  (like interfaces to DB2, IMS, CICS....etc)

In our class "Advanced TSO REXX Programming", we have labs that give experience
in accessing REXX variables, issuing TSO commands, interfacing with DB2, and
dynamic linkages from REXX execs to compiled programs. The course currently has
lecture / labs for doing this work from Assembler, PL/I and COBOL. I am
currently working to update this to include C and the latest COBOL releases.
It's a pretty good introduction to accessing that stuff from Assembler or even
high level languages.

For more information, look at our website, www.trainersfriend.com.

Cheers,

Steve Comstock
Telephone: 303-393-8716
www.trainersfriend.com

256-B S. Monaco Parkway
Denver, CO 80224
USA



Sat, 23 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM
Quote:

> Wayne,

> I'd be interested.  Feel free to send it via private e-mail if noone on the list is interested.

> There are a number of cool things you can do with rexx, but I just haven't had time to
> explore all of them.  (like interfaces to DB2, IMS, CICS....etc)

> :)

This being the fourth request so far, I'll take the liberty of posting
it to the group.

         TITLE 'WLBPGM01 - Program Initialization'
**********************************************************************  
* This program demonstrates REXX variable access from assembler in   *  
* MVS. Four types of accesses are demonstrated:                      *  
*                                                                    *  
*   1. Processing the input parameter list. Input consists of two    *  
*      parameters, each one is the name of a REXX variable.          *  
*   2. Fetching the current value of the first REXX variable by      *  
*      calling IRXEXCOM.                                             *  
*   3. Setting the value of the second REXX variable by calling      *  
*      IRXEXCOM. The value is the upper case equivalent of the value *  
*      thas was fetched for the first parameter.                     *  
*   4. Returning a result in the EVALBLOCK. The result is an integer *  
*      followed by message text.                                     *  
*                                                                    *  
* Example:                                                           *  
*                                                                    *  
*   /* REXX */                                                       *  
*   trace "O"                                                        *  
*   ivar = "AbCdEf"                                                  *  
*   rc = wlbpgm01("IVAR","OVAR")                                     *  
*   say "rc  =" rc                                                   *  
*   say "ivar=" ivar                                                 *  
*   say "ovar=" ovar                                                 *  
*                                                                    *  
* Results:                                                           *  
*                                                                    *  
*   rc  = 0 Normal End                                               *  
*   ivar= AbCdEf                                                     *  
*   ovar= ABCDEF                                                     *  
*                                                                    *  
* Entry Specifications:                                              *  
*                                                                    *  
* Register Contents                                                  *  
*                                                                    *  
*   0      Address of an environment block (optional)                *  
*   1      Address of the parameter list passed by the caller        *  
*  2-12    Unpredictable                                             *  
*  13      Address of a register save area                           *  
*  14      Return address                                            *  
*  15      Entry point address                                       *  
*                                                                    *  
* For additional information see:                                    *  
*                                                                    *  
*   IBM TSO Extensions for MVS                                       *  
*   REXX/MVS Reference                                               *  
*   Version 2 Release 5                                              *  
*   Document Number SC28-1883-07                                     *  
*                                                                    *  
**********************************************************************  
         PRINT NOGEN                                                    
WLBPGM01 CSECT                                                          
WLBPGM01 AMODE 31                                                      
WLBPGM01 RMODE ANY                                                      
**********************************************************************  
*              Program Initialization                                *  
**********************************************************************  
         SAVE  (14,12),,WLBPGM01_&SYSDATC._&SYSTIME                    
         LR    R9EnvBlk,R0         Addr(EnvBlock)                      
         LR    R10EFPL,R1          Addr(Parms)                          
         LR    R12Base,R15         Entry Point Address                  
         USING ENVBLOCK,R9EnvBlk   Environment Block                    
         USING EFPL,R10EFPL        External Function Parameter List    
         USING WLBPGM01,R12Base    Set  Program Base REgister          
         L     R2,ENVBLOCK_PARMBLOCK Addr(Parameter Block)              
         USING PARMBLOCK,R2          Parameter Block                    
         L     R2,PARMBLOCK_SUBPOOL  Subpool number                    
         DROP  R2                    Parameter Block                    
         LA    R0,WALength         Length of WorkArea                  
         STORAGE OBTAIN,           Allocate WorkArea                   x
               SP=(2),              Subpool                            x
               LENGTH=(0),          Length in R0                       x
               LOC=(ANY,ANY)        Above the line please              
         ST    R13,SAPrev-SaveArea(,R1)  Chain Previous to New          
         ST    R1,SANext-SaveArea(,R13)  Chain New to Previous          
         LR    R13,R1              Addr(Current SaveArea)              
         USING WorkArea,R13        Current SaveArea                    
         ST    R2,WAPool           Save Subpool number                  
         L     R1,ENVBLOCK_IRXEXTE Addr(External Entry Point Table)    
         USING IRXEXTE,R1          Vector of External Entry Points      
         L     R0,IRXEXCOM         Addr(IRXEXCOM routine)              
         ST    R0,WAEXCOM          Addr(IRXEXCOM routine)              
         DROP  R1                  Vector of External Entry Points      
         ST    R9EnvBlk,WAEnvBlk   Addr(EnvBlock)                      
         DROP  R9EnvBlk            Environment Block                    
         L     R1,EFPLEVAL         Addr(EVALBLOCK address)              
         L     R1,0(,R1)           Addr(EVALBLOCK)                      
         ST    R1,WAEvalB          Addr(EVALBLOCK)                      
         L     R7ArgTbl,EFPLARG    Addr(First Argument)                
         USING ARGTABLE_ENTRY,R7ArgTbl       Argument Table            
         DROP  R10EFPL             External Function Parameter List    
         TITLE 'WLBPGM01 - Decode Parameter 1 and Fetch Value'          
**********************************************************************  
*              Decode Parameter 1 and Fetch Value                    *  
**********************************************************************  
         L     R14,ARGTABLE_ARGSTRING_PTR    Addr(first parameter)      
         C     R14,=F'-1'          Parm 1 present?                      
         BE    ERR0001             N, then error No Parm1              
P1       USING SHVBLOCK,WAShvB1    Shared Variable Block                
         XC    WAShvB1,WAShvB1     Clear SHVBLK                        
         MVI   P1.SHVCODE,SHVFETCH Fetch Variable                      
         LA    R1,L'WABuf          Len(WABuf)                          
         ST    R1,P1.SHVBUFL       Len(fetch buffer)                    
         ST    R14,P1.SHVNAMA      Addr(variable name)                  
         L     R14,ARGTABLE_ARGSTRING_LENGTH Len(first parameter)      
         ST    R14,P1.SHVNAML      Len(variable name)                  
         LA    R1,WABuf            Addr(WABuf)                          
         ST    R1,P1.SHVVALA       Addr(variable value)                
         SR    R0,R0               Useful place for a zero              
         LA    R1,EXCOM            Addr('IRXEXCOM')                    
         LA    R14,WAShvB1         Addr(SHVBLK)                        
         ST    R1,Plist0           Parm 0 = Addr('IRXEXCOM')            
         ST    R0,Plist1           Parm 1 = null                        
         ST    R0,Plist2           Parm 2 = null                        
         ST    R14,Plist3          Parm 3 = Addr(SHVBLK)                
         OI    Plist3,X'80'        End of Plist                        
         L     R0,WAEnvBlk         Addr(ENVBLOCK)                      
         LA    R1,Plist            Addr(Parameters)                    
         L     R15,WAEXCOM         Addr(IRXEXCOM routine)              
         BALR  R14,R15             CALL IRXEXCOM                        
         LTR   R15,R15             Test Return Code                    
         BNZ   ERR0003             Fetch failed                        
         TITLE 'WLBPGM01 - Decode Parameter 2 and Set Value'            
**********************************************************************  
*              Decode Parameter 2 and Set Value                      *  
**********************************************************************  
         LA    R7ArgTbl,ARGTABLE_NEXT Addr(Next (second) Argument)      
         L     R14,ARGTABLE_ARGSTRING_PTR                              
         C     R14,=F'-1'          Parm 1 present?                      
         BE    ERR0002             N, then error No Parm2              
P2       USING SHVBLOCK,WAShvB2    Shared Variable Block                
         XC    WAShvB2,WAShvB2     Clear SHVBLK          
...

read more »



Sat, 23 Dec 2000 03:00:00 GMT  
 Rexx interface to VSAM
Wayne,

Thanks for sharing.  This is what I feel this type of newsgroup is about.  I think I have some VSAM Rexx interface stuff somewhere, but I am always looking for new code.

For everyone else interested in Rexx functions, I would like to suggest that you check out the available downloads at Xephon publications (www.xephon.com I think).

I want to throw up a personal thank you and some serious recognition to Anthony Rudd.  (search for Rudd, as some articles site Anthony Rudd and some A S Rudd.)  He has contributed a bunch of Rexx related interfaces, saving you (ok, me) from figuring out how to do stuff.  (I have used the DB2 interfaces with some Rexx to quickly and efficiently clone a DB2 test system to a Y2K Lpar and generate commands to clean everyting up.)  

Anthony has provided all kinds of Rexx related functions that are not only usable, provide insights into Rexx extension progamming.


Quote:

>> Wayne,

>> I'd be interested.  Feel free to send it via private e-mail if noone on the list is interested.

>> There are a number of cool things you can do with rexx, but I just haven't had time to
>> explore all of them.  (like interfaces to DB2, IMS, CICS....etc)

>> :)

>This being the fourth request so far, I'll take the liberty of posting
>it to the group.

>         TITLE 'WLBPGM01 - Program Initialization'
>**********************************************************************  
>* This program demonstrates REXX variable access from assembler in   *  
>* MVS. Four types of accesses are demonstrated:                      *  
>*                                                                    *  
>*   1. Processing the input parameter list. Input consists of two    *  
>*      parameters, each one is the name of a REXX variable.          *  
>*   2. Fetching the current value of the first REXX variable by      *  
>*      calling IRXEXCOM.                                             *  
>*   3. Setting the value of the second REXX variable by calling      *  
>*      IRXEXCOM. The value is the upper case equivalent of the value *  
>*      thas was fetched for the first parameter.                     *  
>*   4. Returning a result in the EVALBLOCK. The result is an integer *  
>*      followed by message text.                                     *  
>*                                                                    *  
>* Example:                                                           *  
>*                                                                    *  
>*   /* REXX */                                                       *  
>*   trace "O"                                                        *  
>*   ivar = "AbCdEf"                                                  *  
>*   rc = wlbpgm01("IVAR","OVAR")                                     *  
>*   say "rc  =" rc                                                   *  
>*   say "ivar=" ivar                                                 *  
>*   say "ovar=" ovar                                                 *  
>*                                                                    *  
>* Results:                                                           *  
>*                                                                    *  
>*   rc  = 0 Normal End                                               *  
>*   ivar= AbCdEf                                                     *  
>*   ovar= ABCDEF                                                     *  
>*                                                                    *  
>* Entry Specifications:                                              *  
>*                                                                    *  
>* Register Contents                                                  *  
>*                                                                    *  
>*   0      Address of an environment block (optional)                *  
>*   1      Address of the parameter list passed by the caller        *  
>*  2-12    Unpredictable                                             *  
>*  13      Address of a register save area                           *  
>*  14      Return address                                            *  
>*  15      Entry point address                                       *  
>*                                                                    *  
>* For additional information see:                                    *  
>*                                                                    *  
>*   IBM TSO Extensions for MVS                                       *  
>*   REXX/MVS Reference                                               *  
>*   Version 2 Release 5                                              *  
>*   Document Number SC28-1883-07                                     *  
>*                                                                    *  
>**********************************************************************  
>         PRINT NOGEN                                                    
>WLBPGM01 CSECT                                                          
>WLBPGM01 AMODE 31                                                      
>WLBPGM01 RMODE ANY                                                      
>**********************************************************************  
>*              Program Initialization                                *  
>**********************************************************************  
>         SAVE  (14,12),,WLBPGM01_&SYSDATC._&SYSTIME                    
>         LR    R9EnvBlk,R0         Addr(EnvBlock)                      
>         LR    R10EFPL,R1          Addr(Parms)                          
>         LR    R12Base,R15         Entry Point Address                  
>         USING ENVBLOCK,R9EnvBlk   Environment Block                    
>         USING EFPL,R10EFPL        External Function Parameter List    
>         USING WLBPGM01,R12Base    Set  Program Base REgister          
>         L     R2,ENVBLOCK_PARMBLOCK Addr(Parameter Block)              
>         USING PARMBLOCK,R2          Parameter Block                    
>         L     R2,PARMBLOCK_SUBPOOL  Subpool number                    
>         DROP  R2                    Parameter Block                    
>         LA    R0,WALength         Length of WorkArea                  
>         STORAGE OBTAIN,           Allocate WorkArea                   x
>               SP=(2),              Subpool                            x
>               LENGTH=(0),          Length in R0                       x
>               LOC=(ANY,ANY)        Above the line please              
>         ST    R13,SAPrev-SaveArea(,R1)  Chain Previous to New          
>         ST    R1,SANext-SaveArea(,R13)  Chain New to Previous          
>         LR    R13,R1              Addr(Current SaveArea)              
>         USING WorkArea,R13        Current SaveArea                    
>         ST    R2,WAPool           Save Subpool number                  
>         L     R1,ENVBLOCK_IRXEXTE Addr(External Entry Point Table)    
>         USING IRXEXTE,R1          Vector of External Entry Points      
>         L     R0,IRXEXCOM         Addr(IRXEXCOM routine)              
>         ST    R0,WAEXCOM          Addr(IRXEXCOM routine)              
>         DROP  R1                  Vector of External Entry Points      
>         ST    R9EnvBlk,WAEnvBlk   Addr(EnvBlock)                      
>         DROP  R9EnvBlk            Environment Block                    
>         L     R1,EFPLEVAL         Addr(EVALBLOCK address)              
>         L     R1,0(,R1)           Addr(EVALBLOCK)                      
>         ST    R1,WAEvalB          Addr(EVALBLOCK)                      
>         L     R7ArgTbl,EFPLARG    Addr(First Argument)                
>         USING ARGTABLE_ENTRY,R7ArgTbl       Argument Table            
>         DROP  R10EFPL             External Function Parameter List    
>         TITLE 'WLBPGM01 - Decode Parameter 1 and Fetch Value'          
>**********************************************************************  
>*              Decode Parameter 1 and Fetch Value                    *  
>**********************************************************************  
>         L     R14,ARGTABLE_ARGSTRING_PTR    Addr(first parameter)      
>         C     R14,=F'-1'          Parm 1 present?                      
>         BE    ERR0001             N, then error No Parm1              
>P1       USING SHVBLOCK,WAShvB1    Shared Variable Block                
>         XC    WAShvB1,WAShvB1     Clear SHVBLK                        
>         MVI   P1.SHVCODE,SHVFETCH Fetch Variable                      
>         LA    R1,L'WABuf          Len(WABuf)                          
>         ST    R1,P1.SHVBUFL       Len(fetch buffer)                    
>         ST    R14,P1.SHVNAMA      Addr(variable name)                  
>         L     R14,ARGTABLE_ARGSTRING_LENGTH Len(first parameter)      
>         ST    R14,P1.SHVNAML      Len(variable name)                  
>         LA    R1,WABuf            Addr(WABuf)                          
>         ST    R1,P1.SHVVALA       Addr(variable value)                
>         SR    R0,R0               Useful place for a zero              
>         LA    R1,EXCOM            Addr('IRXEXCOM')                    
>         LA    R14,WAShvB1         Addr(SHVBLK)                        
>         ST    R1,Plist0           Parm 0 = Addr('IRXEXCOM')            
>         ST    R0,Plist1           Parm 1 = null                        
>         ST    R0,Plist2           Parm 2 = null                        
>         ST    R14,Plist3          Parm 3 = Addr(SHVBLK)                
>         OI    Plist3,X'80'        End of Plist                        
>         L    

...

read more »



Mon, 25 Dec 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. REXX and VSAM

2. VSAM files and Rexx

3. IBM mainframe REXX accessing VSAM files

4. VSAM and Rexx?

5. REXX & VSAM

6. REXX for CICS/ESA and DB2 REXX interface

7. REXX and MVS VSAM

8. MVS/TSO REXX accessing VSAM KSDS Files (?)

9. REXX function package for VSAM

10. rexx and vsam

11. TSO REXX - VSAM Help?

12. Rexx Interface Updates

 

 
Powered by phpBB® Forum Software