Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting SOC4 error due to file status code 41

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Getting SOC4 error due to file status code 41
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:01 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 6:09 pm    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 7:18 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 7:20 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: Getting SOC4 error due to file status code 41
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 8:18 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us