IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Virtual Storage Access method - ESDS, KSDS, RRDS & LDS. Basic direct access method, Basic sequential -, Queued sequential -, Basic partitioned -, Indexed sequential -, Object - access method.
Previous topicNext topic

Topic Author
Kapil Sharma
Registered Member
Posts: 30
Joined: Sun Sep 29, 2013 1:46 am
Location: India

IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Post by Kapil Sharma » Wed Jul 05, 2017 5:29 pm

Hi,

I'm using the simple IDCAMS REPRO JCL as shown below:

Code: Select all

//*                                                           
//STEP001  EXEC  PGM=IDCAMS                                   
//SYSPRINT DD  SYSOUT=*                                       
//INP      DD  DSN=HLQ.V.ITST.ORLMTF,DISP=SHR              
//*                                                           
//OUT      DD  DSN=HLQ1.ORLMTF.COPY,                        
//             DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,            
//             SPACE=(CYL,(3,4),RLSE)                
//SYSIN    DD  *                                              
  REPRO INFILE(INP) OUTFILE(OUT)                              
/*                                                            
but it's failing with the following error:

Code: Select all

********************************* TOP OF DATA **********************************
IDCAMS  SYSTEM SERVICES                                           TIME: 02:40:56
                                                                                
  REPRO INFILE(INP) OUTFILE(OUT)                                        00140000
IDC3300I  ERROR OPENING HLQ1.ORLMTF.COPY                                      
IDC3321I ** OPEN/CLOSE/EOV ABEND EXIT TAKEN                                     
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0                                      
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12                              
                                                                                
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12              
******************************** BOTTOM OF DATA ********************************
Have looked at the description of the message IDC3300I and then added the DCB parameters in the JCL like this:

Code: Select all

//*                                                           
//STEP001  EXEC  PGM=IDCAMS                                   
//SYSPRINT DD  SYSOUT=*                                       
//INP      DD  DSN=HLQ.V.ITST.ORLMTF,DISP=SHR              
//*                                                           
//OUT      DD  DSN=HLQ1.ORLMTF.COPY,                        
//             DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,            
//             SPACE=(CYL,(3,4),RLSE),BLKSIZE=8184,LRECL=8184,
//             RECFM=F                                        
//SYSIN    DD  *                                              
  REPRO INFILE(INP) OUTFILE(OUT)                              
/*                                                            
after running a SORT to see the values of DCB:

Code: Select all

WER108I  SORTIN   : RECFM=F    ; LRECL=  8184; CISIZE =  8192 
WER073I  SORTIN   : DSNAME=MISRZD.V.ITST.ORLMTF               
WER110I  SORTOUT  : RECFM=FB   ; LRECL=  8184; BLKSIZE=  8184 
but it fails again like this:

Code: Select all

********************************* TOP OF DATA **********************************
IDCAMS  SYSTEM SERVICES                                           TIME: 04:39:42
                                                                                
  REPRO INFILE(INP) OUTFILE(OUT)                                        00140000
IDC3302I  ACTION ERROR ON HLQ1.ORLMTF.COPY                                    
IDC3309I ** RECORD X'4040404040' NOT WRITTEN.  LENGTH INVALID                   
IDC3302I  ACTION ERROR ON MISAD2.ORLMTF.COPY                                    
IDC3309I ** RECORD X'C1E3F2F8E4' NOT WRITTEN.  LENGTH INVALID                   
IDC3302I  ACTION ERROR ON MISAD2.ORLMTF.COPY                                    
IDC3309I ** RECORD X'C1E3F2F8E4' NOT WRITTEN.  LENGTH INVALID                   
IDC3302I  ACTION ERROR ON MISAD2.ORLMTF.COPY                                    
IDC3309I ** RECORD X'C1E3F4F4E4' NOT WRITTEN.  LENGTH INVALID                   
IDC31467I MAXIMUM ERROR LIMIT REACHED.                                          
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0                                      
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12                              
                                                                                
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12              
Could you please help why this happens?


Thanks,
Kapil

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1331
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Post by Robert Sample » Wed Jul 05, 2017 6:06 pm

The manual tells you the possible reasons:
IDC3309I ** RECORD xxx NOT WRITTEN. LENGTH INVALID.
Explanation
The specified record was not written for one of the following reasons:

The record length was greater than the LRECL of the output data set (logical processing).
The record length was less than the LRECL of the output data set and output RECFM=FIXED, or output is a relative record data set.
The control-interval length to be written did not equal the control interval size for the output data set.
The record length was less than the minimum output LRECL allowed (input LRECL + 4) when RECFM=F and output is to a subsystem device.
It is up to you to figure out which of these reasons applies in your case. One of them does apply, guaranteed.



User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1331
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Post by Robert Sample » Thu Jul 06, 2017 2:22 am

Update: you apparently have a VSAM input data set. In case you are not aware, VSAM data sets are not required to have record lengths of 8184 EVEN IF THE DEFINITION HAS RECORDSIZE(8184 8184) SPECIFIED. So I'd look at the VSAM data set first to see how long the records actually are (less than 8184 bytes is my guess). Which gives you a simple fix -- use RECFM=VB,LRECL=8188,BLKSIZE=27998 on your output data set. And download / read the Redbook VSAM Demystified from http://www.redbooks.ibm.com to learn more about VSAM.




Topic Author
Kapil Sharma
Registered Member
Posts: 30
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Post by Kapil Sharma » Thu Jul 06, 2017 4:30 pm

This "RECFM=VB,LRECL=8188,BLKSIZE=27998" worked, Thanks.
VSAM data sets are not required to have record lengths of 8184 EVEN IF THE DEFINITION HAS RECORDSIZE(8184 8184) SPECIFIED

What does it mean? I mean it can be less, but if omit the DCB parameters altogether, it should have worked but it didnot.


Thanks,
Kapil

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1331
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: IDC3309I ** RECORD X'4040404040' NOT WRITTEN. LENGTH INVALID.

Post by Robert Sample » Thu Jul 06, 2017 6:10 pm

What does it mean? I mean it can be less, but if omit the DCB parameters altogether, it should have worked but it didnot.
It means that your copy worked with a variable blocked output data set but not with fixed length records. Your VSAM records are not all 8184 bytes long.

WHY do you think that you can omit the DCB parameters and have the copy work? LRECL and BLKSIZE can be defaulted in some cases depending upon your site and its settings and whether or not you are creating SMS data sets, but you should ALWAYS specify RECFM,LRECL,BLKSIZE for every output data set you create as the defaults may be wrong for your data. Your first copy failed because you did not give the DCB parameters for your output data set so the system did not have values for them (it will NOT copy the input data set values unless you explicitly tell the system to do so). Your second copy failed because you told the system the output data set had fixed length records yet the VSAM data set you copied from did NOT have fixed length records.



Previous topicNext topic

Return to “SMS & VSAM and BDAM, BSAM, QSAM, BPAM, ISAM, OAM.”