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

INVALID LENGTH while copying a VSAM dataset to a flat file


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

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Fri Oct 14, 2011 12:07 pm
Reply with quote

I had a KSDS of file length 650.I need to increase the file length to 653.I backed up the 650 length data using IDCAMS repro onto a flat file 1(file length 650).I deleted and defined the VSAM with 653 length(nothing changed except the file length) and successfully reloaded the data from flat file 1.
Later when I tried to using the same job (IDCAMS repro used for flat file 1) to back up the 653 length data onto a flat file 2(increased file length to 653 this time),it throws an error INVALID LENGTH and abends with RC=12.
Need to mention that the last 16 characters of the VSAM 653 length has low values.Also to mention when I tried copying the VSAM to flat file using fileaid it worked.But I just have to use the same IDCAMS job for my requirement.

Can someone pls help?Pls let me know if you need additional details
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Fri Oct 14, 2011 12:14 pm
Reply with quote

Can you please post the JCL here?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Oct 14, 2011 12:14 pm
Reply with quote

duh, what is the JCL (include control cards) for the IDCAMS repro step?
also include DCB info for the flat file.

what you are saying does not make any sense,
as long as the DCB for the qsam file used in the VSAM to QSAM repro of the new VSAM file is 653.

sounds as if you are attempting to VSAM (653) to QSAM (650),
which obviously will not work.
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Fri Oct 14, 2011 12:42 pm
Reply with quote

Here is the JCL--
Code:
//SS000100 EXEC PGM=CHECKCC,PARM='PGMA=IDCAMS,ABEND=0001'
//INFILE DD DSN=A.B.C,DISP=SHR
//OUTFILE DD DSN=A.B.C.BKP(+1),
//               DISP=(,CATLG,DELETE),SPACE=(CYL(100,100),RLSE),
//               DCB=(RECFM=FB,BLKSIZE=0,LRECL=653)
//SYSIN DD
   REPRO INFILE(INFILE) OUTFILE(OUTFILE)
/*

ACTION ERROR ON A.B.C.BKP.G00001V00
***RECORD X'F0F3F3F3F0' NOT WRITTEN. LENGTH INVALID

ACTION ERROR ON A.B.C.BKP.G00001V00
***RECORD X'F0F3F3F3F0' NOT WRITTEN. LENGTH INVALID
MAXIMUM ERROR LIMIT REACHED
NUMBER OF RECORDS PROCESSED WAS 1
FUNCTION TERMINATED.CONDITION CODE IS 12
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 14, 2011 12:58 pm
Reply with quote

and abends with RC=12
Does it really ABEND with RC 12

As an aside, when using REPRO I will just use RECFM=VB, LRECL=27994 for DASD output and LRECL 32756 for tape output and in over 30 years have NEVER encountered a problem with either REPRO or EXPORT.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Oct 14, 2011 1:14 pm
Reply with quote

weird but correct behavior
VSAM by default does not know about fixed records VSAM <things> are variable by architecture
and the way it treats fixed length records is murky at least

let' s say that IDCAMS check things backwards ..
whatever the VSAM definition IDCAMS will check the <vsam> record length against the record length of the output DCB
and in case of mismatch ir will behave as seen

the fact that You somehow see at the end of the records hex zeroes
depends on the tool You use to <browse> the thing

You <reloaded> the KSDS with old records and VSAM was happy with it
but ( because of the architecture assumption )
THE RECORDS WERE STILL THE OLD LENGTH

so the reason for my first statement

checked with a different record length but the same logic
and the behavior is according to my explanation of the vsam architecture
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Oct 14, 2011 1:28 pm
Reply with quote

I date to sy that about 80% of people dealing with vsam are incompetent morons

why keep bullshitting about vsam fixed length records
they should be forced to hand write a few thousands times (*)
VSAM RECORD ARE VARIABLE LENGTH
...
VSAM RECORD ARE VARIABLE LENGTH
until they understand and amend

and all that in calligraphy

peeve of mine
saying good/nice calligraphy instead of good/nice writing
is just like saying ( and always happens ) personal PIN icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Oct 14, 2011 2:24 pm
Reply with quote

and anyway if You had cared to look at the IDC3309I message in the manuals
You would have found ...
Quote:
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.


since You reloaded the vsam with the old records You should not have expected anything different
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 14, 2011 4:32 pm
Reply with quote

aneeta,

If you use SORT to unload your original to the PS. Then SORT to read the PS and extend the records by three bytes, initialised to binary zeros if you like, and write to your newly-redefined VSAM KSDS you might get the results you want.

enrico, I'd say high-90s for people who use VSAM but don't really know how to use it (effectively). % of freespace for CI less than size of most common record length is one of many enjoyable ones - worse than no freespace at all :-)

all, There's all that stuff you get when you do a LISTCAT. If you want to put VSAM on your CV make sure you know what a lot of that means. People seem to put VSAM on a CV because they've written a program with a VSAM file. Why not QSAM etc? I have a question I've used in interviews, I might post it in the appropriate forum later.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Oct 14, 2011 5:18 pm
Reply with quote

I know the answer to that question already: "I do not know but the answer is in the manual and I DO know how to read!"
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 14, 2011 5:36 pm
Reply with quote

Well, you'd get something marked as "positive" for that, Nic, but I'd want more from someone who has put "VSAM" on his CV :-)

A caveat on the "something positive" - If you were too glib in the initial response I'd ask "which manual", otherwise I'd ask you whereabouts in the manual would be most likely to help :-)

You'd score nothing for saying "the VSAM manual", I'd give something for "the index".
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Sat Oct 15, 2011 1:01 am
Reply with quote

i initialised the last 3 characters in the 653 flat file2 and loaded the VSAM and it worked.

Thanks for the help and advice.
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top