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
 

 

Doubt About LRECL and BLKSIZE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Mon Jun 11, 2007 6:00 pm    Post subject: Doubt About LRECL and BLKSIZE
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Mon Jun 11, 2007 6:17 pm    Post subject:
Reply with quote

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 icon_confused.gif
Back to top
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Mon Jun 11, 2007 9:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jun 11, 2007 10:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Mon Jun 11, 2007 10:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 11, 2007 11:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
haikiran

New User


Joined: 08 May 2007
Posts: 4
Location: hyderabad

PostPosted: Mon Jun 11, 2007 11:17 pm    Post subject: Re: Doubt About LRECL and BLKSIZE
Reply with quote

I guess the output file can take as many records till all its space(tracks/cylinders) is full.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 11:19 pm    Post subject:
Reply with quote

do a 3.4 on your output file and report back what the "Dsorg Recfm Lrecl Blksz" is for it.
Back to top
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Mon Jun 11, 2007 11:28 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 11:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Mon Jun 11, 2007 11:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jun 11, 2007 11:57 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 12, 2007 12:00 am    Post subject:
Reply with quote

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
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Tue Jun 12, 2007 10:10 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Tue Jun 12, 2007 5:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Tue Jun 12, 2007 10:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Jun 13, 2007 12:43 am    Post subject:
Reply with quote

Hello,

It appears that your system is automatically releasing unused space when the output file is closed.
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: Wed Jun 13, 2007 1:35 am    Post subject:
Reply with quote

As Dick has pointed out, this is usually down to the DFSMSsms settings in place at your shop.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts SORT Format should be RECFM=VB,LRECL=350 senthamizh SYNCSORT 8 Fri Jan 15, 2016 8:20 pm
No new posts Concatenate different LRECL GDG's Rohit Umarjikar DFSORT/ICETOOL 6 Wed Nov 18, 2015 3:30 am


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