COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  COBOL Produce a formatted dump from Working-Storage areas

    Posted Fri July 16, 2021 12:52 PM
    Hi

    I am converting an Assembler program which snaps user areas of storage in a DUMP format using the SNAP macro. The user sends sends the start and end address of the area to be dumped.  Is there a way to do this in COBOL rather than writing the entire code to do this. I have read of low-level call routines such as CEEHDMP and CEEVDMP but these cannot be called from COBOL.

    Thanks

    Ron

    ------------------------------
    Ron Mascarenhas
    ------------------------------


  • 2.  RE: COBOL Produce a formatted dump from Working-Storage areas

    Posted Mon July 19, 2021 12:07 PM
    Ron,

    You want a COBOL program that can dump any area of core, not just the Enclave in which that program is running?




    ------------------------------
    Jon Butler
    ------------------------------



  • 3.  RE: COBOL Produce a formatted dump from Working-Storage areas

    Posted Tue July 20, 2021 09:29 AM
    Hi Jon

    The calling program will send 2 parameters, the start and end address of the area to dump, these are in the Working Storage of the calling program.
    I know CEE3DMP can dump enclaves, but here I need a specific area.
    Also the dump has to be in the normal IBM hex dump format.
    I would think that IBM would have come up with a COBOL function to do this.

    Ron

    ------------------------------
    Ron Mascarenhas
    ------------------------------



  • 4.  RE: COBOL Produce a formatted dump from Working-Storage areas

    Posted Tue July 20, 2021 10:26 AM

    Ron,

     

    I was going to suggest CEE3DMP, but I think you might be able to leverage a "trick" I use to get to the TCB to find the JOB and PROC names.  You need to establish the address using the Linkage Section...no real working pointers in COBOL to use say the way PL/I has.  You will need more than 256 addresses, but it might work.

     Linkage Section. 

    * Control Block Addressability -- Internal Use

    1 MVS1.

    3 ptr1 Pointer Occurs 256.

    Procedure Division using MVS1.

    * Programming Interface -- Prefix Save Area

    set address of mvs1 to null *> PSA

     * Extended PSW Data on SVC Interrupt

    set address of mvs1 to ptr1(136) *> TCB



    ------------------------------
    Jon Butler
    ------------------------------



  • 5.  RE: COBOL Produce a formatted dump from Working-Storage areas

    Posted Tue July 20, 2021 11:42 AM
    Hey Ron,
    I have sample COBOL code to dump an area of memory in the format of the IPCS LIST POSITION STRUCTURE command ie. with offset as well as address, the offset being quite useful to refer back to the compiler produced MAP output.
    Thinking of making it available through a technote after formalizing it a bit more, but I'm out of the office next week so the rest of this week is pretty busy.
    Bernie

    ------------------------------
    Bernie Rataj
    Senior Software Developer
    IBM Canada Ltd.
    Markham ON Canada
    https://www.ibm.com/marketplace/ibm-compilers
    ------------------------------