API Enablement

Expand all | Collapse all

Implementation of Channels and containers in PLI using ZOS Connect for request and response

  • 1.  Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Fri May 12, 2023 04:58 PM

    Hi Team,

    Could someone provide us sample for implementing channels and containers using PLI and interfacing it with Z/OS Connect. We were able to fetch request and send response using COMMAREA concept and interfaced with Z/OS connect but we got to know that it has limitation of 32767 bytes so we had to explore the option of using Channels and Containers using PLI program(Z/OS Connect).



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------


  • 2.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Mon May 15, 2023 01:49 AM

    Hi Sharmila,
    I can create a Channels and Containers version of the CICS PL/I COMMAREA z/OS Connect sample I posted in the other thread.  Would that work for you? --Ted



    ------------------------------
    Ted Cipresso
    ------------------------------



  • 3.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Mon May 15, 2023 10:17 PM

    Hi Ted,

    Thanks for replying to the post and could you please provide the sample with channel containers for the program posted in the other thread or any other concept using channels, containers.

    Thanks,
    Sharmila G.



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 4.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue May 16, 2023 06:00 PM

    Hi Sharmila,

    I will create a CICS PL/I sample that demonstrates using both containers and a dynamic (variable-length) response structure.  I'll post again when it's ready. --Ted



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 5.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue May 16, 2023 06:56 PM

    Thanks Ted for taking time to help us and it will be really helpful if we use channel containers as we handle more number of records (nearly more than 1 million for every two hours).



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 6.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Wed May 17, 2023 12:08 AM

    Hi Sharmila.  You're welcome.  Here's an example of a CICS PL/I channel/containers program with a dynamic array in the response.  The program will repeat the same 10 records if you ask it to generate more than 10.  This should help you test various response message sizes.  --Ted



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------

    Attachment(s)

    zip
    CUSTREC2_source.zip   16 KB 1 version
    zip
    CUSTREC2Service_proj.zip   7 KB 1 version


  • 7.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Wed May 17, 2023 06:31 PM

    Hi Ted,

    Thanks for providing the sample and it is really helpful for our future progress. We tried to use REFER in our design but we are not sure how to edit the max value of the array as '*' and we noticed that 

    max items is not present in your response json. We are not sure how to declare the array with '*' as maximum value in response structure so that it can dynamically span based on count sent s
    in request. We are also not sure how to edit the max value as '*' in ZOS Connect. If we give '*' in our response copybook while parsing it is showing error as below , could you please show how to declare the max value of array as '*' in ZOS Connect.
    image



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 8.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Wed May 17, 2023 07:41 PM
    Edited by Ted Cipresso Wed May 17, 2023 07:53 PM
    Hi Sharmila,
     
    In the example I provided, REFER is used to declare a variable-length array where the bounds are set when the structure is allocated. This is the only way to declare a "dynamic" array in PL/I. While (*) would be nice, it's not valid PL/I when declaring an array (prototyping procedure arguments are a use case for (*)).
     
    REFER requires a structure (e.g., RECORDS_RESPONSE) to be based BASED (doesn't occupy storage yet), and the upper bound (_LIM) of each REFER is stored in a separate structure (e.g., RECORDS_RESPONSE_REF). When you ALLOCATE a structure with REFER present, PL/I copies each "referred to" bound from the separate structure (e.g., RECORDS_RESPONSE_REF.RECORDS_DISPLAY_LIM) to the "referring" structure (e.g., RECORDS_RESPONSE.RECORDS_DISPLAY_LIM). PL/I does this so that after the structure (e.g., RECORDS_RESPONSE) is allocated, the "referred to" structure (e.g., RECORDS_REQUEST_REF) is no longer needed and does not have to be passed. This is why in the Service Interface Editor, I only select the referring structure RECORDS_RESPONSE when creating the response service interface. However, the "referred to" structure (e.g., RECORDS_RESPONSE_REF) must be still present in the source in order for it to pass the compiler/importer.
     
    In the request direction, z/OS Connect does the work of allocating the REFER structure, so there's no extra work for that.  In the response direction, you will need to do the allocation as shown in the example.

    Now if you want consumers of your service to have a limit, you can Edit the REFER array in the Service Interface Editor and use the "Counted By" feature to assign an array counter (must be something other than RECORDS_RESPONSE.RECORDS_DISPLAY_LIM,  you can add a field RECORDS_RESPONSE.RECORDS_DISPLAY_CNT right after the _LIM field) and set min/max items.  In this scenario RECORDS_RESPONSE.RECORDS_DISPLAY_LIM would hold the number of array cells allocated while RECORDS_RESPONSE.RECORDS_DISPLAY_CNT would hold the number of array cells used.

    Hope this explanation helps, --Ted



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 9.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Fri May 26, 2023 04:44 PM
      |   view attached

    Hi Ted,

    Could you please help us on the below issue we face. I have tried to execute the sample code given for channels and containers, dynamic array but I am not able to pass data from request to the program. I have put displays in my program and it is the same issue which we were facing in the initial days when we used the tool - EIBCALEN is 0. 

    I tried to create new service with Type as CICS Channel service and tried to import the file you gave - tried to generate the API from the service interface given by you. I tried to provide request number as 5 and it is not passed to the program(EIBCALEN). I have attached the screenshots in attachment. 

    I have tried to add Display count field RECORDS_RESPONSE.RECORDS_DISPLAY_CNT after the RECORDS_RESPONSE.RECORDS_DISPLAY_LIM but I am getting the error as below could you please confirm on how the response structure has to be changed to add this referred structure RECORDS_RESPONSE_REF.RECORDS_DISPLAY_LIM and point it to REFER clause. I have tried to add it in DFHCOMMAREA service but facing the same issue , I have added screenshot below :






    ------------------------------
    Sharmila Gunasekaran
    ------------------------------

    Attachment(s)

    docx
    Channel Logs.docx   54 KB 1 version


  • 10.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Fri May 26, 2023 10:06 PM
    Edited by Ted Cipresso Fri May 26, 2023 10:07 PM

    Hi Sharmila.  In a channels and containers program, EIBCALEN will not hold the length of the request/response structures because the structures are passed in containers instead.  I would double-check your service project to make sure you specified the correct container names in the Service Interface Editor.  The correct names are at the top of the program in variables CONTAINER_NAME_IN and CONTAINER_NAME_OUT.  Regarding the import error, PL/I requires any structure containing REFER to be BASED.  If you look at my containers example, the response structure with REFER is BASED on a pointer.  If you want to put REFER in your request structure, you will need to GET the container and SET the pointer that the structure with REFER is based on (you don't allocate the structure like you would for the response).  For example,

    Example of establishing addressability to a dynamic PL/I structure that is in a request container:

    DCL  REQUEST_STRUCT_PTR POINTER;
    DCL 1 REQUEST_STRUCT_REF,
      2 RECORDS_LIM FIXED BIN(31);
    DCL 1 REQUEST_STRUCT BASED(REQUEST_STRUCT_PTR),
      2 RECORDS_LIM FIXED BIN(31),
      2 RECORDS (REQUEST_STRUCT_REF.RECORDS_LIM REFER(
                REQUEST_STRUCT.RECORDS_LIM)),
          3 FIRST_NAME....

    EXEC CICS GET CONTAINER(CONTAINER_NAME_IN)
               SET(REQUEST_STRUCT_PTR)
               RESP(COMMAND_RESP)
               RESP2(COMMAND_RESP2);

    /* no need to allocate REQUEST_STRUCT because CICS owns the storage for it */



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 11.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Mon May 29, 2023 05:12 PM
      |   view attached

    Hi Ted,

    Thanks for replying to my query. Could you please confirm how to verify if data is sent from request to response. I have added displays to the code for displaying the count,request_struc and resposne_struc but I am not sure if "RECORDS_DISPLAY_CNT": 10 is passed to response so I think the do-while loop will not be executed until this number is passed. I have attached the document with logs, service interface editor values passed in my service which I tried to add ( now I am able to have REFER clause in the response ) but I doubt if data is passed from request through container in the program. Could you please check and confirm where the issue exists in my service.



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------

    Attachment(s)

    docx
    Channel Logs_29_May2023.docx   107 KB 1 version


  • 12.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue May 30, 2023 03:56 PM

    Hi Sharmila,
    Would you mind sending me your service project and CICS program?  There are a couple of things I want to check given what I see in the docx file.  I should be able to help you much faster if I can run the same program and service you're running (pls stub out anything confidential).  --Ted



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 13.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue May 30, 2023 09:24 PM

    Hi Ted,

    The sample given by you is working now and I am able to get the SOAP response as same as you generated, we are trying to use dynamic array in DFHCOMMAREA concept and fetch response values dynamically.

    We will work on it and provide the results on it shortly.

    We are trying use the channel container concept same as your sample and generate our response dynamically , will let you know the results on it shortly.

    Thanks for all your help and time spent in helping us to get the issues quickly resolved, really appreciate your help and guidance given for us to proceed further.



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 14.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 06, 2023 02:37 AM

    Hi Sharmila,

    I received a Sev 1 case from you regarding PL/I REFER in CICS.  Based on your replies, I thought we were making progress with the examples I was providing? You had stated that you will have data that exceeds 32K and therefore need to use channels and containers, therefore I provided a containers example.  Reading above, I got the impression that you were able to run the containers example successfully? 



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 15.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 06, 2023 12:00 PM

    Hi Ted,

    We have used channels and containers concept for the dynamic array using the sample you gave and tried to implement our application logic it worked today.

    We encountered few issues while passing the request data to response in channels, container initially so we tried with DFHCOMMAREA concept using dynamic array and REFER clause ,we encountered the issue with it as well  so we have raised the ticket . 

    I am able to fetch data using Channel and containers concept only today , could you please confirm if we cannot use the DFHCOMMAREA along with refer clause.

    I am able to see array data in CICS application logs (spool with display) for DFHCOMMAREA service but not able to fetch array for it in the SOAP UI. 

    I was not able to share the code in this forum with application logic so I have raised a ticket for the same but I have lowered the severity level.

    I have added the logs for it in the attachment section.



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------

    Attachment(s)

    txt
    logs.txt   11 KB 1 version


  • 16.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 06, 2023 03:35 PM
    Edited by Ted Cipresso Tue June 06, 2023 03:37 PM

    Hi Sharmila,

    Thanks for the update.  I would not recommend using PL/I's REFER or COBOL's UNBOUNDED (which is the equivalent) with DFHCOMMAREA for two reasons:  

    1) A structure containing REFER or UNBOUNDED can be up to 1GB-1 in size.  If you use a commarea, you will need to rewrite your application if the structure will ever exceed 32K.  Using containers will future-proof the program.
    2) Working with the commarea pointer in PL/I when the request and response structures are different sizes, and BASED due to REFER, can be challenging.

    --Ted



    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 17.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 06, 2023 05:35 PM

    Hi Ted,

    Thanks for the confirmation and the quick turnaround on this issue. Thanks as always for helping us to dig more on this API concepts.

    I have closed the incident raised as we got the answer from you on the limitations of REFER clause with DFHCOMMAREA.

    We will be using Channel and containers going forward for our future programs. 



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 18.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Mon June 12, 2023 07:02 PM

    Hi Ted,

    I have one query on the maximum size of data that can be passed with the concept of channels and containers(similar to DFCOMMAREA which can hold 32767 bytes). I saw that in the sample program you gave we had the below declaration :

    DCL MAX_RECORDS        FIXED BIN (31) INIT(16777216);  --> 0.015625 GB

    Could you please suggest maximum records which can be held by the channels, containers since in the above post you mentioned it to be roughly 1GB( 1,000,000,000 or 1 billion bytes).



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------



  • 19.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Mon June 12, 2023 09:26 PM
    Hi Sharmila,
     
    The MAX_RECORDS declaration is an arbitrary limit I set in the example program on the number of customer records (not bytes) the client may request.  
     
    CICS stores channels/containers in 64-bit storage; however, each individual container is limited to 2GB. This is why the FLENGTH parameter in EXEC CICS PUT|GET CONTAINER is a 4-byte integer. The number of containers that can be allocated at any moment in a CICS region is limited only by available storage (e.g., MEMLIMIT).

    Take care, --Ted


    ------------------------------
    Teodoro (Ted) Cipresso
    Senior Software Engineer
    IBM Silicon Valley Lab
    ------------------------------



  • 20.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 13, 2023 02:07 AM

    Sharmila,

    You should also consider that in order to access the data that is in a container from a PL/1 program, it has to be copied down into 31-bit storage from the 64-bit location.  Given that there's only 2G of virtual storage below the bar (in 24-bit and 31-bit storage combined) and a certain amount of that storage is already allocated to CICS product code, your application programs, control blocks, etc.  it will be impossible to access the entire 2G container at once.  You'll have to bring chunks of the data down using 

    GET CONTAINER ... FLENGTH(xx) OFFSET(xx)

    perhaps where the FLENGTH is the length of one record.  With this technique, your CICS application can "walk" through the data record by record.  Likewise, it will be impossible for your PL/1 program to allocate a data structure large enough to hold 2G of data, so if you are creating a container to hold the reply data, you can build it up incrementally using:

    PUT CONTAINER ... FLENGTH(xx) APPEND

    When dealing with a container in its entirety, there's a practical limit of 1/2 G -- and that presumes that you won't have multiple instances of the program/task running at the same time.



    ------------------------------
    Leigh Compton
    Consulting IT Specialist - CICS and Enterprise Integration
    IBM
    TX
    ------------------------------



  • 21.  RE: Implementation of Channels and containers in PLI using ZOS Connect for request and response

    Posted Tue June 13, 2023 06:21 PM

    Hi Ted and Leigh,

    Thanks for giving a great explanation which helps me understand the maximum limitation of channels and container concept.



    ------------------------------
    Sharmila Gunasekaran
    ------------------------------