MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VSAM Logical Record length error. - Fileaid

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Aug 31, 2004 1:02 pm    Post subject: Reply with quote

Ravi,

From the error messages , it is evident that the KEYLEN of the output dataset is only 15 bytes where as the input KSDS has a length of 25.

So there is a likely chance that the records are out of sequence. This is true on 689th record.

Either change the keylen on output file or add a sort step earlier to sort the vsam file on the first 15 bytes and create a flat file with it and then repro back that flat file to load the vsam cluster

Hope this helps...

cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Aug 31, 2004 1:30 pm    Post subject: Reply with quote

Ravi,

A couple of clarifications.

1. your input vsam file is having an LRECL of 210 and output vsam file is having an LRECL of 200 only.

So which 10 bytes are you gonna chop off? Is it the beginning 10 or at the end? or somewhere in the middle?

2.what bytes of the input file do you want to form the key as the key for the output vsam file? is it the first 15 bytes of the input vsam file?

3. Also is the Output vsam file empty? if it is not do you want to replace the data or append to the existing data?

Let me know and you can use sort to get the desired results.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Aug 31, 2004 1:56 pm    Post subject: Reply with quote

Ravi,

Try this jcl for loading the vsam file

Code:

//STEP0100 EXEC PGM=SYNCTOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN       DD DSN=USERID.INFILE.KSDS,
//            DISP=SHR
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT      DD DSN=USERID.OUTFILE.KSDS,
//            DISP=OLD
//TOOLIN   DD *
  SORT FROM(IN) TO(T1) USING(CTL1)
  COPY FROM(T1) TO(OUT)
//CTL1CNTL DD *
  SORT FIELDS=(11,15,CH,A)
  SUM FIELDS=NONE
  OUTREC FIELDS=(11,200)
/*


Quote:

With out hardcoding the output length as 250 in OUTREC=can't we use 0 instead.
like MV=(1,0,11) in fileaid. Because I want to use the same control card to copy few more files with different LRECL but the same 10 bytes strip irrespective of the keylength.


Then you would need another step as sort cannot really process without hard-coding the length unless it is a variable block file.

Code:

//STEP0100  EXEC PGM=FILEAID,COND=(8,LT)
//SYSPRINT DD SYSOUT=*
//DD01     DD DSN=USERID.INFILE.KSDS,DISP=SHR
//DD01O    DD DSN=TEMP FLAT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
$$DD01 COPY MV=(1,0,11)
/*
//STEP0200 EXEC PGM=SYNCTOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN       DD DSN=TEMP FLAT FILE,
//            DISP=SHR
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT      DD DSN=USERID.OUTFILE.KSDS,
//            DISP=OLD
//TOOLIN   DD *
  SORT FROM(IN) TO(T1) USING(CTL1)
  COPY FROM(T1) TO(OUT)
//CTL1CNTL DD *
  SORT FIELDS=(11,15,CH,A)
  SUM FIELDS=NONE
/*


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Aug 31, 2004 2:57 pm    Post subject: Reply with quote

Ravi,

Didn't you get an out of sequence error as your SELECT statement is looking in bytes 1 thru 15, where as your key is actually from 11 thru 15 bytes?

Even though above control cards worked , I wouldn't suggest using them.You don't need a SAVE parm in the control cards. Come to think of it you don't even need a COPY and a SELECT

If you have the latest version of syncsort (which you don't have) you can use USING along with SELECT parm.

ex:
Code:

//TOOLIN DD *
 SELECT FROM(IN) TO(OUT) ON(11,15,CH) FIRST
//CTL1CNTL DD *
 OUTFIL FNAMES=OUT,OUTREC=(11,200)
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Aug 31, 2004 3:27 pm    Post subject: Reply with quote

Ravi,

You are getting that error because the file is not 'initialized'. But sort can handle empty vsam files also.The parm VSAMEMT will allow you to process even if it is empty. So add this statement to your job

Code:
 

//DFSPARM  DD *         
  VSAMEMT=YES             

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group