Blocksize difference for files using the same copybook



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Blocksize difference for files using the same copybook

Postby The Mean Farmer » Wed Dec 22, 2010 1:29 am

I have a program that has multiple output files that are in the same format. The use the same copybook for the FD and working storage layouts.

FD is:
RECORD CONTAINS 1400 CHARACTERS
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
DATA RECORD IS 'XXX'-BASE-RECORD.
01 'XXX'-BASE-RECORD PIC X(1400).


If I calculate the best blocksize for these dimensions on a 3390 device I get 26600.

However for a standard file written to DASD I get a file allocated as follows:
Management class . . : MCSNULL
Storage class . . . : SCGDGMED
Volume serial . . . : CPGML3
Device type . . . . : 3390
Data class . . . . . : DASDGDG
Organization . . . : PS
Record format . . . : FB
Record length . . . : 1400
Block size . . . . : 18200

I have a file written to compressed DASD that is allocated as:
Management class . . : MCSNULL
Storage class . . . : SCGDGMED
Volume serial . . . : CPGML9
Device type . . . . : 3390
Data class . . . . . : COMPACK1
Organization . . . : PS
Record format . . . : FB
Record length . . . : 1400
Block size . . . . : 32200


I assume and can accept the file being written to compressed DASD is being blocked by the compression package, but how is the file written out to plan old DASD blocking at 18200 when the BLOCK CONTAINS 0 RECORDS statement is coded for it?

Any ideas?
The Mean Farmer
 
Posts: 16
Joined: Fri Nov 05, 2010 12:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Blocksize difference for files using the same copybook

Postby enrico-sorichetti » Wed Dec 22, 2010 2:12 am

I tend to trust more SMS that You for storage related issues
it might be wise also to review Your math skills ...
( 18200 / 1400 ) * 3 ==> 39 records x track
( 26600 / 1400 ) * 2 ==> 38 records x track
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Blocksize difference for files using the same copybook

Postby The Mean Farmer » Wed Dec 22, 2010 2:48 am

Hmmm,

The company has a RPF that they want us to use to calculate the blocksizes. Until I saw your response I have been trusting the RPF figures and not gone searching for the blocksize equation and running the math myself. I think I will have to rectify that.
The Mean Farmer
 
Posts: 16
Joined: Fri Nov 05, 2010 12:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Blocksize difference for files using the same copybook

Postby enrico-sorichetti » Wed Dec 22, 2010 3:14 am

here is a REXX I wrote , the formulas are taken from the IBM manual
and if run with 1 as the record length it will reproduce exactly the tables in the manual itself
it will do the calculation also for keyed records
any rexx interpreter on any pc should do, ( tested with object rexx and regina rexx )

#! /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_)
parse   var _commnd_ with 1 _mypath =(p) . =(p+1) _myname "." _myextn

TRKCAP   = 56664
MAXREC   = 32760
MAXBLK   = 27998
MAXBLK2   = 27648
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  min_recs  max-recs"
else ,
   say _myname "-      lrecl min-blksz max-blksz    blocks  min_recs  max-recs"

do   i = reclen to MAXBLK*(keylen=0) + MAXBLK2*(keylen>0) 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, 10) || ,
            right(reclen,  10) || ,
            right(i_blksz, 10) || , 
            right(p_blksz, 10) || ,
            right(p_count, 10) || ,
            right(p_count*(i_blksz/reclen), 10) || ,
            right(p_count*(p_blksz/reclen), 10)
      else ,
         say _myname "-" right(reclen, 10) || ,
            right(i_blksz, 10) || , 
            right(p_blksz, 10) || ,
            right(p_count, 10) || ,
            right(p_count*(i_blksz/reclen), 10) || ,
            right(p_count*(p_blksz/reclen), 10)
      
      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, 10) || ,
      right(reclen,  10) || ,
      right(i_blksz, 10) || , 
      right(p_blksz, 10) || ,
      right(p_count, 10) || ,
      right(p_count*(i_blksz/reclen), 10) || ,
      right(p_count*(p_blksz/reclen), 10)
else ,
   say _myname "-" right(reclen, 10) || ,
      right(i_blksz, 10) || , 
      right(p_blksz, 10) || ,
      right(p_count, 10) || ,
      right(p_count*(i_blksz/reclen), 10) || ,
      right(p_count*(p_blksz/reclen), 10)
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
 


here is the link to the docs and the formulas
the manual
http://publibz.boulder.ibm.com/cgi-bin/ ... 0527#COVER

the appendix with the formulas
http://publibz.boulder.ibm.com/cgi-bin/ ... 0630180527

for an older reference booklet
http://www.bitsavers.org/pdf/ibm/dasd/r ... _Jun89.pdf
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post