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

Regarding Variable Lenth Record file Am getting SOC4.


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

New User


Joined: 22 May 2006
Posts: 15

PostPosted: Tue Sep 05, 2006 9:19 pm
Reply with quote

Hi Friends.

Am getting SOC4 For this code.

INPUT-OUTPUT SECTION.

FILE-CONTROL.
SELECT LRSP-TEST-FILE
ASSIGN TO DDNAME01
FILE STATUS IS WS-LRSP-TEST-FILE-STATUS.

DATA DIVISION.

FILE SECTION.
FD LRSP-TEST-FILE
LABEL RECORDS STANDARD
RECORDING MODE V
BLOCK CONTAINS 0 RECORDS.
01 LRSP-TEST-REC.
02 LRSP-TEST-SEG-NAME PIC X(9).
02 LRSP-TEST-SEGMENT PIC X(3441).

WORKING-STORAGE SECTION.

01 WS-FILE-IND PIC X(1) VALUE 'N'.
88 END-OF-FILE VALUE 'Y'.
01 WS-FILE-STATUS.
05 WS-LRSP-TEST-FILE-STATUS PIC X(02) VALUE ' '.
88 WS-LRSP-TEST-FILE-OK VALUE '00'.
88 WS-LRSP-TEST-FILE-EOF VALUE '10'.
PROCEDURE DIVISION.
--------------*
1000-MAIN-PARA.
--------------*
DISPLAY 'IN 1000-MAIN-PARA'.
OPEN INPUT LRSP-TEST-FILE.
PERFORM 1100-READ-INPUT-FILE
UNTIL WS-FILE-IND = 'Y'.
PERFORM 1500-CLOSE-ALL-FILES THRU 1500-EXIT.
1000-EXIT.
1100-READ-INPUT-FILE.
READ LRSP-TEST-FILE.
DISPLAY WS-LRSP-TEST-FILE-STATUS.
IF WS-LRSP-TEST-FILE-STATUS = '00'
DISPLAY 'READING INPUT FILE IS SUCCESSFUL'
PERFORM 1200-DISPLAY-PARA
ELSE IF WS-LRSP-TEST-FILE-STATUS = '10'
MOVE 'Y' TO WS-FILE-IND
ELSE
DISPLAY 'INPUT RECORD IS EMPTY'
END-IF
END-IF.
1100-EXIT.
1200-DISPLAY-PARA.
DISPLAY LRSP-TEST-SEG-NAME.
DISPLAY LRSP-TEST-SEGMENT.
1200-EXIT.
1500-CLOSE-ALL-FILES.
CLOSE LRSP-TEST-FILE.
IF WS-LRSP-TEST-FILE-STATUS = '00'
DISPLAY 'CLOSING INPUT FILE IS SUCCESS'
END-IF.
1500-EXIT.


Please Let me know why.....i dont know the reason.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Sep 05, 2006 11:03 pm
Reply with quote

changeurlife2003

Quote:

IF WS-LRSP-TEST-FILE-STATUS = '00'
DISPLAY 'READING INPUT FILE IS SUCCESSFUL'
PERFORM 1200-DISPLAY-PARA
ELSE IF WS-LRSP-TEST-FILE-STATUS = '10'
MOVE 'Y' TO WS-FILE-IND
ELSE
DISPLAY 'INPUT RECORD IS EMPTY'
END-IF
END-IF.


Please change your code as follows

IF WS-LRSP-TEST-FILE-STATUS = '00'
DISPLAY 'READING INPUT FILE IS SUCCESSFUL'
PERFORM 1200-DISPLAY-PARA
ELSE IF WS-LRSP-TEST-FILE-STATUS = '10'
MOVE 'Y' TO WS-FILE-IND
ELSE
DISPLAY 'INPUT RECORD IS EMPTY'
MOVE 'Y' TO WS-FILE-IND
END-IF
END-IF.

If you get a file status other than ?00? or ?10? your code can go into a loop.
I would also recommend putting in a record counter that is incremented on each read.

Q. How many records are read before the 0C4, and what are the file status leading to the abend. What is the record length of the offending record?

Dave
Back to top
View user's profile Send private message
changeurlife2003
Currently Banned

New User


Joined: 22 May 2006
Posts: 15

PostPosted: Wed Sep 06, 2006 3:14 pm
Reply with quote

Offending record length is +96.

am getting the file status code is 04.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top