View previous topic :: View next topic
|
Author |
Message |
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
Hi,
Please help me out in getting an answer on this.
I have two sequential file which has got 10 records and is FB with a LRECL of 400 and BLKSIZE of 27600.
Now using IEBGENER I am creating a third file which is again a FB with a LRECL of 500 and BLKSIZE of 5000.
What I understand as the definition of LRECL and BLKSZE, as per the DCB parameters of LRECL=500 and BLKSZE=5000 my file should be divided in to 10 partitions(for just 10 records) each with an LRECL of 500.
But Surprisingly in my third file I am getting all the 20 Records from the two input files. I am not able to understand how LRECL and BLKSZE works.
Please provide me some help on this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Is this an interview question or is this something you are working with on a machine?
Please post the jcl and the input as well as what you want as output (so we would see 3 sets of data - 2 in and 1 out.
I am not at all sure what "partitions" refers to |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
This is'nt actually an interview Question but somethin that struck me when I was doing a simple IEBGENER operation, the JCL for whom is ...
//@8888G3 JOB (00000-00521109-001-24-238S),
// 'IEBGENER Job',
// CLASS=X,
// MSGCLASS=S,
// NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=File1
// DD DISP=SHR,DSN=File2
//SYSUT2 DD DSN=File3,
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=5000),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,0),
// UNIT=SYSDA
//SYSIN DD DUMMY
File1 and File2 have 10 records each and following are the Properties of File1 and File2
Dsorg Recfm Lrecl Blksz
--------------------------
PS FB 400 27600
And "partitions" is not the correct technical term but I just wanted to ask that If I Specify a BLKSIZE of 5000 and a LRECL of 500(Like I did in
O/P file File3) does that not mean that I can only have 10 Records(Partitions) in that file each with an LRECL of 50.
But here in my JCL I get an RC of 0 and all the 20 Records in my output file File3.
So I guess I do not understand the concept of LRECL and BLKSIZE Correctly.
Hope am able to explain the problem well enough.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
When you copy files with IEBGENER, each input record is written to the output file. If you were to get anything other than all of the records, that would be an error.
LRECL is logical record length and this is the unit of transfer from the i/o method to a program. If you define a file as fixed length with an lrecl of 100, your COBOL program (for example) will transfer 100 bytes from the read into your variables for precessing.
BLKSIZE is the physical record length. For fixed length records, blksize must be a multiple of lrecl. When your program issues a READ, the i/o routine passes the next logical record from the "buffer" into your program. When the i/o is issued, the system reads and writes physical records (blocks) - which is why overhead is greatly reduced when records are blocked well.
We're here if there are questions. |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
Thank you so much Dick for the valuable Information n still some query:- Say If a create a fixed Length file with an LRECL of 100 and a BLKSIZE of 1000, How many records can I have in this File. and I could'nt quite get the statement you specified :-
Quote: |
When your program issues a READ, the i/o routine passes the next logical record from the "buffer" into your program. When the i/o is issued, the system reads and writes physical records (blocks). |
Thanks Again Dick. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
geek_mohit wrote: |
Thank you so much Dick for the valuable Information n still some query:- Say If a create a fixed Length file with an LRECL of 100 and a BLKSIZE of 1000, How many records can I have in this File. and I could'nt quite get the statement you specified :-
Quote: |
When your program issues a READ, the i/o routine passes the next logical record from the "buffer" into your program. When the i/o is issued, the system reads and writes physical records (blocks). |
Thanks Again Dick. |
That would depend on the amount of space allocated to the file. If there is enough space allocated the system will write as many blocks as are required. |
|
Back to top |
|
|
haikiran
New User
Joined: 08 May 2007 Posts: 4 Location: hyderabad
|
|
|
|
I guess the output file can take as many records till all its space(tracks/cylinders) is full. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
do a 3.4 on your output file and report back what the "Dsorg Recfm Lrecl Blksz" is for it. |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
Hi William,
I did a 3.4 on the file I have got created and following are the stats:-
Dsorg Recfm Lrecl Blksz
----------------------------
PS FB 500 5000
Thanks. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
So you got what you wanted, all 20 records increased in size from 400 to 500 bytes in length and instead of 69 records per block, you limited it to 10 records per block. Where before you had 2 partially filled blocks, now you have 2 full blocks. |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
I Guess I got my answer, Thank you so much William,Dick and all others.
Really Appreciate the Prompt replies.
Thanks Again. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
As others have mentioned, lrecl/blksize are not what determines how many records you can write into a file. If you are writing output records, the system will "block" the output, placing as many logical records (record) in each physical record (block) as will fit in a block.
If the file is being written on disk, you can continue to write blocks until you run out of space.
If you know how much space you are permitted to use (i.e. how many cyls or trks), you can calculate how many of your records will fit into that space. To perform that calculatioin, you need to know what device type you are using or emulating. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I noticed that your space allocation for the output file was (TRK,0) - very interesting.
The fact that the job worked rather than failed leads me to believe that you have a space abend intercept product installed at your shop, which intercepts an Sx37 condition and allocates/increases a secondary space allocation.
OK, question 1 - why SPACE=(TRK,0) I am really intrigued by this one
Question2 - My high horse subject -
Code: |
//SYSUT2 DD DSN=File3,
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=5000),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,0),
// UNIT=SYSDA
|
Why code DCB= ? the RECFM and LRECL parameters are parameters in their own right and do not need to be included within DCB=(.........)
You have coded a BLKSIZE parameter - why, because the system will automatically allocate the best BLKSIZE for any file when you omit the BLKSIZE parameter, unless there is a software dependancy on a specified BLKSIZE. Save space and I/O operations by allowing the system to determine the best BLKSIZE.
DO NOT SPECIFY BLKSIZE=0
UNIT=SYSDA - if your DFSMSsms environment is set up correctly the fact that you have specified SPACE= would direct the allocation to a DASD device by default. |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
Hi Expat,
Yes It really is strange SPACE=(TRK,0) and I could not understand how it works, I was more keen on knowing about the concept of BLKSIZE and LRECL. The Space Abend Intercept Product,even that's somethin unheard of for me, may I know a way by which I could check wether or not I have some such product installed in my shop.
And yes I do Know that BLKSIZE is something the system takes care of automatically and that is something which is recommended as well because that's the most Optimum way but this is how jobs are setup in our shop and we are asked not to fiddel around with those oldies but anyways It helped me learn alot about the LRECL and BLKSIZE.
If you could provide some information on SPACE=(TRK,0). Like how this works.
Thanks to all you Experts. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
One way to check if your system is running an out-of-space intercept would be to set up jcl naming a sequential input file and copy it to a file defined with only 1 track. If you have no intercept program you will get an x37 abend. If you have an intercept program, you should see something in the sysout that says the abend was intercepted.
You might also ask your storage management or system support people as they should know. |
|
Back to top |
|
|
geek_mohit
New User
Joined: 19 May 2006 Posts: 23
|
|
|
|
Got it...Dick but the Other thing I see at my shop is that even if I specify the SPACE parameter as (TRK,5) in my JCL for a new file, When I go ahead and check the properties of that file. It shows me 1 under TRKS.
Is that also due to some default system settings or is there something else to it.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It appears that your system is automatically releasing unused space when the output file is closed. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
As Dick has pointed out, this is usually down to the DFSMSsms settings in place at your shop. |
|
Back to top |
|
|
|