Cobol Programming Help...With Library



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Cobol Programming Help...With Library

Postby crazycobol » Fri Dec 04, 2009 4:23 am

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.
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

 

Re: Cobol Programming Help...With Library

Postby crazycobol » Fri Dec 04, 2009 5:51 am

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.
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

Postby crazycobol » Fri Dec 04, 2009 5:53 am

correction on the error, it should say "12-S operand MFILE4 is not declared"
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

Postby dick scherrer » Fri Dec 04, 2009 9:39 am

Hello and welcome to the forum,

Which compiler are you using? Which computer/operating system are you using?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Cobol Programming Help...With Library

Postby crazycobol » Fri Dec 04, 2009 11:40 pm

i am using micro focus netexpress. Windows XP.
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

Postby dick scherrer » Sat Dec 05, 2009 3:11 am

Hello,

Suggest you work with MicroFocus support.

This part of the forum is for Mainframe COBOL, not Windows.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Cobol Programming Help...With Library

Postby crazycobol » Sat Dec 05, 2009 4:56 am

just to give you an update, i was able to work through it. All is well now. Thank you.
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

Postby dick scherrer » Sat Dec 05, 2009 5:48 am

Good to hear it is working - thanks for letting us know :)

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

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Cobol Programming Help...With Library

Postby crazycobol » Wed Dec 16, 2009 4:42 am

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.
crazycobol
 
Posts: 35
Joined: Fri Dec 04, 2009 3:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol Programming Help...With Library

Postby dick scherrer » Wed Dec 16, 2009 8:49 am

Thank you for the clarification :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post