View previous topic :: View next topic
|
Author |
Message |
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Can anybody suggest me how to find logical error using offset value displayed in spool area..
thanks in advance |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Vinay,
Quote: |
Can anybody suggest me how to find logical error using offset value displayed in spool area.. |
How do you define 'logical error'? From the system perspective, everything is proper (including garbage) as long as syntaxs are fine. |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Murali,
I'm getting error at following specified offset... so how to find the location in program using that offset....
Code: |
The flow of control in program SORT2 proceeded beyond the last line of the program. From compile unit SORT2 at entry point SORT2 at compile unit offset +00000890 at address 00006E00.
|
|
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You will have to find the listing produced during compilation of the program, or use some debugging tool.
O. |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Thanks for your valuable suggestions. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
This doesn't ans your ques, but may solve your problem.
The usual reason for that kind of problem is that you executed the last coded line of your program and didn't exit the pgm via goback or stop run.
Tracing through the code you'll find that you either "fell thru" to that point or "go to"ed to it. |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Jack,
Here i'm posting my code, can you tell me where is the mistake.
Code: |
PROCEDURE DIVISION USING LS-FIELD.
ACCEPT LS-FIELD.
PERFORM A00-OPEN-FILES.
PERFORM A11-SORT-PARA.
PERFORM C00-CLOSE-FILES.
STOP RUN.
A11-SORT-PARA.
IF LS-FIELD = 'A'
DISPLAY 'ASCENDING ORDER SELECTED'
SORT SYS-FILE ON ASCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
IF LS-FIELD = 'D'
DISPLAY 'DESCENDING ORDER SELECTED'
SORT SYS-FILE ON DESCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
A00-OPEN-FILES.
OPEN INPUT IN-FILE.
OPEN OUTPUT OUT-FILE.
A10-INPUT-PROCEDURE.
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ.
PERFORM UNTIL WS-FLAG = 'Y'
RELEASE SYS-REC
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
END-PERFORM.
B10-OUTPUT-PROCEDURE.
RETURN SYS-FILE
AT END GO TO B10-EXIT.
MOVE SYS-REC TO OUT-REC.
WRITE OUT-REC.
GO TO B10-OUTPUT-PROCEDURE.
B10-EXIT.
EXIT.
C00-CLOSE-FILES.
CLOSE IN-FILE, OUT-FILE.
|
|
|
Back to top |
|
|
pmn
New User
Joined: 29 Jan 2006 Posts: 1 Location: bangalore
|
|
|
|
When you get abend ,,along with that you will get offset number as well,,,
then you do the following steps,,
1. find that offset no in your source listing pgm
2. when you find offset no in source pgm,,,just above that offset number you will get pgm statement number
3. take that statement number and find out what statment has come over there
4.then verify the field values of that particular statement
Thanks,
Praveen |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Vinaykumar,
1st, I think you misunderstand the functioning of the SORT verb. Take a look at an example in your shop or the manual and compare it to what you're attempting.
2nd, if you're using EXITs you must use the "THRU" option in the SORT stmt.
3rd, use a pgraph name to start your code, e.g. 000-MAINLINE. I don't remember the specifics, but some hinky things can happen w/o it.
If you have any ques on what you found don't hesitate...
If you get it to work let us know what did it for you.
Good luck |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Code: |
RETURN SYS-FILE
AT END GO TO B10-EXIT. |
When AT END is reached, the GO TO causes the program to "fall out the bottom".
As Jack mentioned, you could use "THRU". You could also also make the input and output procedures be SECTIONs. |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Can anybody send me example code... because my shop doesn't contain it.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you change this
Code: |
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE |
to
Code: |
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
THRU B10-EXIT |
your code should not fall out the bottom.
You need to do this both places in the code. |
|
Back to top |
|
|
|