Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Thu Nov 13, 2008 10:24 pm    Post subject: how to calculate the number of blocks / track 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?

Robert Sample

Global Moderator

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

 Posted: Fri Nov 14, 2008 12:48 am    Post subject: 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).
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

Posted: Fri Nov 14, 2008 2:57 am    Post subject:

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
Pedro

Senior Member

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

 Posted: Fri Nov 14, 2008 3:06 am    Post subject: Reply to: how to calculate the number of blocks / track 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.
Bill Dennis

Active Member

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

 Posted: Fri Nov 14, 2008 3:42 am    Post subject: 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.
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Fri Nov 14, 2008 1:48 pm    Post subject: 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
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

 Posted: Fri Nov 14, 2008 1:55 pm    Post subject: Reply to: how to calculate the number of blocks / track 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
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Fri Nov 14, 2008 3:17 pm    Post subject: 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
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

 Posted: Fri Nov 14, 2008 5:00 pm    Post subject: Reply to: how to calculate the number of blocks / track 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
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Fri Nov 14, 2008 5:50 pm    Post subject: 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
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

 Posted: Fri Nov 14, 2008 6:00 pm    Post subject: Reply to: how to calculate the number of blocks / track that's simple math, what is that You do not understand
Robert Sample

Global Moderator

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

Posted: Fri Nov 14, 2008 6:27 pm    Post subject:

 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)
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Fri Nov 14, 2008 7:39 pm    Post subject: 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
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

 Posted: Fri Nov 14, 2008 7:55 pm    Post subject: Reply to: how to calculate the number of blocks / track 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
Robert Sample

Global Moderator

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

 Posted: Fri Nov 14, 2008 8:06 pm    Post subject: 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.
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

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

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

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

is my favorite
sprasannapathy

New User

Joined: 04 Jan 2008
Posts: 42
Location: india

 Posted: Sat Nov 15, 2008 5:27 pm    Post subject: Thanking all of you for your kind response and guidance. Thanks Prasannaa S
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10494
Location: italy

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

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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Add Comma to each record until find t... naveensrimf DFSORT/ICETOOL 6 Sat Jul 28, 2018 12:25 am Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us