IDMS

Expand all | Collapse all

Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

  • 1.  Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 07:25 AM

    I'm writing an Eclipse plug-in that must do some dictionary manipulations.  I've found that SQL Web Connect is great :

     

    • to use SQL for inquiring the dictionary; I don't want to directly manipulate the dictionary using SQL (or DML).
    • to invoke a mapless dialog (via a SQL procedure; this is really awesome !) - now I want to invoke the online IDD compiler to do the things I want, but at first sight I don't find any examples of how this can be done...

     

    Many thanks for any tips on this matter !

     

    Luc H



  • 2.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Broadcom Employee
    Posted Mar 27, 2015 07:59 AM

    Hi, Luc,

    I don't have an example but in the DDDL Reference Guide, there is an Appendix F "Using the DDDL Compiler as a Subprogram".

    There is a sample cobol program there but the Overview at the beginning refers to "program or dialog".

    Is this what you want?



  • 3.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 08:02 AM

    Thank you Ian, that is indeed what I was looking for.  For some reason or the other I did not find it when I was searching the bookshelf; It looks like I need stronger glasses ;-)

    Thanks again !

    Luc H



  • 4.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 08:18 AM

    Hi Luc,

     

    We do it in ADS via DC-program :

     

    MOVE AGR-PASSED-FOUR TO TABEL-NAAM.                                       

    MOVE DB-NAME TO DBNAME-101.                                               

    LINK PROGRAM 'QDBM077' USING                                              

                            ( QDBM101-INFO ADSO-APPLICATION-GLOBAL-RECORD ). 

     

     

    ******************************** Top of Data **********************************

     

      IDENTIFICATION DIVISION.

     

      PROGRAM-ID. QDBM077 IS INITIAL.

     

      *PROGRAM-ID. QDBM077.

     

      ENVIRONMENT DIVISION.

     

      * CALLED FROM AN ADS DIALOG OR A COBOL-DC PROGRAM

     

      * TO WRITE ON SCRATCH A TABLE FROM IDD.

     

      * INPUT PARAMETERS ARE :

     

      * TABLE NAME

     

      * DBNAME

     

      *

     

      * A SCRATCH IS CREATED WITH TABLE NAME

     

      *

     

      CONFIGURATION SECTION.

     

      SPECIAL-NAMES.

     

      DECIMAL-POINT IS COMMA.

     

      IDMS-CONTROL SECTION.

     

      PROTOCOL.

     

      MODE IS IDMS-DC

     

      IDMS-RECORDS MANUAL .

     

      DATA DIVISION.

     

      WORKING-STORAGE SECTION.

     

      01 COPY IDMS SUBSCHEMA-CTRL.

     

      01 COPY IDMS CIOREC .

     

      01 COPY IDMS CIOF-INPUT .

     

      01 COPY IDMS CIOF-PRINT .

     

      01 COPY IDMS CIOF-PUNCH .

     

      01 REC-INPUT.

     

     

     

      02 TEXT-INPUT PIC X(80) OCCURS 5 VALUE SPACES.

     

      01 REC-PRINT PIC X.

     

      01 REC-PUNCH PIC X.

     

      LINKAGE SECTION .

     

      01 COPY IDMS QDBM101-INFO .

     

      01 COPY IDMS ADSO-APPLICATION-GLOBAL-RECORD.

     

      PROCEDURE DIVISION USING QDBM101-INFO

     

      ADSO-APPLICATION-GLOBAL-RECORD.

     

      * P-START.

     

      IF TABEL-NAAM = SPACE OR TABEL-NAAM = LOW-VALUE OR

     

      TABEL-NAAM = HIGH-VALUE

     

      THEN

     

      MOVE 9999 TO RETURN-CODE-101 OF QDBM101-INFO-GROEP

     

      GO TO P-FIN

     

      .

     

      MOVE 'CIO' TO CIOID.

     

      MOVE 0 TO CIOUSER.

     

      MOVE 'NULL' TO CIONULL.

     

      MOVE 'WORKAREA' TO CIOFTYPE-INPUT.

     

     

     

      MOVE 5 TO CIOFSZMX-INPUT.

     

      MOVE 'SCRATCH' TO CIOFTYPE-PRINT.

     

      MOVE TABEL-NAAM TO CIOFNAME-PRINT.

     

      MOVE 'WORKAREA' TO CIOFTYPE-PUNCH.

     

     

     

      MOVE 'SIGNON USER ******** PASS ******** ' TO TEXT-INPUT(1)

     

      MOVE 'USA RET FOR ALL .' TO TEXT-INPUT(2)

     

      MOVE ' SET OPT SESS FORMAT FIXED.' TO TEXT-INPUT(3).

     

     

     

      STRING 'DISPLAY TABLE ' TABEL-NAAM ' AS SYNTAX WITH DET.'

     

      DELIMITED BY SIZE INTO TEXT-INPUT(4).

     

      MOVE 'SIGNOFF. ' TO TEXT-INPUT(5).

     

     

     

      TRANSFER CONTROL TO 'IDMSDDDC' RETURN USING

     

      CIOREC CIOF-INPUT REC-INPUT

     

      CIOF-PRINT REC-PRINT

     

      CIOF-PUNCH REC-PUNCH .

     

      MOVE CIOIORC TO RETURN-CODE-101 OF QDBM101-INFO-GROEP.

     

      GO TO P-FIN.

     

      P-ABEND.

     

      ABEND CODE 'M077' NODUMP EXITS IGNORED.

     

      P-FIN .

     

    * EXIT PROGRAM.

     

      DC RETURN.

     

    COPY IDMS IDMS-STATUS.

     

    IDMS-ABORT.

     

      EXIT.



  • 5.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 09:23 AM

    Bedankt Marc en groetjes !



  • 6.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 11:52 AM

    It looks like the 'IDD session' must run against the same dictionary as the one that contains the application catalog containing the schema and procedure.  This means that doing a SIGNON DICTNAME some-other-dictname (in the input supplied to IDMSDDDC) doesn't work.



  • 7.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 12:36 PM

    Your signon may need to specify "signon    dictname 'other-dict'    dbname 'other-dict-dbname' "

     

    What was the error message you got from the compiler and/or run-time system? I don't understand your reference to schema/procedure - are you trying to display a schema from IDD and it can't be found?

     

    The interface to the schema compiler (IDMSCHEM maybe) is the same as for the IDD compiler - you can try that - keeping in mind the "signon" also may be an issue.

     

    I seem to recall that there is sometimes a conflict of interest, so to speak, if you have an existing IDD session which you have "suspended", when you also try to run IDD from within an application. I'd suggest either end the existing online session or run the application invoking IDD from a program in another session.

     

    Just some thoughts - HTH - cheers - GaryC



  • 8.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 12:40 PM

    Just a thought, I'm traveling so I can't access my manuals, but look in the callable services manual at IDMSIN01, I think you can use it to set your session dictname before calling DDDC.If I get to check the manual later I'll reply again, but it may be Monday before I get to check. Chuck



  • 9.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 27, 2015 02:41 PM

    Rereading your original post - is this what you are trying to do: use an SQL Procedure, implemented with a maples dialog, it runs from the SQL catalog and you want to use IDMSDDDC (the DDL compiler) from the ADS dialog to access an IDD Dictionary that is available under a different DBNAME than the DBNAME that the SQL catalog is in?

     

    If this is the case - then I see your problem. One solution is to include the "other dictionary" under the same DBNAME that the SQL catalog is contained in! You will still need the "signon dictname other-dict" though.

     

    Alternatively, as suggested before, the "signon     dictname other-dict    dbname other-dict-dbname " should do the trick.

     

    HTH - cheers - GaryCcontained in!



  • 10.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 28, 2015 04:56 AM

    Hi Gary... that is exactly what I'm trying to do.  Given the fact that I have different dictionaries that I want to access using the same procedure (mapless dialog), it is not an option to include the DDLDML areas of all of them. 

     

    The problem is that if you try to signon to another dictionary, you get a program not found error for the mapless dialog (which is somewhat strange because it was started (being in the dictionary containing the catalog where the procedure is defined).

     

    I've seen a few things I can try so there is still hope :-)))

     

    Thanks

    Luc H



  • 11.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 28, 2015 11:30 AM

    Ahhhhhhhh, now we are starting to get somewhere!

     

    What I believe is happening is the program search for the ADS dialog program entry by loader (which is not being found) is for Program:DICTNAME(original) - but the after the IDD Signon is processed your session now has a new DICTNAME (unfortunately the IDD Signon actually changes your session DICTNAME).

     

    ADS run-time is running Program:DICTNAME(original) - when you LINK to the non-ADS environment of IDMSDDDL ADS is temporarily suspended but that is the name it will want to restablish on the RETURN - the SIGNON has the effect of DCUF SET DICTNAME signon-dict - when IDMSDDDL returns - and ADS is re-establishing itself - the ADS dialog (program name) that it wants to re-establish does not match the current search path of Program:DICTNAME(signon-dict) so you get program not found.

     

    What you may need to do is have the maples dialog LINK to a DC-Cobol program which will do the LINK to IDMSDDDC - then  In the Cobol program, after you link to IDMSDDDC, you will want to use IDMSIN01 to set the DICTNAME (and possibly for good measure DBNAME) back to their original state at the time that you entered the dialog. In this way the environment will have been reset so that ADS can re-establish itself and loader can correctly find Program:DICTNAME(original) for ADS run-time. The point is that you are not returning to the maples dialog -- you are returning to the ADS run-time which needs to reload the maples dialog after the non-ADS processing.

     

    If that is in fact the problem - and the solution - then it might be easier and faster just to implement the SQL Procedure in the Cobol program that you will need to write?

     

    That's my guess anyway - HTH - cheers - GaryC



  • 12.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 28, 2015 12:10 PM

    I believe Gary is on the right track, but if the ADS dialog is building the source to pass to DDDC, why not simply build one more line at the end of the source that does another signon to the dictname that is active in the dialog. That information is available via an ADS reserved word. That way, when you leave the IDD environment you're back to where you were before the first signon to IDD in the link. 



  • 13.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 31, 2015 03:10 AM

    Thank You Gary and Chuck...

    Believe it or not but I was thinking that adding another signon at the end of the IDD processing could be an option but I'm not sure whether the initial signon has its full effect within the IDD processing (it appears that it still runs against the dictionary that was active when IDMSDDDC was entered).

    Gary seems to describe what's going on perfectly.  I have some options to try now, for which you both have my gratitude.

    I'll get back once all works as it should :-)

    Luc H



  • 14.  Re: Is it possible to invoke the online IDD compiler (IDMSDDDC) from an ADS dialog and, if so, where can I find an example ?

    Posted Mar 31, 2015 04:34 AM

    OK... I seem to have a good result now.  The 'trick' is to not call RHDCUCFC or IDMSIN01 in the procedure's mapless dialog to set the target dictionary but to do that via an initial SIGNON DICTNAME statement (part of the input for IDMSDDDC).  If you combine that with a final SIGNON DICTNAME for the dictionary in which it all started (as Chuck suggested) then all goes well.  Capturing the output and returning it to the procedure caller is a challenge but in this stage not really important since I only need an indicator telling if processing was successful or not.

    Thanks for your help guys !

    Luc H