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
 

 

Length Invalid Error while copying KSDS to PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Length Invalid Error while copying KSDS to PS file
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    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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: 8593
Location: Back in jolly old England

PostPosted: Mon May 18, 2009 5:37 pm    Post subject:
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    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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    Post subject:
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    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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: 8593
Location: Back in jolly old England

PostPosted: Mon May 18, 2009 7:16 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon May 18, 2009 11:54 pm    Post subject:
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

Senior Member


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

PostPosted: Tue May 19, 2009 12:25 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue May 19, 2009 3:09 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue May 19, 2009 3:25 pm    Post subject:
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

Site Director


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

PostPosted: Tue May 19, 2009 8:45 pm    Post subject: Reply to: Length Invalid Error while copying KSDS to PS file
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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