Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have the FD, now what? (IBM COBOL LE)

Status
Not open for further replies.

ShawnStanford

Programmer
Jan 2, 2001
14
US
Okay, it occurred to me that I might be able to create a semi-automatic file error message if I could ferret information out of the DCB. So, I wrote a little routine to test my ability to address what I thought was the DCB:
Code:
       IDENTIFICATION DIVISION.
       PROGRAM-ID. TESTPASS.
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT FILE-1 ASSIGN SYSIN.
       DATA DIVISION.
       FILE SECTION.
       FD  FILE-1.
       01  REC-1 PIC X(80).
       PROCEDURE DIVISION.
           OPEN INPUT FILE-1
           CALL 'TESTSUB' USING FILE-1
           GOBACK.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TESTSUB.
       DATA DIVISION.
       LINKAGE SECTION.
       01 THING-1 PIC  X(16777215).
       PROCEDURE DIVISION USING THING-1.
           DISPLAY 'FD:' THING-1 (1:72)
           EXIT PROGRAM.
       END PROGRAM TESTSUB.
       END PROGRAM TESTPASS.

After whipping this up, I set up a little job to run it with a one-word SYSIN, and here's the result (cast into hex by SDSF):
Code:
 ------------------------------------------------------------------------------
FD: {T                   ?0 &    > FR   R        bq U U   0 R b   &      %
CC70CE70000000000000000006F05400060CD278D3002400A891E6E0D5F0D2800050000006A44444
64AE030000000000000000014F0000000E069A609EC0C800C2824640E2009C28900000000C000000
 ------------------------------------------------------------------------------

So, I seem to have successfully passed the address of the DCB to my subprogram, but what do I do with it now? I've prowled Google with no success.

Anyone have some insight?
 
NetSerfer -

One can get to lots of stuff with COBOL by following the control blocks using POINTERs and ADDRESS OF. See for example:
It does help to have system control blocks documentation to figure out offsets, linkages, etc.

Regards,

Glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top