IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting SOC4 error due to file status code 41


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 3:36 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:01 pm
Reply with quote

Without status codes, how do you know it is 41?
What is the full text of your error messages?
Back to top
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 5:43 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 6:09 pm
Reply with quote

So? Problem solved?
Back to top
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 6:23 pm
Reply with quote

No william...its continuosly going in a loop how to solve this???
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 04, 2007 7:10 pm
Reply with quote

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. icon_evil.gif icon_sad.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 7:18 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 7:20 pm
Reply with quote

William Thompson wrote:
What is the full text of your error messages?
Back to top
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 7:49 pm
Reply with quote

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
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 7:57 pm
Reply with quote

WX-RESTART is set to spaces...and i am changing it in C- section
Back to top
View user's profile Send private message
anv2005

New User


Joined: 14 Jul 2005
Posts: 44
Location: US

PostPosted: Mon Jun 04, 2007 8:03 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 8:18 pm
Reply with quote

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
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 04, 2007 9:17 pm
Reply with quote

HI Alex,

The logic what u said is working...Thnks for ur reply.

Hi William

thanks for ur reply
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top