Difference between CSECT and DSECT?

HLASM for MVS. PL/I for MVS & Enterprise PL/I for z/OS.
Post Reply
Rajeev Singh
New Member
Posts: 5
Joined: Sun Nov 30, 2014 7:56 am

Difference between CSECT and DSECT?

Post by Rajeev Singh »

What is difference between CSECT and DSECT? I read some defintion of then but they are tough to comphehend:
A DSECT or Dummy Section provides the programmer with the ability to describe the layout of an area of storage without reserving virtual storage for the area that is described. The DSECT layout can then be used to reference any area of storage which is addressable by the program. Think of the DSECT as a template, or pattern, which can be “dropped” on any area of storage. Once the DSECT is “positioned”, the symbolic names in the DSECT can be used to extract data from the underlying storage area.

By definition, a control section (CSECT) is “a block of coding that can be relocated (independent of other coding) without altering the operating logic of the program”.For the modern programmer, a CSECT might be considered as an independentcode module or package. The match in terminology is not precise, but suggestive.
Can you please explain them for a newbie.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Difference between CSECT and DSECT?

Post by Robert Sample »

A CSECT includes code and may include data. It has a certain amount of storage allocated to it. Every program has at least one CSECT (whether or not it is explicit).

A DSECT, on the other hand, has NO storage allocated to it -- in order to use variables in the DSECT you must indicate where the storage for the DSECT is (via the USING instruction).
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Assembler & PL/I.”