Page 1 of 1

Cobol Programming Help...With Library

PostPosted: Fri Dec 04, 2009 4:23 am
by crazycobol
Hello everyone. I need your advise on an issue that I am having. I'll try and explain it best as I can.

I have a program that has been working for awhile. In that program, it uses a Masterfile called masterfile.dat. That is derived from a masterfile.lib (library) which has all all the field specs in there.

Recently I have to add another field in the program. I am not sure if this is correct way or not so if you can please point out if I'm not doing it correctly. I went into the program and into the masterfile.lib (library) and added that field in there. However when I try to call up that field in the program, I get "12-S Operand [new field name] is not declared"

This is what I am understanding. Here is an example:

masterfile.lib has the following:

FD MSTRFILE
LABEL RECORDS ARE STANDARD.

01 MREC

05 MFILE PIC XXX.
05 MFILE2 PIC XXX.
05 MFILE3 PIC XXX.


If I had to go into the library to add MFILE4. How do I go about updating the masterfile.dat to have the mfile4? So that when I run my program and calls up the MFILE4, it would be declared and on the masterfile.dat to grab. Does that make sense?

I tried to update it by writing another program that does the following:

REWRITE MREC.


Please give me your insight into this, any help is greatly appreciated.

Re: Cobol Programming Help...With Library

PostPosted: Fri Dec 04, 2009 5:51 am
by crazycobol
a little more information.

I did the following:

MOVE 000 into MFILE4. And I list the file out and it shows MFILE4 having 000 in there.

However when I do a DISPLAY MFILE4 or even a ACCEPT MFILE4 in the program, I would get the error "12-S operand mmemorial is not declared"

It is already declared in the masterfile.dat file, how come it is giving me that error. When I do a "DISPLAY MFILE3" it doesn't give me that error. MFILE3 is in the masterfile.dat

I am a little confuse and was wondering if you can help me out.

Re: Cobol Programming Help...With Library

PostPosted: Fri Dec 04, 2009 5:53 am
by crazycobol
correction on the error, it should say "12-S operand MFILE4 is not declared"

Re: Cobol Programming Help...With Library

PostPosted: Fri Dec 04, 2009 9:39 am
by dick scherrer
Hello and welcome to the forum,

Which compiler are you using? Which computer/operating system are you using?

Re: Cobol Programming Help...With Library

PostPosted: Fri Dec 04, 2009 11:40 pm
by crazycobol
i am using micro focus netexpress. Windows XP.

Re: Cobol Programming Help...With Library

PostPosted: Sat Dec 05, 2009 3:11 am
by dick scherrer
Hello,

Suggest you work with MicroFocus support.

This part of the forum is for Mainframe COBOL, not Windows.

Re: Cobol Programming Help...With Library

PostPosted: Sat Dec 05, 2009 4:56 am
by crazycobol
just to give you an update, i was able to work through it. All is well now. Thank you.

Re: Cobol Programming Help...With Library

PostPosted: Sat Dec 05, 2009 5:48 am
by dick scherrer
Good to hear it is working - thanks for letting us know :)

If you post your solution, it will probably help someone else later ;)

d

Re: Cobol Programming Help...With Library

PostPosted: Wed Dec 16, 2009 4:42 am
by crazycobol
the problem was that there was two library or file layout in the program. I changed the one that was obvisouly however didn't change the other one as well. I changed the 2nd one and it ran through with no issue. The reason why I missed the 2nd one was because it was embedded down further than the first library was located.

Re: Cobol Programming Help...With Library

PostPosted: Wed Dec 16, 2009 8:49 am
by dick scherrer
Thank you for the clarification :)

d