Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Regarding Variable Lenth Record file Am getting SOC4.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Regarding Variable Lenth Record file Am getting SOC4.
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    Post subject: Re: Regarding Variable Lenth Record file Am getting SOC4.
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    Post subject:
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    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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us