View previous topic :: View next topic
|
Author |
Message |
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
I am trying to read a variable length file (max length = 604).
The first record is 169 and second 183.
The first read is working fine, but the second read is giving S-002 error.
The length of the second record displayed is 16444 instead of 183.
Any help on this?
S-002
DESCRIPTION: S002-04 - AN ERROR OCCURRED IN PROCESSING A SEQUENTIAL OR INDEXED
SEQUENTIAL DATA SET, OR IN CREATING A DIRECT ACCESS DATA SET.
REFER TO MESSAGE IEC036I DISPLAYED IN JES MSGLOG OF THE JOB THAT ENDED. THE 2 BYTES RETURN CODE TO THE RIGHT OF THE ABEND CODE IDENTIFIES THE ERROR.
POSSIBLE CAUSES: 04 - AN ERROR OCCURRED IN READING A SEQUENTIAL DATA SET:
1. THE VARIABLE RECORD LENGTH WAS LESS THAN 4.
2. THE LRECL WAS GREATER THAN THE DCB LRECL.
3. AN ERROR OCCURRED IN SEQUENTIAL PROCESSING OF VARIABLE
LENGTH SPANNED RECORDS WHICH WERE NOT IN SEQUENCE
TO CORRECT:
1. VARIABLE RECORD LENGTH MUST INCLUDE 4 BYTES OF RDW.
BLKSIZE MUST BE LRECL OR MULTIPLES OF LRECL PLUS 4 BYTES
OF BDW.
2. RECREATE THE DATA SET SPECIFYING THE CORRECT DCB INFORMATION.
3. RECREATE THE DATA SET SO THAT THE SPANNED RECORDS
ARE IN THE CORRECT SEQUENCE. |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
Quote: |
The length of the second record displayed is 16444 instead of 183. |
Where is the length displayed and how have you ascertained that the length is 183 for the second read, Show us the Select and FD of the file declared and your logic for read clause.
WTH |
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
SELECT TED01GDW ASSIGN TO TED01GDW
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WW-TED01GDW-STATUS.
===========
FD TED01GDW
RECORDING MODE IS V
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD
RECORD IS VARYING IN SIZE FROM 1 TO 600
DEPENDING ON WW-TED01GDW-LENGTH.
01 TED01GDW-RECORD PIC X(600).
====READ=======
READ TED01GDW AT END
MOVE 'Y' TO WF-EOF-INPUT
END-READ
DISPLAY 'LENGTH OF REC = ' WW-TED01GDW-LENGTH |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Where did the input data file come from? Was it transferred from another system? If so, what kind of system was it transferred from? |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
kalukakkad,
if the READ operation is successful then WW-TED01GDW-LENGTH will hold the number of the character positions of the record just read.
If the READ operation is unsuccessful then WW-TED01GDW-LENGTH , will hold the value it had before the READ operation was attempted.
As per your understanding 169 length records was successfully read, your second read failed ,so the value of WW-TED01GDW-LENGTH should have been 169 but it is 16444. Was this value manipulated some where in the program.
WTH. |
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
no, nowhere in the program, the record length is being manipulated. |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
Display value of variable WW-TED01GDW-LENGTH before and after read , and by physically opening the file you determined that the second record is of length 183. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Can you show us how the file was defined in the JCL? What was the LRECL and BLKSIZE, RECFM?
How was WW-TED01GDW-LENGTH defined in the pgm? |
|
Back to top |
|
|
|