EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Wed February 18, 2015 04:08 AM

    Hello,

    we are considering migrating our EGL generated COBOL CICS transactions to channels/containers. The problem is that all applications - calling and called must be migrated to channels simultaneously - i.e. re-generated with parmForm="Channel" linkage option. This puts a lot of pressure and risk on the whole process. Is there a recommended way /best practice to make such change in a more controlled way ? According to doc there are four ways (cobol commands) to exchange commarea - EGL uses all of them ? Maybe setting a macro or a rexx script that would change source codes would be more efficient  ...?

    Regards,

    Nenad 

    NenadV


  • 2.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Wed February 18, 2015 08:38 AM

    Nenad,

    You are correct in that you must regenerate both the calling and the called program to use Channels/Containers as the calling and called must be in sync with how the data is passed.

    May I ask why you feel you must move to Channels/Containers?  And what you are hoping to gain by this?

    Are these local CICS transactions (i.e. call between programs all on CICS) or are the called programs being invoked with a remote call?

    I also am not sure what you are asking when you asked "According to doc there are four ways (cobol commands) to exchange commarea - EGL uses all of them ?"  Are you referring to the EGL doc or the CICS Docs? 

    I would not recommend changing the generated COBOL source if this is what you meant by a macro/rexx script.   There is much more to using Channels/Containers than just changing a parm on an EXEC CICS command.

    Mark

     

    markevans


  • 3.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Wed February 18, 2015 08:52 AM

    Hello Mark,

    thank you for the reply. To answer your question about the COBOL doc. - I was referring to this :

    http://www-01.ibm.com/support/knowledgecenter/SSGMGV_3.1.0/com.ibm.cics.ts31.doc/dfhe5/dfhe5yu.htm%23dfhe5yx

    The reason I'm searching an elegant way to migrate to channels are twofold:

    - IBM recommends using channels over commarea - 32k limit etc.

    - currently we are implementing CICS-MQ bridge and it is recommended in the doc that channels should be used due to performance reasons. Since our CICS COBOL programs are very atomic - i.e. there are like 5 different programs involved in a typical transaction , I was thinking that maybe we could migrate to channels completely ..... But as it seems that such migration would involve an extended analysis of each program and a coordinated action in production ....

    Regards

    NenadV


  • 4.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Wed February 18, 2015 12:12 PM

    Nenad,

    A couple of thoughts.

    For local calls within CICS, the 32K limit only exists when you explicitly set the parmform=COMMDATA.  When using COMMPTR (the default), then the only data passed in the commarea are the pointers (4 bytes for each) so the records themselves can be any length.

    Also for local calls, the default is to do a dynamic COBOL Call between the two programs.  This is much faster than doing a CICS LINK. 

    So, switching local calls to Channel/containers are not really necessary to pass more than 32K.  Also, it is a best "performance" practice to use COBOL calls, so do you really want to switch to Channels/containers and be forced to use a CICS LINK.

    For remote calls, there is a 32k limit regardless on whether you use COMMDATA or COMMPTR because the actual data has to be passed over the network.  EGL converts it to Pointers on the host if the called program expects it.  Channels/containers do allow more than 32k on remote calls.

    Finally, EGL only implements channels/containers on calls.  does the CICS/MQ bridge use "called" program or does MQ invoke "main programs"?

    So, if the MQ bridge can use called programs, then maybe those entry points are the only ones that need to be regenned with PARMFORM=CHANNEL.   And then leave the rest of them to use Pointers/dynamic COBOL Calls.

     

    markevans


  • 5.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Thu February 19, 2015 01:41 AM

    Hello Mark,

    thanks! Will discuss your reply with our developers /CICS admins .

    Regards!

    NenadV


  • 6.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Thu February 19, 2015 03:00 AM

    Basically, CICS/MQ works like this - the bridge monitoring task starts CICS DPL task when MQ message arrives. CICS DPL taks can be defined either as CKBC (using channels ) or CKBP (using commarea) transactions - programs DFHMQBP3 and DFHMQBP0 respectively. Then, depending on configuration ,one of those programs execute EXEC CICS LINK calling user application specified in the MQ message payload (first eight bytes i think) ....

    The question is - is it possible to generate a user program that would communicate with DFHMQBP3 program using channels, but still using CALLs (or COMMAREA) for calling other local programs

    Would this work ? (ABCCHN1 is a user program accepting CHANNELS but using default COBOL CALLs for calling other local modules)

                    <LinkageOptions name="LNK01">

                                   <callLink >

                                                   <localCall pgmName="ABCCHN1" linkType="CICSLINK" parmForm="CHANNEL" pgmType="EGL"/></callLink>

                                   <callLink >

                                                   <localCall pgmName="*" linkType="CICSLINK" parmForm="COMMDATA" pgmType="EGL"/></callLink>

                    </LinkageOptions>

     

     

    Regards

     

    NenadV


  • 7.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Thu February 19, 2015 01:03 PM

    Nenad,

    Thanks for the additional info.

    You are partially correct.

    First, you are correct in that you can specify/use different linkage entries based on the program being called.   And they can be different ways of being invoked..

    So, you would use a linkage entry as you described for ABCCHN1 to tell the generator that it should expect to receive parameters through a Channel/Container.

    On the others, I would just let ALL use the defaults which would be a dynamic COBOL call and passing pointers.   My view is to not create entries unless you need to as you then have less to maintain.

    Second.

    There is a still an issue on the channels/containers in relation to the MQ bridge.    When you specify parmform=Channel, we generate code that expects the data to be passed a specific channel name and container name as listed below from the EGL Generation Guide:

    CHANNEL parameter format

    For the CHANNEL parameter format, containers are passed in a channel. A channel is a set of containers that function like parameters for passing data between CICS programs. No COMMAREA is passed in the CHANNEL parameter format.

    When an EGL generated program passes a channel to a called program, the channel has the same name as the called program. However, when an EGL called program receives a channel, the program uses a CICS API call to retrieve the name of the channel that was passed.

    The containers are named EGL-PARM-1 through EGL-PARM-n, where the maximum value of n is 30.

    On reading the CICS/MQ doc, the channel/containers used are container DFHREQUEST in channel DFHMQBR_CHANNEL on entry and container DFHRESPONSE in channel DFHMQBR_CHANNEL.  The linked-to program must use these names.

    So, there is a mismatch in names.   I don't know of a way to override the generated EGL names for Channels/containser, so I see a couple of choices:

    a.) Write a native COBOL routine whose only function is to get/put the container and then call out to the EGL program with the data.

    b.) Do the same in EGL, but use the new "execute #cics" capability in EGL (as of 9.0.1, 9.1, or 9.1.1) to issue the GET/PUT container requests.

    To use the "execute #cics", you could do something like the code sample below (also attached).  If you go with this example, it probably does not matter if you generate with a linkage table or not as the handling of the Container/Channel is hard coded, not generated. 

    And the call to "caldpgm" would be a dynamic cobol call.

    NOTE... I have not tested it, but the generated code looks correct.

    // basic called program//program DEFCHN1 type BasicProgram() {}            dfhrequest dfhrequest;        dfhresponse dfhresponse;        rec5 rec5;        function main()        // get info from the container                 execute #cics{GET CONTAINER("DFHREQUEST") CHANNEL("DFHMQBR_CHANNEL") INTO(:DFHREQUEST)};                                                                // do work and call out to local program                move dfhrequest to rec5 byName;        call "caldpgm" (rec5);        move rec5 to dfhresponse byName;                // put info into the container        execute #cics{PUT CONTAINER("DFHRESPONSE") CHANNEL("DFHMQBR_CHANNEL") FROM(:DFHRESPONSE)};                endendrecord rec5 type BasicRecord  10 fld1 char(100); end record DFHREQUEST type BasicRecord   10 fld1 char(100);  end

     

    Here is the generated code for the "get":

          * EGL *12* Execute #cics{GET CONTAINER ("DFHREQUEST") CH ...
          * EGL *12* ANNEL ("DFHMQBR_CHANNEL") INTO ( :DFHREQUEST  ...
          * EGL *12* )};
               DISPLAY "* 12: Execute #cics{GET CONTAINER ('DFHRE ..."
               EXEC CICS
               GET CONTAINER ("DFHREQUEST") CHANNEL ("DFHMQBR_CHANNEL") INTO
               ( DFHREQUEST-4 )
               END-EXEC

     

    Let me know if there are follow-up questions/comments.

    Mark

    markevans

    Attachments



  • 8.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Fri February 20, 2015 02:37 AM

    Hello Mark ,

    thank you for the comprehensive and very useful reply. 

    What about changing container and channel names in the generated cobol code manually upon generation ? I mean simple ISPF edit replace ....

    If this is feasible , we could set up a rexx/macro/script that would make those changes automatically ....

    Regards,

    Nenad

    NenadV


  • 9.  Re: Migrating COMMAREA to CHANNELS/CONTAINERS ?

    Posted Fri February 20, 2015 09:18 AM

    Nenad,

    It is always "feasible" to change the generated COBOL, but I never recommend it.   I don't understand why that would be preferable to just writing the exec cics# so that you don't have to add a post-generation step to getting a program ready to run.

    Remember you could put the exec cics# in a common function(s) and then just invoke it when necessary.

    Mark

    markevans