VSAM Error Code 04 - Read



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

VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 5:29 am

Hi,

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.

Here is how coded DEL/DEF VSAM in the previous step..

//DELDEF EXEC PGM=IDCAMS,REGION=1024K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTC ENT(TA.CDP.ABC.BILL.DETAIL.KSDS) ALL

DELETE TA.CDP.ABC.BILL.DETAIL.KSDS
SET MAXCC = 0
DEF CL(NAME(TA.CDP.ABC.BILL.DETAIL.KSDS) -
CYL(3,2) -
SHR(2,3) -
RECSZ(13268,13268) -
KEY(14,0) -
SPEED -
REUSE -
BUFFERSPACE(28672)) -
DATA(CISZ(9216))
/*

Here is how I have coded in the cobol

FILE-CONTROL.
SELECT DETAIL-FILE
ASSIGN TO DTLFILE
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS BILL-DETAIL-KEY
FILE STATUS IS VSAM-STATUS-KEY.


FD DETAIL-FILE IS EXTERNAL
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
copy C011111.



where copybook c011111 has lenght of 13268 like below

01 C011111.
05 BILL-DETAIL-RECORD.
10 BILL-DETAIL-KEY.
---
--
--
Here is my DSN in the JCL //DTLFILE DD DSN=TA.CDP.ABC.BILL.DETAIL.KSDS,DISP=SHR

Thanks,
Suresh
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

 

Re: VSAM Error Code 04 - Read

Postby NicC » Wed Sep 14, 2011 9:41 am

If you have just created the file how to you expect to successfully read from it? VSAM possibly tried a read - got 0 bytes back and that is less than the specified record length.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 9:48 am

Sorry..My typo error..I created vsam file thru Del/Def in previus job.Job1.then loaded the records successfully...but getting the return code 04 while I am reading in Job2..I don't see while writing into vsam..but got error while reading....my job got abended..That's the my problem

Any help would be appriciated..

Thanks,
Suresh
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 dick scherrer » Wed Sep 14, 2011 10:40 am

Hello,

It may help someone help you if you post the informatonal output from the delete/define, the load of the data, and a listcat of the vsam file (immediately after the problem run).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 11:01 am

Here is the SDSF messages for Del/Def step

1IDCAMS SYSTEM SERVICES TIME: 00:18:15 09/14/11 PAGE 1
0
LISTC ENT(TA.CDP.ABC.BILL.DETAIL.KSDS) ALL
0CLUSTER ------- TA.CDP.ABC.BILL.DETAIL.KSDS
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2011.257
RELEASE----------------2 EXPIRATION------0000.000
SMSDATA
STORAGECLASS ---SCSTNDRD MANAGEMENTCLASS---MCTEST
DATACLASS ------DCHWCPVS LBACKUP ---0000.000.0000
EATTR-------------(NULL)
BWO STATUS------00000000 BWO TIMESTAMP---00000 00:00:00.0
BWO---------------(NULL)
RLSDATA
LOG ----------------(NULL) RECOVERY REQUIRED --(NO) FRLOG ------------(NULL)
VSAM QUIESCED -------(NO) RLS IN USE ---------(NO)
0 LOGSTREAMID-----------------------------(NULL)
RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'
RECOVERY TIMESTAMP GMT-------X'0000000000000000'
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
DATA-----TA.CDP.ABC.BILL.DETAIL.KSDS.DATA
INDEX----TA.CDP.ABC.BILL.DETAIL.KSDS.INDEX
0 DATA ------- TA.CDP.ABC.BILL.DETAIL.KSDS.DATA
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2011.257
RELEASE----------------2 EXPIRATION------0000.000
ACCOUNT-INFO-----------------------------------(NULL)
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--TA.CDP.ABC.BILL.DETAIL.KSDS
ATTRIBUTES
KEYLEN----------------14 AVGLRECL-----------13268 BUFSPACE-----------29184 CISIZE-------------14336
RKP--------------------0 MAXLRECL-----------13268 EXCPEXIT----------(NULL) CI/CA-----------------52
STRIPE-COUNT-----------1
SHROPTNS(2,3) SPEED UNIQUE NOERASE INDEXED NOWRITECHK NOIMBED NOREPLICAT
UNORDERED REUSE NONSPANNED EXTENDED
STATISTICS
REC-TOTAL--------------0 SPLITS-CI--------------0 EXCPS------------------0
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1
REC-INSERTED-----------0 FREESPACE-%CI----------0 SYSTEM-TIMESTAMP:
REC-UPDATED------------0 FREESPACE-%CA----------0 X'0000000000000000'
REC-RETRIEVED----------0 FREESPC----------2236416
ALLOCATION
SPACE-TYPE------CYLINDER HI-A-RBA---------2236416
SPACE-PRI--------------3 HI-U-RBA---------------0
SPACE-SEC--------------2
1IDCAMS SYSTEM SERVICES TIME: 00:18:15 09/14/11 PAGE 2
0 VOLUME
VOLSER------------P30982 PHYREC-SIZE---------7168 HI-A-RBA---------2236416 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK------------7 HI-U-RBA---------------0 EXTENT-TYPE--------X'40'
VOLFLAG------------PRIME TRACKS/CA-------------15
EXTENTS:
LOW-CCHH-----X'00B90000' LOW-RBA----------------0 TRACKS----------------45
HIGH-CCHH----X'00BB000E' HIGH-RBA---------2236415
0 INDEX ------ TA.CDP.ABC.BILL.DETAIL.KSDS.INDEX
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2011.257
RELEASE----------------2 EXPIRATION------0000.000
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--TA.CDP.ABC.BILL.DETAIL.KSDS
ATTRIBUTES
KEYLEN----------------14 AVGLRECL---------------0 BUFSPACE---------------0 CISIZE---------------512
RKP--------------------0 MAXLRECL-------------505 EXCPEXIT----------(NULL) CI/CA-----------------48
SHROPTNS(2,3) SPEED UNIQUE NOERASE NOWRITECHK NOIMBED NOREPLICAT UNORDERED
REUSE EXTENDED
STATISTICS
REC-TOTAL--------------0 SPLITS-CI--------------0 EXCPS------------------0 INDEX:
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1 LEVELS-----------------0
REC-INSERTED-----------0 FREESPACE-%CI----------0 SYSTEM-TIMESTAMP: ENTRIES/SECT-----------7
REC-UPDATED------------0 FREESPACE-%CA----------0 X'0000000000000000' SEQ-SET-RBA----------------0
REC-RETRIEVED----------0 FREESPC------------24576 HI-LEVEL-RBA---------------0
ALLOCATION
SPACE-TYPE---------TRACK HI-A-RBA-----------24576
SPACE-PRI--------------1 HI-U-RBA---------------0
SPACE-SEC--------------1
VOLUME
VOLSER------------P30982 PHYREC-SIZE----------512 HI-A-RBA-----------24576 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK-----------48 HI-U-RBA---------------0 EXTENT-TYPE--------X'40'
VOLFLAG------------PRIME TRACKS/CA--------------1
EXTENTS:
LOW-CCHH-----X'00180004' LOW-RBA----------------0 TRACKS-----------------1
HIGH-CCHH----X'00180004' HIGH-RBA-----------24575
1IDCAMS SYSTEM SERVICES TIME: 00:18:15 09/14/11 PAGE 3
0 THE NUMBER OF ENTRIES PROCESSED WAS:
AIX -------------------0
ALIAS -----------------0
CLUSTER ---------------1
DATA ------------------1
GDG -------------------0
INDEX -----------------1
NONVSAM ---------------0
PAGESPACE -------------0
PATH ------------------0
SPACE -----------------0
USERCATALOG -----------0
TAPELIBRARY -----------0
TAPEVOLUME ------------0
TOTAL -----------------3
0 THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
DELETE TA.CDP.ABC.BILL.DETAIL.KSDS
0IDC0550I ENTRY (D) TA.CDP.ABC.BILL.DETAIL.KSDS.DATA DELETED
0IDC0550I ENTRY (I) TA.CDP.ABC.BILL.DETAIL.KSDS.INDEX DELETED
0IDC0550I ENTRY (C) TA.CDP.ABC.BILL.DETAIL.KSDS DELETED
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
SET MAXCC = 0

DEF CL(NAME(TA.CDP.ABC.BILL.DETAIL.KSDS) -
CYL(3,2) -
SHR(2,3) -
RECSZ(13268,13268) -
KEY(14,0) -
SPEED -
REUSE -
BUFFERSPACE(28672)) -
DATA(CISZ(9216))
0IGD17162I RETURN CODE (12) REASON CODE (5F01083F) RECEIVED FROM
COMPRESSION SERVICES WHILE PROCESSING DATA SET
TA.CDP.ABC.BILL.DETAIL.KSDS , COMPRESSION REQUEST NOT
HONORED BECAUSE DATA SET CHARACTERISTICS DO NOT MEET COMPRESSION CRITERIA,
ALLOCATION CONTINUES
IGD17070I DATA SET TA.CDP.ABC.BILL.DETAIL.KSDS
ALLOCATED SUCCESSFULLY WITH 1 STRIPE(S).
1IDCAMS SYSTEM SERVICES TIME: 00:18:15 09/14/11 PAGE 4
0IDC0508I DATA ALLOCATION STATUS FOR VOLUME P31043 IS 0
0IDC0509I INDEX ALLOCATION STATUS FOR VOLUME P31043 IS 0
0IDC0512I NAME GENERATED-(D) TA.CDP.ABC.BILL.DETAIL.KSDS.DATA
0IDC0512I NAME GENERATED-(I) TA.CDP.ABC.BILL.DETAIL.KSDS.INDEX
IDC0181I STORAGECLASS USED IS SCSTNDRD
IDC0181I MANAGEMENTCLASS USED IS MCTEST
IDC0181I DATACLASS USED IS DCHWCPVS
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0


Here is some part of data after loading into above vsam file.I see all the copybook variables mapping correctly after write..


123456ABCD LT10Y65 2011-04-212011-04-30 EM
123456ABCD LT10Y65 2011-05-012011-05-31 EM
123456ABCD LT10Y65 2011-06-012011-06-30 EM
123456ABCD < LT10Y65 2011-07-012011-07-15 j j EM
800586ABCD < LT10Y65 2011-07-012011-07-31 EM



Please let me know if any other details needed..Thanks!
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 mongan » Wed Sep 14, 2011 11:52 am

But you still have not given us information about the dataset after it has been filled with data or how you fill it with data (no job or output posted). Idcams listed show that the data set is empty.
User avatar
mongan
 
Posts: 212
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times

Re: VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 12:10 pm

Here is the LISTCAT details after write/load into vsam..

1IDCAMS SYSTEM SERVICES TIME: 01:34:17 09/14/11 PAGE 1
0
LISTC ENT(TA.CDP.ABC.BILL.DETAIL.KSDS) ALL
0CLUSTER ------- TA.CDP.ABC.BILL.DETAIL.KSDS
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-------$K1H CREATION--------2011.255
RELEASE----------------2 EXPIRATION------0000.000
SMSDATA
STORAGECLASS ---SCSTNDRD MANAGEMENTCLASS---MCTEST
DATACLASS ------DCHWCPVS LBACKUP ---2011.256.1920
EATTR-------------(NULL)
BWO STATUS------00000000 BWO TIMESTAMP---00000 00:00:00.0
BWO---------------(NULL)
RLSDATA
LOG ----------------(NULL) RECOVERY REQUIRED --(NO) FRLOG ------------(NULL)
VSAM QUIESCED -------(NO) RLS IN USE ---------(NO)
0 LOGSTREAMID-----------------------------(NULL)
RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'
RECOVERY TIMESTAMP GMT-------X'0000000000000000'
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
DATA-----TA.CDP.ABC.BILL.DETAIL.KSDS.DATA
INDEX----TA.CDP.ABC.BILL.DETAIL.KSDS.INDEX
0 DATA ------- TA.CDP.ABC.BILL.DETAIL.KSDS.DATA
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2011.255
RELEASE----------------2 EXPIRATION------0000.000
ACCOUNT-INFO-----------------------------------(NULL)
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--TA.CDP.ABC.BILL.DETAIL.KSDS
ATTRIBUTES
KEYLEN----------------14 AVGLRECL-----------13268 BUFSPACE-----------29184 CISIZE-------------14336
RKP--------------------0 MAXLRECL-----------13268 EXCPEXIT----------(NULL) CI/CA-----------------52
STRIPE-COUNT-----------1
SHROPTNS(2,3) SPEED UNIQUE NOERASE INDEXED NOWRITECHK NOIMBED NOREPLICAT
UNORDERED REUSE NONSPANNED EXTENDED
STATISTICS
REC-TOTAL-------------16 SPLITS-CI--------------0 EXCPS----------------102
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1
REC-INSERTED-----------0 FREESPACE-%CI----------0 SYSTEM-TIMESTAMP:
REC-UPDATED------------0 FREESPACE-%CA----------0 X'C85EE50D0C79F904'
REC-RETRIEVED--------174 FREESPC-----------516096
ALLOCATION
SPACE-TYPE------CYLINDER HI-A-RBA----------745472
SPACE-PRI--------------3 HI-U-RBA----------745472
SPACE-SEC--------------2
1IDCAMS SYSTEM SERVICES TIME: 01:34:17 09/14/11 PAGE 2
0 VOLUME
VOLSER------------P30820 PHYREC-SIZE---------7168 HI-A-RBA----------745472 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK------------7 HI-U-RBA----------745472 EXTENT-TYPE--------X'40'
VOLFLAG------------PRIME TRACKS/CA-------------15
EXTENTS:
LOW-CCHH-----X'03640000' LOW-RBA----------------0 TRACKS----------------15
HIGH-CCHH----X'0364000E' HIGH-RBA----------745471
0 INDEX ------ TA.CDP.$K1H.C800585.BILL.DETAIL.KSDS.INDEX
IN-CAT --- CATALOG.VP93246
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2011.255
RELEASE----------------2 EXPIRATION------0000.000
PROTECTION-PSWD-----(NULL) RACF----------------(NO)
ASSOCIATIONS
CLUSTER--TA.CDP.ABC.BILL.DETAIL.KSDS
ATTRIBUTES
KEYLEN----------------14 AVGLRECL---------------0 BUFSPACE---------------0 CISIZE---------------512
RKP--------------------0 MAXLRECL-------------505 EXCPEXIT----------(NULL) CI/CA-----------------48
SHROPTNS(2,3) SPEED UNIQUE NOERASE NOWRITECHK NOIMBED NOREPLICAT UNORDERED
REUSE EXTENDED
STATISTICS
REC-TOTAL--------------1 SPLITS-CI--------------0 EXCPS-----------------18 INDEX:
REC-DELETED------------0 SPLITS-CA--------------0 EXTENTS----------------1 LEVELS-----------------1
REC-INSERTED-----------0 FREESPACE-%CI----------0 SYSTEM-TIMESTAMP: ENTRIES/SECT-----------7
REC-UPDATED------------0 FREESPACE-%CA----------0 X'C85EE50D0C79F904' SEQ-SET-RBA----------------0
REC-RETRIEVED----------0 FREESPC------------24064 HI-LEVEL-RBA---------------0
ALLOCATION
SPACE-TYPE---------TRACK HI-A-RBA-----------24576
SPACE-PRI--------------1 HI-U-RBA-------------512
SPACE-SEC--------------1
VOLUME
VOLSER------------P30820 PHYREC-SIZE----------512 HI-A-RBA-----------24576 EXTENT-NUMBER----------1
DEVTYPE------X'3010200F' PHYRECS/TRK-----------48 HI-U-RBA-------------512 EXTENT-TYPE--------X'00'
VOLFLAG------------PRIME TRACKS/CA--------------1
EXTENTS:
LOW-CCHH-----X'000B0004' LOW-RBA----------------0 TRACKS-----------------1
HIGH-CCHH----X'000B0004' HIGH-RBA-----------24575
1IDCAMS SYSTEM SERVICES TIME: 01:34:17 09/14/11 PAGE 3
0 THE NUMBER OF ENTRIES PROCESSED WAS:
AIX -------------------0
ALIAS -----------------0
CLUSTER ---------------1
DATA ------------------1
GDG -------------------0
INDEX -----------------1
NONVSAM ---------------0
PAGESPACE -------------0
PATH ------------------0
SPACE -----------------0
USERCATALOG -----------0
TAPELIBRARY -----------0
TAPEVOLUME ------------0
TOTAL -----------------3
0 THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0

Thanks!
Last edited by MSURESH309 on Wed Sep 14, 2011 12:14 pm, edited 1 time in total.
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 12:13 pm

if You had used the code tags the data posted would have been easier to read !
and as far as the file content it would have been wiser to post also the hex representation of it
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: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: VSAM Error Code 04 - Read

Postby MSURESH309 » Wed Sep 14, 2011 12:25 pm

Actually I just ran IDCAMS..to get the LIST CAT details..so did copy pasted the output messages..

Here is the hex format of the data..

111111ABCD LT10Y65 2011-04-212011-04-30 EM
FFFFFFCDEC0101 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0090000900CD
11111193330C0C 0001000100033310865000000201100402120110040300000C0000C54
------------------------------------------------------------------------
111111ABCD LT10Y65 2011-05-012011-05-31 EM
FFFFFFCDEC0102 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0010000100CD
11111193330C0C 0001000100033310865000000201100500120110050310120C0120C54
------------------------------------------------------------------------
111111ABCD LT10Y65 2011-06-012011-06-30 EM
FFFFFFCDEC0103 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0010000100CD
11111193330C0C 0001000100033310865000000201100600120110060300100C0100C54
------------------------------------------------------------------------
111111ABCD < LT10Y65 2011-07-012011-07-15 j j EM
FFFFFFCDEC0104 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0090000900CD
11111193330C0C 0001000100033310865000000201100700120110070150010C0010C54
------------------------------------------------------------------------
222222ABCD < LT10Y65 2011-07-012011-07-31 EM
FFFFFFCDEC0104 000000000006DEFFEFF444444FFFF6FF6FFFFFF6FF6FF0030000300CD
22222293330C0C 0001000100033310865000000201100700120110070310400C0400C54
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 BillyBoyo » Wed Sep 14, 2011 12:46 pm

Edit: line removed.

Can you post your JCL, the messages from the job, and the area of the code around the read which is getting the 04 please.

While trying to post this, I saw the data you have posted. You cut the records down, presumably?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post