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

Block contains 1 RECORD clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jobseeker

New User


Joined: 07 Mar 2005
Posts: 26

PostPosted: Mon Mar 07, 2005 4:43 am
Reply with quote

i don't know, whether it's a basic or advanced question.it's asked in ibm interview.

what happened, if you specify "BLOCK CONTAINS 1 RECORD" clause.
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Tue Mar 08, 2005 12:10 am
Reply with quote

Quote:
whether it's a basic or advanced question.it's asked in ibm interview
Questions are based on how you have answered for the previous questions.

Quote:
what happened, if you specify "BLOCK CONTAINS 1 RECORD"


Nothing happens if you code like that. The system will read the records "WITHOUT BUFFERING".
Back to top
View user's profile Send private message
mainframemouli

New User


Joined: 01 Mar 2005
Posts: 52
Location: Mysore

PostPosted: Tue Mar 08, 2005 7:22 pm
Reply with quote

suppose the Logical reord length is 80 and BLKSIZE is 800 then the block will contain 10 records provided if in the Application program its mentioned like BLOCK CONTAINS 0 records.

But if it is Mentioned like BLOCK CONTAINS 1 records Then Each Block will contain only one record which is poor.
Back to top
View user's profile Send private message
lnvrn

New User


Joined: 24 Feb 2005
Posts: 8
Location: Mumbai

PostPosted: Wed Mar 09, 2005 12:39 pm
Reply with quote

Hi Guys,

"Block contains 1 Records" will work it will not work when
"Block contains 1 record"
Try with this u will find difference.

Thanks & Regards
BVRREDDY
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Mar 13, 2005 11:40 pm
Reply with quote

As far as I recall DCB merge goes something like this:

If the DCB attribute value in the JCL it is overridden by the DCB attribute value in the DSCB or d/s label if it exists there. Similarly, if the DCB attribute value exists in the program, it overrides what was before.

If the file was created as anything but blocked 1, the pgm will not function properly if it attempts to OPEN the file.
Back to top
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Thu Dec 08, 2005 1:08 pm
Reply with quote

mmwife,

can u plz explain ... what is DSCB and how can we override DCB values in JCL by value in DSCB
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Dec 09, 2005 6:55 am
Reply with quote

Hi Nanda,

Each dataset on disk has a DSCB. It's similar to a label on a tape dataset. It contains info about the dataset's attributes.

When a dataset is used in a job, a process takes place that IBM calls a "DCB merge". DCB info is, or can be taken from the DSCB(LABEL), the DD DCB, and/or the catalog to determine what the Dataset attributes used for the execution will be.

YOU can't use the DSCB to o'ride the DCB info the merge process does it automatically. There's a good explanation of the process in the JCL Manuals on this site. Check the top of this screen on the far left.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Fri Dec 09, 2005 7:57 am
Reply with quote

Hi There,

As a follow up to the previous posts I am just adding some more additional information on BLOCK CONTAINS.


What is BLOCKING?

The BLOCK CONTAINS clause is included in the File Description entry only for files on magnetic media.

A group of logical records is included within one block to maximize the efficient use of a disk area.


Function

On OpenVMS Alpha systems, the BLOCK CONTAINS clause specifies the size of a physical record. <>

On Tru64 UNIX and Windows NT systems, block size for INDEXED organization is for documentation purposes only. <>


--------------------------------------------------------------------------------

General Format

Code:
BLOCk CONTAINS | smallest-block TO | blocksize {RECORDS/CHARACTERS}

where,

smallest-blockis an integer literal. It specifies the minimum physical record size.
blocksize is an integer literal. It specifies the exact or maximum physical record size.

Syntax Rule


The BLOCK CONTAINS clause can be in the file's Data Division file description entry. However, it cannot be in both the SELECT clause and the file description entry for the same file.

General Rules

    The BLOCK CONTAINS clause specifies physical record size.
    The compiler ignores smallest-block.
    The RECORDS phrase specifies physical record size in terms of logical records.
    For a fixed-length record magnetic tape file, each physical record except the last contains blocksize records.
    For a variable-length record magnetic tape file, the compiler computes the physical record size. It equals the size of the largest logical record, plus any overhead bytes, multiplied by blocksize.
    The CHARACTERS phrase specifies physical record size in terms of characters.
    The physical record size is the maximum of: (1) blocksize bytes, and (2) the size of the largest logical record; plus any overhead bytes for variable-length records.
    If there is no BLOCK CONTAINS clause, physical record size assumes a default value.
    The physical record size is the size of the largest record plus any overhead bytes.
    The size of physical records (in characters) must be a multiple of four. Otherwise, the I/O system rounds up the physical record size to the next multiple of four.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top