VSAM Error Code 04 - Read



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: VSAM Error Code 04 - Read

Postby enrico-sorichetti » Wed Sep 14, 2011 2:00 pm

the code tags... use the FREE code tags
do You realize that not using them makes the data difficult to read or not
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 2:58 pm

JCL step which I have used to run this program..

//LTRSZIP EXEC DB2VTSO
//SYSTSIN DD *
DSN SYSTEM(DB2V)
RUN PROGRAM(XXXXXXXX) PLAN(XXXXXXXX)
/*
//STEPLIB DD DSN=XXXX.XXXX.LOADLIB,DISP=SHR
// DD DSN=XXXX.XXXX.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=W
//CDSHLTHB DD DSN=XXXX.XX,DISP=MOD
//CKREQNBR DD DSN=XXXX.XX,DISP=MOD
//SKIMFILE DD DSN=XXXX.XX,DISP=SHR
//PARMFILE DD DSN=XXXX.XX,DISP=SHR
//DTLFILE DD DSN=TA.CDP.ABC.BILL.DETAIL.KSDS,DISP=SHR
//ERRFILE DD DSN=XXX.XXX,DISP=OLD
//MSLTRFL DD SYSOUT=*
//OCASHRPT DD SYSOUT=5
//OLTTRCNT DD DUMMY
//*

in Program:-


Working-storage section

01 VSAM-STATUS-KEY-VALUES EXTERNAL.
05 VSAM-STATUS-KEY PIC XX.
88 IMPLICIT-VERIFY-OK VALUE '97'.
05 STATUS-KEY-REDEFINED REDEFINES VSAM-STATUS-KEY.
10 STATUS-KEY-1 PIC X.
88 SUCCESSFUL-COMPLETION VALUE '0'.
88 AT-END VALUE '1'.
88 INVALID-KEY VALUE '2'.
88 PERMENANT-ERROR VALUE '3'.
88 OTHER-ERRORS VALUE '9'.
10 STATUS-KEY-2 PIC X.
88 NO-FURTHER-INFORMATION VALUE '0'.
88 DUP-KEYS-DUPS-NOT-SPECIFIED VALUE '2'.



Code..where I am getting the error..

C030-PROCESS-BILL-FLDS.

** BUILDING THE DETAIL-FILE KEY ***
MOVE CLM-RPT-NBR TO CLM-RPT-NBR OF C011111.
MOVE INSD-ALT-PROV-SW TO INSD-ALT-PROV-CODE OF C011111.
MOVE CLM-NBR-ID-CODE TO CLM-NBR-ID-CODE OF C011111.
MOVE INSD-ALT-PROV-SEQ TO INSD-ALT-PROV-SEQ OF C011111.
MOVE BILL-SEQ-NBR TO BILL-SEQ-NBR OF C011111.


*** IF RECORD NOT FOUND, DON'T ABEND. ****
READ DETAIL-FILE.
IF SUCCESSFUL-COMPLETION AND NO-FURTHER-INFORMATION
OR INVALID-KEY
NEXT SENTENCE
ELSE
PERFORM U999-ABEND-ROUTINE
THRU U999-ABEND-ROUTINE-EXIT.

(I am getting STATUS-KEY-1 = '0' and STATUS-KEY-1 = '4' ..while expediting..)




Job output is not giving the much info...still I am pasting the SDSF message..




CEE3250C The system or user abend U3400 R=NULL was issued.
From compile unit MUTLD755 at entry point MUTLD755 at compile unit offset +00000430 at entry offset +00000430
at address 1E52AC90.
<> LEAID ENTERED (LEVEL 02/15/2010 AT 12.50)
<> LEAID PROCESSING COMPLETE. RC=0


READY
DSN SYSTEM(DB2V)
DSN
RUN PROGRAM(XXXXXX) PLAN(XXXXXXX)
DSN ENDED DUE TO ERROR+
USER ABEND CODE 3400 REASON CODE 00000000



Pleasse let me know if you need more details..
MSURESH309
 
Posts: 17
Joined: Thu Apr 21, 2011 10:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM Error Code 04 - Read

Postby enrico-sorichetti » Wed Sep 14, 2011 3:13 pm

do You have understanding problems ? :evil: or You just do not care

here is a snippet of what You posted

111111ABCD LT10Y65 2011-04-212011-04-30 EM
FFFFFFCDEC0101 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0090000900CD
11111193330C0C 0001000100033310865000000201100402120110040300000C0000C54

and here is how it looks with the code tags
111111ILTC                 LT10Y65      2011-04-212011-04-30          EM
FFFFFFCDEC0101 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0090000900CD
11111193330C0C 0001000100033310865000000201100402120110040300000C0000C54


don' t You think that it makes things easier for those willing to answer
unless You are more prone to follow advices You will have a hard time on any forum
since we reply on our own time and free of charge it is our right to tell You how to post
and it is up you to behave according to the suggestions of the people willing to answer

anyway
to make the most out of the questions You ask and to forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here http://catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here http://support.microsoft.com/kb/555375
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: VSAM Error Code 04 - Read

Postby BillyBoyo » Wed Sep 14, 2011 3:58 pm

It would seem that you have a record (or more) on your file which is not the length you are expecting.

Since you delete/defined the file and then run another program to put data on the file, it would be worth checking the other program, which is where the error is going to be. Maybe before that use something to check on the lengths of the records.

I'm curious about your use of qualification. You need qualification if you have duplicate-named fields. Yet you have reference to fields with no qualification. Which to me implies no duplicate field names which means you are moving the fields to themselves (mostly).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VSAM Error Code 04 - Read

Postby Robert Sample » Wed Sep 14, 2011 3:59 pm

I am getting the Return code 04 when reading VSAM file (KSDS)..I am not understanding what's the meaning of below description..
can you please help me to solve the program

04 - A READ statement was successfully executed, but the length of the record being processed did not conform to the fixed file attributes for that file.
Since you seem to be having trouble understanding written English, let me rephrase the error message: there is at least one record in the VSAM file which is NOT 13268 bytes long, and your COBOL program read that record. You can either rebuild the VSAM file, making sure every record is 13268 bytes long, or you can change your COBOL program to handle records that are not the right length.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post