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
 

 

What is the use of DSECT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Sep 04, 2006 12:01 pm    Post subject: What is the use of DSECT
Reply with quote

Hi,

I know the theoritical concept of DSECT.
But when we say that with DESCT no actual virtual storage is allocated, what do we mean ??? What exactly happens ???
Can any body throw some light on DSECT and its usage???
Back to top
View user's profile Send private message

Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Tue Sep 05, 2006 9:23 am    Post subject: Re: What is the use of DSECT
Reply with quote

Have you ever used a stencil? DSECT's exactly that.
You can place a stencil over certain data and read the data in symbolic ashion, rather than referring them via absolute displacements.
You can move the stencil over repetitive data (arrays) and read it using same variables if you know the element size.
If you have multiple data formats, you can use different stencils to read the same data, by choosing one among them at a time.

The only restriction is that you have to tell the compiler before hand which stencil you are going to use for a particular portion of the code; it doesn't matter which path your routine takes during run time; all you have to ensure is you have the right mapping for the right code.
Does that answer your question?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Wed Sep 06, 2006 6:11 pm    Post subject:
Reply with quote

A DSECT is much like the LINKAGE SECTION in a COBOL program. It allows you to work with field names instead of register+disp.
DSECTs are used together with the USING statement.
As Bharanidharan said, you can simulate the cobol OCCURS statement:
Without DSECT:
Code:
          L     6,0(1)
LOOP      EQU   *
          MVC   0(4,6),MYAREA1
          MVC   4(8,6),MYAREA2
          LA    6,12(6)
          B     LOOP
With DSECT:
Code:
          USING MYDSECT,6
          L     6,0(1)
LOOP      EQU   *
          MVC   DSFLD1,MYAREA1
          MVC   DSFLD2,MYAREA2
          LA    6,12(6)
          B     LOOP

MYDSECT   DSECT
DSFLD1    DS    CL4
DSFLD2    DS    CL8

The USING command means that MYDSECT describes the area pointed to by register 6.
(I don't work anymore in Assembler, so I don't have actual examples. Sorry for the infinite loop)
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using DSECT - for file reading Apurva Mehta PL/I & Assembler 2 Mon Nov 17, 2014 10:09 pm
No new posts DSECT and Establishing Addressability vinayknj PL/I & Assembler 11 Tue May 31, 2011 3:45 pm
No new posts DSECT ID in listing. milind suman PL/I & Assembler 7 Mon Aug 24, 2009 11:06 am
No new posts Instructions Within a DSECT Pankaj Shrivastava PL/I & Assembler 3 Fri Jul 24, 2009 7:03 pm


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