MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

question about file status

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
issac1029
Intermediate


Joined: 10 Dec 2005
Posts: 159
Topics: 75

PostPosted: Sat May 20, 2006 10:57 pm    Post subject: question about file status Reply with quote

Hi,
SELECT xxxASSIGN TO xxx1
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS W-xxx-STS.

If I do not write this 'file status is' W-xxx-STS.can W-xxx-STS get the value from operation of a file?

example,
//OUTA OUTPUT OUTDISP=(WRITE,HOLD)
//BANK OUTPUT OUTDISP=WRITE
//CMPRT01 DD SYSOUT=&OC,OUTPUT=(*.OUTA)
//CMPRT02 DD SYSOUT=&OC,OUTPUT=(*.BANK)
//CMPRT03 DD SYSOUT=&OC,OUTPUT=(*.OUTA)

SELECT PRNFILE1 ASSIGN TO CMPRT01.

OPEN OUTPUT PRNFILE1.
IF NOT(W-PRNFILE1-STS = '00' OR = '97')
MOVE 1 TO W-ERR-CODE
MOVE 'REPORT FILE OPEN ERROR' TO W-ERROR-MSG
PERFORM 1090-ERROR THRU 1090-ERROR-EXIT
GO TO 990-OPEN-EXIT
END-IF.

is this right?I think even it's a printer ,it should be give the status inditor to W-PRNFILE1-STS in select casue,then can use it,am I right?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sun May 21, 2006 5:46 am    Post subject: Reply with quote

Hi issac1029,

Before using a FILE-STATUS variable , there are 2 preconditions :-
a) The FILE-STATUS varibale must be made associated with corresponding file in ENVIRONMENT DIVISION using :
Code:
SELECT FILE-NAME ASSIGN TO DDNAME
    FILE-STATUS IS FILE-STATUS-VAR.

b) The FILE-STATUS variable FILE-STATUS-VAR must be defined in working-storage section of DATA DIVISION.

If above 2 points were taken care of , then only the FILE-STATUS variable gets populated by OS , whenever the file operaion happens.

Also to your last point , every type of file gets FILE-STATUS , even though it is printer file.
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group