Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Variable file read - Error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue May 26, 2009 6:28 pm    Post subject: Variable file read - Error
Reply with quote

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
View user's profile Send private message

Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Tue May 26, 2009 7:20 pm    Post subject: Reply to: Variable file read - Error
Reply with quote

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
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue May 26, 2009 7:58 pm    Post subject: Reply to: Variable file read - Error
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7999
Location: Bellevue, IA

PostPosted: Tue May 26, 2009 8:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Tue May 26, 2009 8:46 pm    Post subject: Reply to: Variable file read - Error
Reply with quote

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
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue May 26, 2009 8:48 pm    Post subject: Reply to: Variable file read - Error
Reply with quote

no, nowhere in the program, the record length is being manipulated.
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Tue May 26, 2009 8:59 pm    Post subject: Reply to: Variable file read - Error
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed May 27, 2009 5:03 am    Post subject:
Reply with quote

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
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 IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us