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

No. of Bytes that a block occupies


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Thu Sep 02, 2010 12:38 pm
Reply with quote

Hi,

I need to calculate the space occupied by a file in terms of number of BYTES. suppose SPACE parameter coded in the JCL is SPACE=(250,(10,10),RLSE). Here 250 is the number of BLOCKs that will be allocated to the file after creation(if i am not wrong). I know the formula to get the number of bytes allocated if space is specified in terms of TRKs or CYLs. but i don't know the number of bytes that a block can contain. Can anybody please help me regarding this? i will be very thankful.

Warm regards,
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Sep 02, 2010 1:03 pm
Reply with quote

Why do you not know the BLKSIZE
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Thu Sep 02, 2010 1:24 pm
Reply with quote

BLKSIZE is not specified in the JCL. I did some googling and come to know that when First quantity is equal to the LRECL(here 250), system will decide the most optimum BLKSIZE.
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Thu Sep 02, 2010 1:34 pm
Reply with quote

Expat,

If we know the BLKSIZE, then is there any formula to get number of bytes? I thought of taking the BLKSIZE from catalog information after file creation.

In my case for above space parameter(SPACE=(250,(10,10),RLSE)), BLKSIZE is 27750(I checked the catlog information for the desired file).
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Sep 02, 2010 1:41 pm
Reply with quote

If you know the BLKSIZE and the number of blocks used, then the result would be the product of the two.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 02, 2010 3:20 pm
Reply with quote

Quote:
Here 250 is the number of BLOCKs that will be allocated to the file after creation(if i am not wrong).
Actually, you ARE wrong. From the JCL Language Reference manual (link at the top of the page), section 12.60.1:
Code:
   SPACE= ({TRK,}(primary-qty[,second-qty][,directory])[,RLSE][,CONTIG][,ROUND])
          ({CYL,}            [,          ]             [,    ][,MXIG  ]         
          ({blklgth,}                                         [,ALX   ]         
          ({reclgth,}                                         [,      ]         
                                                                                 

You're probably getting 27750 from SMS -- but the 250 will never represent the number of blocks.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Sep 02, 2010 7:25 pm
Reply with quote

GaganGarg wrote:
BLKSIZE is not specified in the JCL. I did some googling and come to know that when First quantity is equal to the LRECL(here 250), system will decide the most optimum BLKSIZE.
Do you have some reference document for this, please.
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Thu Sep 02, 2010 7:38 pm
Reply with quote

I found it while googling that system will decide the otimal blocksize if not specified in the JCL but certain conditions must be met. Here i am pasting a link. still this tab was opened in my PC so got it easily:

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.idad400/sys.htm

Thanks
Gagan
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Sep 02, 2010 7:51 pm
Reply with quote

Try THIS LINK

Note that the first number only represents a RECORD length if an AVGREC parameter is ALSO coded AND SMS is active, otherwise it represents a BLOCK length.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Sep 02, 2010 8:07 pm
Reply with quote

GaganGarg wrote:
I found it while googling that system will decide the otimal blocksize if not specified in the JCL but certain conditions must be met. Here i am pasting a link. still this tab was opened in my PC so got it easily:

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.idad400/sys.htm

Thanks
Gagan
Thanks but I could not figure that out what you have told. However I tried this:

Quote:
//STEP0010 EXEC PGM=IEFBR14
//DD1 DD DSN=HLQ.LLQ.INP80,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(10,(10,10),RLSE),
// DCB=(LRECL=80,RECFM=FB)
//*
and this
Quote:
//STEP0010 EXEC PGM=IEFBR14
//DD1 DD DSN=HLQ.LLQ.INP10,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(10,(10,10),RLSE),
// DCB=(LRECL=10,RECFM=FB)
//*
Both the times BLKSIZE was same:
Quote:
Data class . . . . . : DEFAULT
Organization . . . : PS
Record format . . . : FB
Record length . . . : 80
Block size . . . . : 27920

1st extent blocks . : 2
Secondary blocks . : 10
and
Quote:
Data class . . . . . : DEFAULT
Organization . . . : PS
Record format . . . : FB
Record length . . . : 10
Block size . . . . : 27920

1st extent blocks . : 2
Secondary blocks . : 10
icon_sad.gif icon_confused.gif
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Thu Sep 02, 2010 8:14 pm
Reply with quote

Perhaps system is deciding the most optimal block size icon_smile.gif but don't know the reason why it comes same for the different LRCLs icon_sad.gif
I saw number of jcls in our production libraries, and most of the time, blocksize is not specified while creating the files (when first argument is SPACE parameter is equal to LRECL) icon_sad.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Sep 02, 2010 8:20 pm
Reply with quote

Quote:
blocksize is not specified while creating the files (when first argument is SPACE parameter is equal to LRECL)
you seem to get a false impression. It might be just a coincidence. In the IEFBR14 steps I showed, I've not used any BLKSIZE. Usually, I code LRECL and RECFM and leave BLKSIZE on system to determine. And if there is a pressing need to code BLKSIZE I use BLKSIZE=0. So that system decides what is the optimum and it's, anyways, 0 till the file is not written to.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
No new posts Try to understand IMS control block IMS DB/DC 0
No new posts total number of bytes PL/I & Assembler 10
No new posts DB2 Block insert (-803 Error Handling) COBOL Programming 5
No new posts ICE039A H INSUFFICIENT MAIN STORAGE -... DFSORT/ICETOOL 3
Search our Forums:

Back to Top