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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DDS Subfile Problem in COBOL

Status
Not open for further replies.

NVSbe

Programmer
Sep 9, 2002
153
BE
I have a subfile defined (TAB001), with a control record (TAB001C)

In the control record, Indicator 21 is used to clear the subfile. Wanting to start of cleanly, I begin my program with:

OPEN I-O dTAB013
MOVE EEN TO IN20 IN TAB001C-O
MOVE NUL TO IN21 IN TAB001C-O
MOVE NUL TO IN40 IN TAB001C-O
WRITE DTAB013-REC FROM TAB001C-O FORMAT IS "TAB001C"
MOVE NUL TO IN20 IN TAB001C-O
MOVE EEN TO IN21 IN TAB001C-O

(The other indicaters are to allow scroll and display. NUL and EEN are constants, turning the indicators on and off)

The write command however gives an I/O error with file status 9N. I've been busting my head over this why a simple write command won't work. I'm clueless... Help would be appreciated.


Thank you,
Niki.
 
Niki,
A file status of 9N leads me to believe that you might not have your display field of the file status correctly set up, as there isn't a status of 9N (as far as I am aware). Status codes beginning with 9 are assigned to file access and I would guess that this is where your problem lies. Have a look at the file you are writing to, and check that it matches the definition of it that you have in your operating system (JCL etc.) It may be that the physical length of the file differs from that as defined by your program.
Let me know how you get on.
Marc
 
Is this an AS400 based program right? If so check your job log, you may find it is simply the fact that you are missing the correct library for this file from your library list.
 
Thanks for your suggestions, both ofyou, but it was actually even simpeler...

I said indicator 21 had to be turned on to clear the subfile, but instead, i the progam I turned indicator 20 on, which means display. Of course, there wasnothing in the subfile at that moment, so nothing could be displayed on the screen, hence why it'd give that error...

so it would be
MOVE EEN TO IN21 OF ..
MOVE NUL TO IN20 OF ..

I's amazing how something this small has you looking for hours on end..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top