Python

Python

Python

 View Only
  • 1.  Calling z/OS stub from python

    Posted Tue July 04, 2023 07:18 AM

    I want to call a z/OS routine IRRSPX64 from Python.

    If I use

    import ctypes 
    zmqe = ctypes.CDLL("IRRSPX64") 
    print(zzmqe) 

    I get

    Traceback (most recent call last):                                                                            
      File "aa.py", line 10, in <module>                                                                          
        zmqe = ctypes.CDLL("IRRSPX64")                                                                            
      File "/usr/lpp/IBM/cyp/v3r8/pyz/lib/python3.8/ctypes/__init__.py", line 373, in __init__                    
        self._handle = _dlopen(self._name, mode)                                                                  
    OSError: CEE3595S DLL IRRSPX64 does not contain a CELQSTRT CSECT.             

    This is because the stub is not a C routine.

    Is there a way to call this sort ( assembler) stub?                             



    ------------------------------
    Colin Paice
    ------------------------------


  • 2.  RE: Calling z/OS stub from python

    Posted Fri July 07, 2023 02:21 PM

    Hi Colin,

    I think one approach you could take is to create a Python package in C, and call the callable service from the C code. The linkage for this service is OS64_NOSTACK. 

    Thanks,

    Steven Pitman



    ------------------------------
    Steven Pitman
    ------------------------------



  • 3.  RE: Calling z/OS stub from python

    Posted Mon July 10, 2023 03:15 AM
    Hi Steven

    Thanks for the suggestion.   I've written a C package before for other areas(WTO, and WTOR).  This was a curiosity rather than a need, so I'll find an alternative way of doing it.

    Colin