View previous topic :: View next topic
|
Author |
Message |
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
Hi friends,
I am getting SOC4 error due to file status code 41..This is the error coming at the statement when i want to open a file first time..But i didn't wrote any open statement previous to this..I wrote my program without any file status codes..Please try to give some suggestion how to solve this problem?? thanks in advance..
Thanks,
Rajesh |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Without status codes, how do you know it is 41?
What is the full text of your error messages? |
|
Back to top |
|
|
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
Hi William,
it is displayed in sysout...the problem what i found is the program is executing sequentuially irrespective of peerform statements..
i gave...
B-intial section:
perform BA-INTIALIZE .
B-exit
exit
BA-INTIALIZE SECTION.
So it is performing BA- section section..How to stop this? Because of this its going in a loop... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
So? Problem solved? |
|
Back to top |
|
|
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
No william...its continuosly going in a loop how to solve this??? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
raz832 wrote: |
Hi William,
it is displayed in sysout...the problem what i found is the program is executing sequentuially irrespective of peerform statements..
i gave...
B-intial section:
perform BA-INTIALIZE .
B-exit
exit
BA-INTIALIZE SECTION.
So it is performing BA- section section..How to stop this? Because of this its going in a loop... |
Since you don't tell it what to do after b-exit it will just continue on with the next statement. You need a stop run after b-exit. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
raz832 wrote: |
its continuosly going in a loop how to solve this??? |
It's a little hard to say with the information you have posted so far..... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
William Thompson wrote: |
What is the full text of your error messages? |
|
|
Back to top |
|
|
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
Hi,
i am using the following code.it should work like
1. b-initial section
2. BA- INITIALIZE SECTION.
3. C- PROCESS SECTION.
4. D- TERMINATE section.
Since the BA- intialization section is performing twice i.e once in perform loop of B- section and the other time in a sequential manner...i am getting file status code 41... But it should not perform second time...could u please explain why it is performing second time..and how to stop to avoid it?
SELECT OATIA-FILE ASSIGN TO OATIA
ORGANIZATION IS SEQUENTIAL.
FD OATIA-FILE
RECORDING MODE IS F.
01 OUT-ATIA-REC PIC X(1040).
A-MAIN-CONTROL SECTION.
************************************************************
* THIS SECTION CONTROLS THE EXECUTION OF THE PROGRAM
************************************************************
PERFORM B-INITIAL.
PERFORM C-PROCESS UNTIL END-OF-UUMB.
PERFORM D-TERMINATE.
A-EXIT.
GOBACK.
/
B-INITIAL SECTION.
IF WX-RESTART = SPACES
OPEN INPUT IUUMB-FILE
PERFORM BA-INITIALIZE
END-IF.
B-EXIT.
EXIT.
BA-INITIALIZE SECTION.
.
.
OPEN OUTPUT OATIA-FILE
BA-EXIT.
EXIT.
ERROR:
A logic error occurred. Neither FILE STATUS nor a declarative was specified for file OATIA in program . AT45500 at relative location X'2302'. The status code was 41. |
|
Back to top |
|
|
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
WX-RESTART is set to spaces...and i am changing it in C- section |
|
Back to top |
|
|
anv2005
New User
Joined: 14 Jul 2005 Posts: 44 Location: US
|
|
|
|
I'd create a new paragraph within section "B-INITIAL SECTION." like so:
B-INITIAL SECTION.
B-INITIAL-P.
. . .
B-EXIT.
EXIT.
and then I'd execute the paragraph "B-INITIAL-P" like this:
PERFORM B-INITIAL-P THRU B-EXIT.
instead of the existing statement "PERFORM B-INITIAL." The same would be true for the section "BA-INITIALIZE"
Alex. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If that is how it is, that's a good one.....
When faced with the impossible, I might put a display at the beginning of each paragraph and allow it to run just long enough to find the loop..... |
|
Back to top |
|
|
raz832
New User
Joined: 27 Mar 2007 Posts: 15 Location: Chennai
|
|
|
|
HI Alex,
The logic what u said is working...Thnks for ur reply.
Hi William
thanks for ur reply |
|
Back to top |
|
|
|