View previous topic :: View next topic
|
Author |
Message |
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
hi
I have a fix length file which lrec=710 and contains 7100000 characters.(10000 records)
this file take 9 cylinders on the disk.
I change this file to a variable length file which maximum lrec=904.
while transferring fb file to vb file I count the characters that writed on the vb file,
the result is 2700000 characters (that meaning 1/3 instead of fb file).
but vb file takes 88 cylinders on the disk.
(block size that I used for vb file in JCL is 912)
please help me! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why don't you let the system decide the blocksize?
If this is not possible, try to make it a little bigger. Like 27998. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
My guess is that you have half-track blocking on the fixed length data set. The number of records per track (hence cylinder) is determined by the block size. And a block size of 912 bytes will NOT allow very many records per track (cylinder), as you have discovered. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi bill
please tell me that how allow the system to decide about block size?
thank you for your attention! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Either omit the BLKSIZE parameter altogether or code it BLKSIZE=0. Refer to the JCL manual. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi Nic
I try this but not respond.
can you tell that how define block size in vb file definition? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Are you defining the data set through TSO, or via a batch job, or some other way? |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi Robert
Date set is defining by tso administrator
he said that the blocksize of dataset(variable length file) not Specified while definition. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hello,
Could you issue a "I" or "S" command, infront of the input & output dataset and post the output here. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi vasanthz |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
You/Your colleague got what You asked for ...
recfm V is not the same as recfm VB |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi enrico
I used recfm=vb in the JCL
when I use "recoirding mode is vb" I got system error |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
my comment was based on the screen shot You posted ...
the dataset is allocated as V
and as per manual the block size is 4 bytes more than the record length.
my cobolese sucks
but I do not remember a VB recording mode,
all that cobol cares IIRC is about FIXED or VARIABLE |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
For COBOL the blocksize is separate, you'd be best to code the block as zero in the COBOL program so that the blocksize itself will be taken from the JCL if explicitly present or from the catalogue otherwise.
Hardcoding blocksizes in a COBOL program is a bad idea. Not coding a blocksize is also a bad idea, as you will only get one record per block. Oh, that's what you have.
Have a look through this for instance. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What you are seeing is what is expected -- you had close to half-track blocking on the fixed length data set, and unblocked records on the variable length data set, hence the used cylinders went from 9 to 88. Unblocked data takes more space than blocked data -- which is why blocked records are so popular. Your COBOL code does not indicate anything about blocks, hence the unblocked data. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Hi Robert
Can you give me a complete sample of cobol program contains a creation of vb file (with block size&...)
Thanks a lot. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I don't have any complete programs immediately available that create VB files in COBOL. However, you can read the Enterprise COBOL manuals for the details. The key points are that you must indicate to COBOL that the file is variable and blocked (variable by using multiple 01 levels in the FD with different record lengths, or using OCCURS DEPENDING ON in the FD 01, or specifying the range of characters the record may contain through RECORD CONTAINS; and blocked by used BLOCK CONTAINS 0 RECORDS -- which is the preferred coding since it causes the system to go to the JCL to get the actual block size, and it does not limit your code to so many records per block). |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Here's a result of a simple use of the Search button at the top of the page.
You will be able to find other posts in the same way, showing the different methods Robert described. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
1- maximum record length in vb file that I used is 904
It means that lrec must be 908
I use "block contains 0 records" in FD and run the program
when I issue S command On vb file the block size of file 912
2- next time , in jcl I set blksize=27998 and remove "block conains 0 records" in FD, and run the program.when I issue S command on vb file the block size of file still remain 912!?
what is the reason? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you remove the BLOCK CONTAINS 0, you get the default BLOCK CONTAINS 1. It's that simple, and you've already been told this.
The BLOCK CONTAINS 0 will get you the BLKSIZE from the JCL if present (if you don't specify it, there's a very large chance your system will provided it, accurately, for you).
Specify BLOCK CONTAINS 0 in your program. Take the BLKSIZE out of your JCL. If your file is pre-defined, re-define. |
|
Back to top |
|
|
Ebirezaey
New User
Joined: 31 Aug 2014 Posts: 10 Location: iran
|
|
|
|
Thanks
the problem solved |
|
Back to top |
|
|
|