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
 

 

how to calculate the number of blocks / track

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Thu Nov 13, 2008 10:24 pm    Post subject: how to calculate the number of blocks / track
Reply with quote

Hi all,

When I went through a document I happen to read


I used ISPF 3.2 to allocate a test dataset with LRECL=1, BLKSIZE=1,
RECFM=FB, and space in blocks. After allocating the test dataset, I
checked to see how many blocks it was occupying. Result: 87 blocks. Here
is my calculation.

(MaxBytesPerTrack - MinBlockSize) / MinBlockSize = IBG (56,664 - 87)
/ 87 = 650.31+miscbits


Kindly any of you good can help me how to calculate the number of blocks created for the given logical record length and block size. In another occasion I found the below note

If you used IDCAMS to copy & re-block a badly blocked dataset with
BLKSIZE=80,LRECL=80 with no special JCL coding, you would receive
5 buffers for input and output. There are 77 records per track with
this DCB.

Is there any formula to calculate the number of blocks created for the track? In a above note the block / track is 77.
Could any one please help me?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7906
Location: Bellevue, IA

PostPosted: Fri Nov 14, 2008 12:48 am    Post subject:
Reply with quote

Blocks per track cannot be calculated simply by dividing 56664 by the record size -- a 3390 is a CKD and each block has overhead and a gap to count in. I haven't seen it lately but IBM used to have a chart giving the range of block sizes that would fit a given number of blocks on a track (for example, something to 27998 fits 2 blocks per track).
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Nov 14, 2008 2:57 am    Post subject:
Reply with quote

Hi,

try Quickref 3380 or 3390 and then select either

Quote:
3390 IBM DASD DEVICE INFO. Z/OS V1 & PRIOR
3390 IBM MVS REFERENCE INFO. Z/OS V1 & PRIOR
for 3390 or

Quote:
3380 IBM DASD DEVICE INFO. Z/OS V1 & PRIOR
3380 IBM MVS REFERENCE INFO. Z/OS V1 & PRIOR
for 3380.


Gerry
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Fri Nov 14, 2008 3:06 am    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

Specify a BLKSIZE of zero. The system will figure out the best blocksize.

It is not clear what you are trying to learn. LRECL=1, BLKSIZE=1 is not a real world situation.
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Nov 14, 2008 3:42 am    Post subject:
Reply with quote

Here's a link to a 3390 Capacities booklet. Use the "Without keys" table for normal sequential files.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/am3u1001/B.1.2

Pick a blocksize and see how many fit on a track.
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Fri Nov 14, 2008 1:48 pm    Post subject:
Reply with quote

Hi gcicchet,

Thanking you for your kind reply. The calculation is for 3390. My intent is how to calculate the number of blocks for per track. Is there any formula? Or we can get it from any ISPF screens.

Thanks
Prasannaa S
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 14, 2008 1:55 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

what is not clear in that table...
- in the table record is synonym of block
so for example look at the row starting with 951...

for a block size between 951 and 984 You get a utilization of 60.8% with 35 blocks per track with a capability of 34440 bytes per track
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Fri Nov 14, 2008 3:17 pm    Post subject:
Reply with quote

Hi enrico sorichetti,

Thanking you for your kind comeback. My intention is to how to calculate number of blocks per cylinder. In the referred chart we are able to see only the figures (example; for a block size between 951 and 984 - the number of blocks per cylinder is 35. I want to know how we get the value 35). Kindly help me.

Thanks
Prasannaa S
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 14, 2008 5:00 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

here is the link to the docs and the formulas

the manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/am3u1001/CONTENTS?SHELF=&DT=19930630180527#COVER

the appendix with the formulas
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/am3u1001/B.1.1?SHELF=&DT=19930630180527
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Fri Nov 14, 2008 5:50 pm    Post subject:
Reply with quote

Thanking you for the reply. Kindly explain me what is C, in K explain me what is the figure 9, 34, 6, kn and similarly for data length.

Space = C + K + D
= ? + Key-length +Data length

where:

C is 10.

K depends on the key length.

If KL = 0, K = 0.

If KL does not equal 0:

KL + (6 x KN) + 6
K = 9 + ------------------- (rounded up to an integer value)
34
where:

KL + 6
KN = -------- (rounded up to an integer value)
232
D is:

DL + (6 x DN) + 6
D = 9 + ------------------- (rounded up to an integer value)
34
where:

DL + 6
DN = -------- (rounded up to an integer value)
232


Thanks
Prasannaa S
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 14, 2008 6:00 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

that's simple math, what is that You do not understand icon_question.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7906
Location: Bellevue, IA

PostPosted: Fri Nov 14, 2008 6:27 pm    Post subject:
Reply with quote

Quote:
My intention is to how to calculate number of blocks per cylinder. In the referred chart we are able to see only the figures (example; for a block size between 951 and 984 - the number of blocks per cylinder is 35. I want to know how we get the value 35)
Uh, you DO know that there are 15 tracks per cylinder on a 3390? And you DO know that the table provides blocks per track, not cylinder?

The value 35 comes from the table. If you study disk drive geometry and hardware for 6 to 12 months and focus on the CKD drives, you can probably figure out exactly how the 35 was derived (assuming you can look at IBM's hardware design documents, of course). If you don't have the time, or access, than just accept the number in the table. Asking for anything more would be like wanting to know why the value of PI is 3.14159... (the answer is, IT JUST IS)
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Fri Nov 14, 2008 7:39 pm    Post subject:
Reply with quote

Thanking you for the reply. Could you explain what is the function of the constants 9, 6, 32, dn, 232. For example track capacity is calculated by
1729 / space. Where the constant 1729 means each 3390 track is divided into 1729 user data cells.

Thanks
Prasannaa
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 14, 2008 7:55 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

if You notice not even the manual gives an explanation for the constants

also I would like to point out that You would get more satisfaction
by searching an finding things on your own , rather than by asking

google for ( for example
ibm dasd hardware architecture ckd 3390 3990 fba redbooks systems journal
and slowly You will learn
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7906
Location: Bellevue, IA

PostPosted: Fri Nov 14, 2008 8:06 pm    Post subject:
Reply with quote

The constants are constants based on the device geometry. They are provided in the formulas from IBM. You could raise an issue with IBM about why they are the values they are, but don't expect an answer anytime soon since they are the values they are.

And unless you're doing very low-level hardware programming, ignore the 1729 data cells and work with records, blocks, and bytes. I've never in many years of mainframe programming needed to know the 1729 value or use it in any calculations.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 14, 2008 8:16 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

if You are really feel the need to know...

impendig anorexia
long sleepless nights,
nightmares of bytes losing the parity...
add as many as You want

You can try by searching the US patents data base,
hard to believe but it contains lots of trade secrets icon_biggrin.gif

PS
the wrath
Quote:
that all your bytes lose their parity

is my favorite
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Sat Nov 15, 2008 5:27 pm    Post subject:
Reply with quote

Thanking all of you for your kind response and guidance.

Thanks
Prasannaa S
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Nov 15, 2008 5:47 pm    Post subject: Reply to: how to calculate the number of blocks / track
Reply with quote

here is a small REXX I wrote for blksize calculations

tested with oorexx on Leopard and windows/XP
... should work with any Rexx on any opsys

save it anywhere along the path with any name,
NOTE: invoking it with lrecl 1 will reproduce the table in the manual

Code:

#! /opt/ooRexx/bin/rexx
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/*                                                                    */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Trace "O"
parse      source  _source_
parse      var _source_ _opsys_ _envir_ _commnd_ .
_opsys_    = lower(_opsys_)
if   abbrev(_opsys_,"windows") then do
   __PSEP__   = "\"
end
else do
   __PSEP__   = "/"   
end
p          = lastpos(__PSEP__,_commnd_)
interpret   "parse var _commnd_ with 1 _mypath "p" . "p+1" _myself"
parse       var _myself  _myname "." _myextn

TRKCAP = 56664
MAXREC = 32760
MAXKEY = 256

parse arg  args
args = strip(args)
argc = words(args)

if    argc = 0 then do
   say _myname "- needs at least one argument"
   say _myname "- syntax is '"_myname" lrecl [keylength]'"
   exit
end

if    argc > 2 then do
   say _myname "- supports only two arguments"
   say _myname "- syntax is '"_myname" lrecl [keylength]'"
   exit
end

parse var args reclen keylen
reclen = strip(reclen)
keylen = strip(keylen)

if   keylen = "" then ,
   keylen = 0

if   datatype(reclen) \= "NUM" | ,
   datatype(keylen) \= "NUM" then do
   say _myname "- not numeric arguments, retry "
   exit
end

if   reclen > MAXREC then do
   say _myname "- reclen" reclen "out of range, up to" MAXREC "allowed"
   exit
end

if   keylen > MAXKEY then do
   say _myname "- keylen" keylen "out of range, up to" MAXKEY "allowed"
   exit
end

c_blksz = reclen
c_count = blksxtrk(c_blksz,keylen)
i_blksz = c_blksz
i_count = c_count
p_blksz = c_blksz
p_count = c_count

if keylen \= 0 then ,
   say _myname "-  keylen  lrecl min-blksz max-blksz blocks"
else ,
   say _myname "-   lrecl min-blksz max-blksz blocks"

do   i = reclen to MAXREC by reclen
   c_blksz = i
   c_count = blksxtrk(c_blksz,keylen)

   if   c_count \= p_count then do
      if keylen \= 0 then ,
         say _myname "-" right(keylen,  7) || ,
            right(reclen,  7) || ,
            right(i_blksz, 10) || , 
            right(p_blksz, 10) || ,
            right(p_count, 7)
      else ,
         say _myname "-" right(reclen,  7) || ,
            right(i_blksz, 10) || , 
            right(p_blksz, 10) || ,
            right(p_count, 7)

      i_blksz = c_blksz
      i_count = c_count
   end
   p_blksz = c_blksz
   p_count = c_count

end

if keylen \= 0 then ,
   say _myname "-" right(keylen,  7) || ,
      right(reclen,  7) || ,
      right(i_blksz, 10) || , 
      right(p_blksz, 10) || ,
      right(p_count, 7)
else ,
   say _myname "-" right(reclen,  7) || ,
      right(i_blksz, 10) || , 
      right(p_blksz, 10) || ,
      right(p_count, 7)

exit

blksxtrk:procedure
parse arg blksz, keyln
   c = 10
   if keyln = 0  then ,
      k = 0
   else do
      kn = ( keyln + 6 ) % 232 + 1 - ( ( ( keyln + 6 ) // 232) = 0 )
      k  = 9 + ( keyln + 6 * kn + 6 ) % 34 + 1 - ( ( ( keyln + 6 * kn + 6 ) // 34) = 0 )
   end
   dn = ( blksz + 6 ) % 232 + 1 - ( ( ( blksz + 6 ) // 232) = 0 )
   d  = 9 + ( blksz + 6 * dn + 6 ) % 34 + 1 - ( ( ( blksz + 6 * dn + 6 ) // 34) = 0 )
   s = c + k + d
   return 1729 % s



if asked nicely I might post also the ISPF edit macro version icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts CPU time Vs Number of records Nileshkul JCL & VSAM 5 Mon May 09, 2016 4:05 pm


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