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

Doesnot save changes

Status
Not open for further replies.

soniabharat

Programmer
Aug 9, 2001
18
US
Hi

1. I am working in Windows based COBOL(LIANT) I am using the DOS editor. When I make a file in Dos Editor and then after that I go to WOW designer to compile, Sometimes it compiles the changes correctly and sometimes after compilation it revert the changes made recently and shows me the file without the new changes made. It doesnot take the new changes made.

2. I make some file in DOS editor, it compiles fine in WOW designer but when I run the file it doesnot show me the results and when I check the view code for paragraphs it doesnot show me the code. Then I have to rewrite the code.

3. Also I need help in finding problem in my code immediately today.

Thanks
Sonia
sonias_s75@yahoo.com



 
I don't know a lot about COBOL for Windows (LIANT). But when you do a compile, do you have source modules and load modules, like you do with a mainframe system such as MVS?

Assuming you do, then when you compile, you have to make sure that the corresponding load modules are being updated. In MVS systems, when you compile, there usually is some sort of setting or procedure to link your program to the load module as you compile so that the load module reflects the current source changes.

Watch your settings for your compile routine to make sure that the load modules are getting updated at the same time your source code is being compiled.

I don't know if this is what you needed, but hope it helps.
Nina Too
 
Hi,

Thx for replying.Ya!that was helpful.There are certain problems I am getting in my project.
I want to update Attorney Record and when I click Apply button,it is not accepting the changes. It should update the record but it gives me the message that "An Error occured while updqting this attorney. Please Try again." I have written the code below. Your comments are highly appreciated.

Thanks
Sonia
sonias_s75@yahoo.com


Under the click event of the 'Apply' Button I have written this code......

PERFORM UPDATE-ATTORNEY-RECORD.
CALL WOWSETPROP USING WIN-RETURN APPLY-BTN-H
'ENABLED' WIN-FALSE.

where UPDATE-ATTORNEY-RECORD is a paragraph.....


UPDATE-ATTORNEY-RECORD Paragraph is having code:
UPDATE-ATTORNEY-RECORD.
PERFORM UNLOAD-ATTORNEY-FORM.
PERFORM VERIFY-ATTORNEY-DATA.
IF PASSED-VERIFY
PERFORM WRITE-ATTORNEY-RECORD.


Unload-attorney-form Paragraph has code......

UNLOAD-ATTORNEY-FORM.
MOVE WOWGETPROP TO LOAD-FUNC.
PERFORM LOAD-UNLOAD-ATTORNEY-FORM.


LOAD-UNLOAD-ATTORNEY-FORM paragraph has code....
LOAD-UNLOAD-ATTORNEY-FORM.

CALL LOAD-FUNC USING WIN-RETURN ENTER-MULATT-H
'TEXT' ATT-MUL-ATTORNEYS.
CALL LOAD-FUNC USING WIN-RETURN ENTER-LOC-H
'TEXT' ATT-MUL-LOCATIONS.
CALL LOAD-FUNC USING WIN-RETURN ENTER-NAME-H
'TEXT' ATT-NAME.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ADDR1-H
'TEXT' ATT-ADDRESS-1.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ADDR2-H
'TEXT' ATT-ADDRESS-2.
CALL LOAD-FUNC USING WIN-RETURN ENTER-CITY-H
'TEXT' ATT-CITY.
CALL LOAD-FUNC USING WIN-RETURN ENTER-STATE-H
'TEXT' ATT-STATE.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ZIP5-H
'TEXT' ATT-ZIP-5.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ZIP4-H
'TEXT' ATT-ZIP-4.
CALL LOAD-FUNC USING WIN-RETURN ENTER-PHONE-H
'TEXT' ATT-PHONE-NUMBER.
CALL LOAD-FUNC USING WIN-RETURN ENTER-EMAIL-H
'TEXT' ATT-EMAIL.
CALL LOAD-FUNC USING WIN-RETURN ENTER-TYPE-H
'TEXT' ATT-TYPE-OF-ATTORNEY.
IF LOAD-FUNC = WOWSETPROP

IF ATT-LAST-CHG-DATE > ZEROES
MOVE SPACES TO CHANGE-DESC
IF ATTORNEY-ADDED
STRING 'Added on: ' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(5:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(7:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(1:4) DELIMITED BY SIZE
' BY: ' DELIMITED BY SIZE
ATT-LAST-CHG-OPERATOR DELIMITED BY SIZE
INTO CHANGE-DESC
END-STRING
ELSE
STRING 'LAST MODIFIED ON: ' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(5:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(7:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(1:4) DELIMITED BY SIZE
' BY: ' DELIMITED BY SIZE
ATT-LAST-CHG-OPERATOR DELIMITED BY SIZE
INTO CHANGE-DESC
END-STRING
END-IF
CALL LOAD-FUNC USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 1
'SECTIONSTATUS'
CHANGE-DESC
ELSE
CALL LOAD-FUNC USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' ' '
END-IF.


VERIFY-ATTORNEY-DATA paragraph has code


VERIFY-ATTORNEY-DATA.
MOVE 1 TO VERIFY-FLAG.

IF ATT-NAME <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Attorney Name' TO ERROR-TITLE
MOVE 'You cannot leave attorney name blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.


IF ATT-ADDRESS-1 <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Address' TO ERROR-TITLE
MOVE 'You cannot leave address blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-CITY <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank City' TO ERROR-TITLE
MOVE 'You cannot leave city blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-STATE <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank State' TO ERROR-TITLE
MOVE 'You cannot leave state blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-ZIP-5 <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Zip Code' TO ERROR-TITLE
MOVE 'You cannot leave zip code blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-TYPE-OF-ATTORNEY <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Attorney Type' TO ERROR-TITLE
MOVE 'You cannot leave attorney type blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.




WRITE-ATTORNEY-RECORD paragraph has the code

WRITE-ATTORNEY-RECORD.
ACCEPT ATT-LAST-CHG-DATE (3:6) FROM DATE.
CALL 'C$CENTURY' USING ATT-LAST-CHG-DATE (1:2).
CALL 'C$GETENV' USING 'LOGNAME' ATT-LAST-CHG-OPERATOR.

IF ADD-ATTORNEY
MOVE 'A' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
WRITE-CODE
ELSE
MOVE 'C' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
REWRITE-CODE.
IF ATT-OK
IF ADD-ATTORNEY
MOVE 'C' TO ACTION-FLAG
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Added'
ELSE
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Updated'
END-IF
ELSE
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
IF ADD-ATTORNEY
MOVE 'ERROR: Adding Attorney' TO ERROR-TITLE
MOVE 'An error occured while adding this attorney.Please
- ' try again.' TO ERROR-MESSAGE
ELSE
MOVE 'ERROR: Updating Attorney' TO ERROR-TITLE
MOVE 'An error occured while updating this attorney.Please
- ' try again.' TO ERROR-MESSAGE
END-IF
PERFORM DISPLAY-ERROR.





 
First, a great big W-O-W! Because COBOL is really growing with the times. Visual COBOL. :) I did this sort of thing when I was taking courses in Visual Basic, with the Click events.

Truly cool. Nope, COBOL isn't going to go anywhere for quite a while. LOL

Okay, now to your problem. YOu need to look at the condition which sets the error message that you are getting. Let's look at your code:

Your 88 switch for successfully adding an attorney is IF ATT-OK. When this value is true, then you'll do the code underneath this condition, which includes your ADD-ATTORNEY routines.

If your 88 value isn't ATT-OK, then you generate the error messages.

So it looks like the ATT-OK switch isn't being set to true. Therefore the error message. Do a walk-through of your program with your debugging tool and find out what the value of the ATT-OK switch is when you get to the phrase IF ATT-OK.

First, does the new attorney get written to your file? If not, then something in the WRITE paragraph is triggering your ATT-OK to show an error condition. Is the file the wrong size, the wrong name, the wrong length?

If the new attorney is being added, then I would bet that you aren't passing the ATT-OK condition to this 88 switch when you are completing your ADD-ATTORNEY routines.

Let me know how it's working, Nina Too
 
Hi,

Thx for replying soon.I need to complete my project urgent.So,you are a great help.

My project is adding New Attorney to it.
What code should I write to pass condition to 88 switch.
If you can help me immediately I can send you my project.Give me ur mail-id ,Please.
your help is greatly appreciated.
Thx
Sonia
 
You need to set ATT-OK to the condition of TRUE when you get done with your ADD-ATTORNEY routine.

Just code SET ATT-OK TO TRUE at the end of this routine.

Let me know if this helps.

NIna Too
 
Hi,

Can you tell me exactly what to write and where in the code I sent you.
Thx




I am trying to fix the following problems in project.If you can help.
Problems that needs to be fixed:

1.New id is not accepted.

2.If I enter Attorney id say 123456789 and then click New Attorney
It opens Detail Form.
If I enter Multiple Attorney and Multiple Location same as that of existig one.It shows message

&quot;Attorney already in use.Try Again&quot;.
and when I click O.K. it should show me Blank Detail Sheet but it shows some Characters of Name-Field if this field has more then 4 characters.

3. O.K. Button is not working with the code I entered from the printout given to me.

4.When I want to make changes in existing Record Apply Button is highlighted and on clicking Apply,It gives message

&quot;Error occured while updating Attorney.Please try again.&quot;

Apply button works when New Attorney is added.

5.When I enter new attorney and leave say 2 entries blank.
It displays message
You cannot leave them blank and when OK is clicked it accepts data for those fields and on clicking Apply Adds Attorney.
But if I leave only one field blank that needs to be filled.It gives message
&quot;You cannot leave it blank.Try again&quot;
But now when I enter data for that one field APPLY is not activated

Sonia
 
Try this for the 'Error occured while adding/updating attorney' problem:

Your original code will show in green. My notes/additions will show in blue.


WRITE-ATTORNEY-RECORD paragraph has the code

WRITE-ATTORNEY-RECORD.
ACCEPT ATT-LAST-CHG-DATE (3:6) FROM DATE.
CALL 'C$CENTURY' USING ATT-LAST-CHG-DATE (1:2).
CALL 'C$GETENV' USING 'LOGNAME' ATT-LAST-CHG-OPERATOR.

IF ADD-ATTORNEY
MOVE 'A' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
WRITE-CODE
IF ['ATTIO'S' return code indicates no error]
SET ATT-OK TO TRUE
ELSE
SET [88 value which indicates error] TO TRUE
END-IF

ELSE
MOVE 'C' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
REWRITE-CODE


IF ['ATTIO'S' return code indicates no error]
SET ATT-OK TO TRUE
ELSE
SET [88 value which indicates error] TO TRUE
END-IF

IF ATT-OK
IF ADD-ATTORNEY
MOVE 'C' TO ACTION-FLAG
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Added'
ELSE
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Updated'
END-IF
ELSE
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
IF ADD-ATTORNEY
MOVE 'ERROR: Adding Attorney' TO ERROR-TITLE
MOVE 'An error occured while adding this attorney.Please
- ' try again.' TO ERROR-MESSAGE
ELSE
MOVE 'ERROR: Updating Attorney' TO ERROR-TITLE
MOVE 'An error occured while updating this attorney.Please
- ' try again.' TO ERROR-MESSAGE
END-IF
PERFORM DISPLAY-ERROR.


Hope this helps, Nina Too
 
Hi,

I am doing programming in Visual Language for first time.So,a little bit confused.I have to complete my project today if you can help I can send you mail and my project as attachment.If,you feel comfortable send me your mail-id.I am running short of tome.

Thx
Sonia
 
Hi,

Thx Neena,I made the changes u told. The program now adds the new records. After narrowing the search, I found that the following code just displays the message Attorney updated'
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Updated'

This code is executing fine. In real, nothing is being saved
The code that updates the fields in the files is

DISPLAY &quot;ELSE ADD-ATTORNEY&quot;
MOVE 'C' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
REWRITE-CODE

The above code should update the changes but is not updating the data.


Any help
Sonia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top