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
 

 

Block contains 1 RECORD clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Block contains 1 RECORD clause
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: 1202
Location: India

PostPosted: Tue Mar 08, 2005 12:10 am    Post subject: Re
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 413
Location: Colarado, US

PostPosted: Fri Dec 09, 2005 7:57 am    Post subject: Re: Block contains 1 RECORD
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming 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 update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts SORT Block of records girishb2 DFSORT/ICETOOL 12 Thu Sep 15, 2016 8:58 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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