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?
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
Posted: Sun May 21, 2006 5:46 am Post subject:
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
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