IDMS

 View Only
  • 1.  idms rexx

    Posted Jun 17, 2011 11:16 AM
    Hi,
    Is it possible to access IDMS-DB via a REXX program?
    Reason : we would like to write a generator in REXX which needs input from an IDMS database
    Hilde


  • 2.  RE: idms rexx

    Posted Jun 17, 2011 11:17 AM
    DML access is quite tricky. It can be done but anchoring the Subschema-Control needs a lot of messy coding.
    If you have the SQL Option then it is really easy to just call IDMSBCF from a REXX.
    If you use the "SET OPTIONS OUTPUT ddname" control statement in your input yu can get the result table in a sequential file of any lrecl which is easily processed by REXX.
    I have many REXXs that have used this techniwue for years very effectively.

    Chris Trayler


  • 3.  RE: idms rexx

    Posted Jun 17, 2011 08:22 PM
    You can write a DML PL/1 program , define as table procedure and use IDMSBCF to select this table procedure. (SQL-option).

    Luc de Naeyer


  • 4.  RE: idms rexx

    Posted Jun 17, 2011 11:23 AM
    We used Cobol from REXX with great success. In fact wrote an entire application this way.

    The problem with coding the IDMS-DB calls is that they need to be coded by hand because there is no REXX pre-compiler. So to understand the API for each type of call (i.e. each format of the FIND/GET/OBTAIN and all the variations on MODIFY, ERASE and so forth) - it would be useful to see the Cobol expansions from the pre-compiler for example - then translate that to REXX constructs.

    Having done that you might as well just use the Cobol from REXX!

    HTH - cheers - Gary


  • 5.  RE: idms rexx

    Posted Jun 17, 2011 11:43 AM
    Hi,

    The DML pre-compiler is supporting only these languages: cobol, assembler or pl/1.

    So, it can be done by a call to a cobol subprogram. In my mind, you have to use batch protocol.

    bye - louis auger


  • 6.  RE: idms rexx

    Posted Jun 17, 2011 11:45 AM
    [color=#0901fc]This works.. Chris[color]

    [font=Courier New]/* REXX */
    newstack

    x = msg('off')

    "free fi(sysctl,syslst,sysipt,answers)"
    "alloc fi(sysctl) ds('your.sysctl.file') shr reuse"
    "delete ***"
    "delete yyy"
    "delete zzz"
    x = msg('on')
    "alloc fi(sysipt) ds(***) new lrecl(80)"
    "alloc fi(syslst) ds(yyy) new"
    "alloc fi(answers) ds(zzz) new lrecl(1024)"

    queue 'SET OPTIONS OUTPUT ANSWERS;'
    queue 'SELECT * FROM SYSDICT."OOAK-012";'
    queue '/*'

    n=queued()
    "execio "n" diskw sysipt (finis"
    "call 'your.load.library(idmsbcf)'"
    bcfrc = rc

    "execio * diskr syslst (finis"
    "free fi(sysctl,syslst,sysipt)"
    x = msg('off')
    "delete ***"
    "delete yyy"
    x = msg('on')
    n = queued()

    if bcfrc > 0 then,
    do
    say 'Error from BCF - output follows...'
    do n
    pull line
    say strip(substr(line,2),'T')
    end
    signal Finish
    end
    else,
    do
    delstack
    "execio * diskr answers (finis"
    n = queued()
    do n
    pull line
    say line
    end
    end

    delstack
    finish:
    return

    [font]