IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Length Invalid Error while copying KSDS to PS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NandanPhalak

New User


Joined: 14 Apr 2009
Posts: 14
Location: India

PostPosted: Mon May 18, 2009 5:34 pm
Reply with quote

Hi,

I am getting 'LENGTH INVALID' error while copying a KSDS file to a flat file.

KSDS file has average and maximum length as 20 and I have given the same for PS file. The key in KSDS file is of length 11.

What can be the possible solutions to resolve this?
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 18, 2009 5:37 pm
Reply with quote

Can you please post the JCL that you are using?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon May 18, 2009 5:37 pm
Reply with quote

Post your JCL and the output and someone might be able to tell you.
Back to top
View user's profile Send private message
NandanPhalak

New User


Joined: 14 Apr 2009
Posts: 14
Location: India

PostPosted: Mon May 18, 2009 5:39 pm
Reply with quote

//IDCAMS01 EXEC PGM=IDCAMS
//KSDSFILE DD DSN=AAA.BBB.KSDS,
// DISP=SHR
//BSAMFILE DD DSN=CCC.DDD.BSAM,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(200,(100,100)),AVGREC=K,
// RECFM=FB,LRECL=20
//SYSIN DD *
REPRO INFILE(KSDSFILE) -
OUTFILE(BSAMFILE)
/*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=Z
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 18, 2009 5:41 pm
Reply with quote

Quote:
What can be the possible solutions to resolve this?

insure that the dcb parms for the destination file are accurate.

if you want help, please provide
  • dcb parms for both files
  • JCL used for the copy
  • listcat of ksds file
Back to top
View user's profile Send private message
NandanPhalak

New User


Joined: 14 Apr 2009
Posts: 14
Location: India

PostPosted: Mon May 18, 2009 5:47 pm
Reply with quote

Listcat of KSDS file:
Code:

CLUSTER ------- SCZT.PRISPLN.MAST.KSDS                         
     IN-CAT --- CATALOG.HBC.TEST01                             
     HISTORY                                                   
       DATASET-OWNER-----(NULL)     CREATION--------2009.138   
        RELEASE----------------2     EXPIRATION------0000.000                   
      SMSDATA                                                                   
        STORAGECLASS -------TEST     MANAGEMENTCLASS-STANDARD                   
        DATACLASS ------STANDARD     LBACKUP ---0000.000.0000                   
        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)                   
        LOGSTREAMID-----------------------------(NULL)                         
        RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'                       
        RECOVERY TIMESTAMP GMT-------X'0000000000000000'                       
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                   
      ASSOCIATIONS                                                             
        DATA-----SCZT.PRISPLN.MAST.KSDS.DATA                                   
        INDEX----SCZT.PRISPLN.MAST.KSDS.INDEX                                   
    DATA ------- SCZT.PRISPLN.MAST.KSDS.DATA                                   
      IN-CAT --- CATALOG.HBC.TEST01                                             
      HISTORY                                                                   
        DATASET-OWNER-----(NULL)     CREATION--------2009.138                   
        RELEASE----------------2     EXPIRATION------0000.000                   
        ACCOUNT-INFO-----------------------------------(NULL)                   
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                   
      ASSOCIATIONS                                                             
        CLUSTER--SCZT.PRISPLN.MAST.KSDS                                         
      ATTRIBUTES                                                               
        KEYLEN----------------11     AVGLRECL--------------20     BUFSPACE------
-----50000     CISIZE-------------18432                                         
        RKP--------------------0     MAXLRECL--------------20     EXCPEXIT------
----(NULL)     CI/CA-----------------45                                         
        SHROPTNS(2,3)      SPEED     UNIQUE           NOERASE     INDEXED       
NOWRITECHK     NOIMBED       NOREPLICAT                                         
        UNORDERED          REUSE     NONSPANNED                                 
      STATISTICS                                                               
        REC-TOTAL---------475325     SPLITS-CI--------------0     EXCPS---------
------4638                                                                     
        REC-DELETED---------2012     SPLITS-CA--------------0     EXTENTS-------
---------1                                                                     
        REC-INSERTED-----------1     FREESPACE-%CI---------25     SYSTEM-TIMESTA
MP:                                                                             
        REC-UPDATED------------0     FREESPACE-%CA---------25          X'C433E40
1AE740F80'                                                                     
        REC-RETRIEVED----2860245     FREESPC----------5769216                   
      ALLOCATION                                                               
        SPACE-TYPE------CYLINDER     HI-A-RBA--------16588800                   
      HISTORY                                                                   
        DATASET-OWNER-----(NULL)     CREATION--------2009.138                   
        RELEASE----------------2     EXPIRATION------0000.000                   
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                   
      ASSOCIATIONS                                                             
        CLUSTER--SCZT.PRISPLN.MAST.KSDS                                         
      ATTRIBUTES                                                               
        KEYLEN----------------11     AVGLRECL---------------0     BUFSPACE------
---------0     CISIZE---------------512                                         
        RKP--------------------0     MAXLRECL-------------505     EXCPEXIT------
----(NULL)     CI/CA-----------------49                                         
        SHROPTNS(2,3)   RECOVERY     UNIQUE           NOERASE     NOWRITECHK   
   NOIMBED     NOREPLICAT     UNORDERED                                         
        REUSE                                                                   
      STATISTICS                                                               
        REC-TOTAL-------------19     SPLITS-CI--------------0     EXCPS---------
-------226     INDEX:                                                           
        REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS-------
---------1     LEVELS-----------------2                                         
        REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTA
MP:            ENTRIES/SECT-----------6                                         
        REC-UPDATED------------1     FREESPACE-%CA----------0          X'C433E40
1AE740F80'     SEQ-SET-RBA------------0
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 18, 2009 5:56 pm
Reply with quote

The problem might be with the DCB parameters.

Does your JCL output give 'INVALID LENGTH I/O' error?

Can you please post the JCL messages?
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 18, 2009 6:13 pm
Reply with quote

Also, check this link and try it out:

http://www.ibmmainframes.com/about1746.html

This might help you solve the problem.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon May 18, 2009 7:16 pm
Reply with quote

I have always used RECFM=VB LRECL=maxlrecl+4 for the output in the past with no problems.

Also consider using your SORT product for larger datasets.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon May 18, 2009 11:54 pm
Reply with quote

expat wrote:
Also consider using your SORT product for larger datasets.


Thanks for that comment. Now I don't feel so dumb. I originally posted a request for the OP to show the contents of their SORT SYSOUT DD, since I always assume that everyone uses SORT for this type of activity. Silly me. icon_confused.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 19, 2009 12:25 pm
Reply with quote

Once it happened to me for ESDS then changing RECFM=VB from RECFM=FB was the solution.
Back to top
View user's profile Send private message
NandanPhalak

New User


Joined: 14 Apr 2009
Posts: 14
Location: India

PostPosted: Tue May 19, 2009 2:30 pm
Reply with quote

The error message is like this:

IDCAMS SYSTEM SERVICES

REPRO INFILE(KSDSFILE) -
OUTFILE(BSAMFILE)
IDC3302I ACTION ERROR ON SCZT.PRISPLN.MAST.BSAM.BKUP8
IDC3309I ** RECORD X'C8F0F1F0F0' NOT WRITTEN. LENGTH INVALID
IDC3302I ACTION ERROR ON SCZT.PRISPLN.MAST.BSAM.BKUP8
IDC3309I ** RECORD X'C8F0F1F1F0' NOT WRITTEN. LENGTH INVALID
IDC3302I ACTION ERROR ON SCZT.PRISPLN.MAST.BSAM.BKUP8
IDC3309I ** RECORD X'C8F0F1F1F1' NOT WRITTEN. LENGTH INVALID
IDC3302I ACTION ERROR ON SCZT.PRISPLN.MAST.BSAM.BKUP8
IDC3309I ** RECORD X'C8F0F1F1F2' NOT WRITTEN. LENGTH INVALID
IDC31467I MAXIMUM ERROR LIMIT REACHED.
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
Back to top
View user's profile Send private message
NandanPhalak

New User


Joined: 14 Apr 2009
Posts: 14
Location: India

PostPosted: Tue May 19, 2009 2:36 pm
Reply with quote

I tried solution given by "Expat" but it didn't worked. Still the same error. icon_sad.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 19, 2009 3:09 pm
Reply with quote

Quote:
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.

In the message text:

xxx
The first five bytes of the record in hexadecimal format.

System action:

The system continues processing until four such errors occur, in which case no more records are written to the data set.
Application Programmer Response:

Redefine the output data set with the correct LRECL or control interval size.
System programmer response:

If the error recurs and the program is not in error, look at the messages in the job log for more information. Search problem reporting data bases for a fix for the problem. If no fix exists, contact the IBM Support Center. Provide the JCL and the SYSOUT output for the job.
Source:

DFSMSdfp
Detecting Module:

IDCIO01
The error message indicates you've got a conflict between the record lengths in the KSDS file and the sequential file you're trying to define -- not the defined record length for the KSDS, but the actual record lengths. Since the JCL you posted does not match the data set name in the error messages, there's not much more we can say.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue May 19, 2009 3:25 pm
Reply with quote

NandanPhalak wrote:
I tried solution given by "Expat" but it didn't worked. Still the same error. icon_sad.gif

I have corrected my previous post, changing FB to VB
Apologies for the typo. Please rety with VB
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 19, 2009 8:45 pm
Reply with quote

Hi Expat,

Ummm. . . Ahhhh. . . . icon_redface.gif
Quote:
Apologies for the typo. Please rety with VB
It wasn't your typo. . . I mis-read. . . and changed your original VB to FB believing that was a typo. . . . icon_confused.gif

I'll go quietly now. . .

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top