Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference bw START and CSECT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
alokagarwaljgd

New User


Joined: 02 Jun 2006
Posts: 28

PostPosted: Mon Nov 26, 2007 3:32 pm    Post subject: Difference bw START and CSECT
Reply with quote

Hi,

1) Can any body tell me What is the exact difference between START and CSECT? I thought that they are same, but it seems that some difference does exists between them.

2) How to handle/achieve bit operations (e.g. TM) in COBOL?

Thanks,
Alok

Warning: Title edited
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Nov 29, 2007 1:11 am    Post subject:
Reply with quote

1) START/CSECT are Assembler Language terms. As I recall START designates the starting point of the pgm. CSECT means "control section" (I think) and designates a group of assembler instructions.

Maybe someone else will pitch in and fill in the details.

2) COBOL can use LE callable sevices (see link below). The bit manipulating routines are listed at the bottom of the link page.

You can also use COBOL code to manipulate bits. You can modify the code below to your own needs:
Code:
       IDENTIFICATION DIVISION.
       PROGRAM-ID.    BITFLIPR.
       AUTHOR.        JACK.
       ENVIRONMENT    DIVISION.
      ******************************************************************
      *  CHANGES THE REQUESTED BIT OF THE BYTE PASSED BY THE CALLER.   *
      *  THIS SUB PGM CAN BE CALLED FROM A PGM OR EXECUTED DIRECTLY    *
      *  FROM JCL USING THE PARM FIELD IN THE EXEC CARD. THE JCL EX-   *
      *  ECUTION IS INTENDED TO FACILITATE TESTING.                    *
      *                                                                *
      *  WHEN INVOKED FROM A PGM, USE 1 OF THE FOLLOWING CALLING SEQ:  *
      *                                                                *
      *  CALL 'BITFLIPR' USING LK-PARM-LEN LK-PARM-DTA                 *
      *  CALL WS-PGMNAME USING LK-PARM-LEN LK-PARM-DTA                 *
      *                                                                *
      * WHERE,                                                         *
      *                                                                *
      *  WS-PGMNAME CONTAINS THE 8 POSITION LITERAL 'BITFLIPR'.        *
      *  LK-PARM-LEN IS AN 01 LEVEL DEFINED AS IN THE TABLE BELOW.     *
      *  LK-PARM-DTA IS AN 01 LEVEL DEFINED AS FOLLOWS:                *
      *                                                                *
      *     01  LK-PARM-DATA.                                          *
      *         05  LK-TGT-BYTE                                        *
      *         05  LK-BIT-NBR                                         *
      *         05  LK-ACTION                                          *
      *                                                                *
      * WHERE THE 05 LEVELS ARE DEFINED AS IN THE TABLE BELOW.         *
      *                                                                *
      *         DESCRIPTION       PICTURE              COMMENTS        *
      *         *************   **********    **************************
      *         PARM LENGTH     S9(4) COMP    CALLED FROM PGM THIS FLD *
      *                                       MUST HAVE VALUE OF -1.   *
      *                                       CALLED FROM JCL THIS FLD *
      *                                       MUST BE OMMITTED.        *
      *         TARGET BYTE      X(1)         THE BYTE THE CALLER      *
      *                                       WANTS CHANGED.           *
      *         BIT NUMBER       9(1)         THE BIT THE CALLER       *
      *                                       WANTS CHANGED. BIT NUM-  *
      *                                       BERS RANGE FROM 1 TO 8   *
      *                                       FROM HI TO LOW ORDER.    *
      *         ACTION           X(1)         THIS FLD HAS 1 OF 3 VAL- *
      *                                       UES: "1" - TURN BIT ON   *
      *                                            "0" - TURN BIT OFF  *
      *                                            "F" - FLIP THE BIT  *
      *                                                                *
      * REMEMBER THAT THE TARGET BYTE IS UPDATED BY 'BITFLIPR'.        *
      *                                                                *
      ******************************************************************

       CONFIGURATION    SECTION.
       DATA DIVISION.
       FILE SECTION.

      ******************************************************************
       WORKING-STORAGE  SECTION.
      ******************************************************************

      ******************************************************************
       01  WS-TABLES.
      ******************************************************************

      ******************************************************************
      *                                                                *
      * THIS TABLE IS USED TO DETERMINE THE VALUE THAT THE SUBJECT     *
      * BYTE MUST BE MULTIPLIED BY (MULT-VALUE) TO DETERMINE IF IT IS  *
      * CURRENTLY ON OR OFF (1 OR 0).                                  *
      *                                                                *
      * THE TABLE IS ALSO USED TO DETERMINE THE INCREMENT/DECREMENT    *
      * REQUIRED TO TURN THE BIT ON OR OFF (ADD-SUB-VALUE).            *
      *                                                                *
      ******************************************************************
           05  MULT-ADD-SUB-VALUES.
               10  BIT1-MULT-VALUE     PIC S9(004) VALUE +0    COMP.
               10  BIT1-ADD-SUB-VALUE  PIC S9(004) VALUE +128  COMP.
               10  BIT2-MULT-VALUE     PIC S9(004) VALUE +2    COMP.
               10  BIT2-ADD-SUB-VALUE  PIC S9(004) VALUE +64   COMP.
               10  BIT3-MULT-VALUE     PIC S9(004) VALUE +4    COMP.
               10  BIT3-ADD-SUB-VALUE  PIC S9(004) VALUE +32   COMP.
               10  BIT4-MULT-VALUE     PIC S9(004) VALUE +8    COMP.
               10  BIT4-ADD-SUB-VALUE  PIC S9(004) VALUE +16   COMP.
               10  BIT5-MULT-VALUE     PIC S9(004) VALUE +16   COMP.
               10  BIT5-ADD-SUB-VALUE  PIC S9(004) VALUE +8    COMP.
               10  BIT6-MULT-VALUE     PIC S9(004) VALUE +32   COMP.
               10  BIT6-ADD-SUB-VALUE  PIC S9(004) VALUE +4    COMP.
               10  BIT7-MULT-VALUE     PIC S9(004) VALUE +64   COMP.
               10  BIT7-ADD-SUB-VALUE  PIC S9(004) VALUE +2    COMP.
               10  BIT8-MULT-VALUE     PIC S9(004) VALUE +128  COMP.
               10  BIT8-ADD-SUB-VALUE  PIC S9(004) VALUE +1    COMP.

           05  REDEFINES MULT-ADD-SUB-VALUES.
           10  BIT-ARITH-ENTRY         OCCURS 8 TIMES.
               20  MULT-VALUE          PIC S9(004).
               20  ADD-SUB-VALUE       PIC S9(004).

      ******************************************************************
       01  WS-WORK-FIELDS.
      ******************************************************************

           05  COMPARE-WRK-FLD         PIC S9(004) VALUE 0    COMP.
           05  REDEFINES COMPARE-WRK-FLD.
               10  FILLER              PIC  X(001).
               10  COMPARE-WRK-BYTE    PIC  X(001).
                   88  BIT-IS-ON       VALUE X'80' THRU X'FF'.
                   88  BIT-IS-OFF      VALUE X'00' THRU X'7F'.

           05  ADD-SUB-WRK-FLD         PIC S9(004) VALUE 0    COMP.
           05  REDEFINES ADD-SUB-WRK-FLD.
               10  FILLER              PIC  X(001).
               10  ADD-SUB-WRK-BYTE    PIC  X(001).
1     /
      ******************************************************************
       LINKAGE                         SECTION.
      ******************************************************************

       01  LK-PARM-LEN                 PIC S9(004).
           88  LK-EXECUTED-FROM-PGM        VALUE -1.
           88  LK-EXECUTED-FROM-JCL        VALUE +0 THRU +9999.

       01  LK-PARM-DATA.
           05  LK-TGT-BYTE                 PIC  X(001).
           05  LK-BIT-NBR                  PIC  9(001).
               88  VALID-BIT-NBR               VALUE +1 THRU +8.
           05  LK-ACTION                   PIC  X(001).
               88  LK-TURN-BIT-ON              VALUE '1'.
               88  LK-TURN-BIT-OFF             VALUE '0'.
               88  LK-FLIP-THE-BIT             VALUE 'F'.
               88  VALID-ACTION                VALUE '1' '0' 'F'.
1     /
      ******************************************************************
       PROCEDURE DIVISION USING LK-PARM-LEN LK-PARM-DATA
      ******************************************************************
       000-MAINLINE.
      ******************************************************************

           PERFORM 8000-VALIDATE-PARM-INFO
           IF RETURN-CODE = ZEROS
              PERFORM 1000-MODIFY-BIT-VALUE
           ELSE
              IF LK-EXECUTED-FROM-JCL
                 DISPLAY 'ERROR IN THE PARM LIST. RETURN CODE SHOWS '
                         'THE PARM# IN ERROR'
                 DISPLAY ' '
                 DISPLAY 'RETURN CODE >' RETURN-CODE '<'
              END-IF
           END-IF
           GOBACK
           .
      ******************************************************************
       1000-MODIFY-BIT-VALUE.
      ******************************************************************
      *===>  SAVE TARGET BYTE
      *---------------------------------------------------------------

           MOVE LK-TGT-BYTE            TO  COMPARE-WRK-BYTE
           MOVE LK-TGT-BYTE            TO  ADD-SUB-WRK-BYTE

      *---------------------------------------------------------------
      *===>  ISOLATE BIT TO BE CHANGED. MULTIPLY THE TGT BYTE BY THE
      *===>  BINARY VALUE IN THE TABLE (POINTED TO BY THE BIT NUMBER
      *===>  PASSED BY THE CALLER). THIS MOVES THE TGT BIT TO THE HI
      *===>  ORDER POS OF THE WRK BYTE.
      *---------------------------------------------------------------

           COMPUTE COMPARE-WRK-FLD      = COMPARE-WRK-FLD
                                        * MULT-VALUE(LK-BIT-NBR)

      *---------------------------------------------------------------
      *===>  CHANGE THE BIT AS DIRECTED BY THE ACTION FLD PROVIDED BY
      *===>  CALLER.IF THE BYTE VALUE OF COMPARE-WRK-BYTE IS > X'7F',
      *===>  THE REQUESTED BIT IS ONE;IF <= THE BIT IS ZERO.
      *===>  ADD TABLE VALUE IF BIT IS ZERO(OFF); SUB IF IT'S ONE(ON).
      *===>  THIS PREVENTS CHANGES TO SURROUNDING BITS WHILE CHANGING
      *===>  THE REQUESTED BIT.
      *---------------------------------------------------------------

           EVALUATE TRUE
           WHEN LK-TURN-BIT-ON
                IF BIT-IS-OFF
                COMPUTE ADD-SUB-WRK-FLD = ADD-SUB-WRK-FLD
                                        + ADD-SUB-VALUE(LK-BIT-NBR)
                END-IF
           WHEN LK-TURN-BIT-OFF
                IF BIT-IS-ON
                COMPUTE ADD-SUB-WRK-FLD = ADD-SUB-WRK-FLD
                                        - ADD-SUB-VALUE(LK-BIT-NBR)
                END-IF
           WHEN LK-FLIP-THE-BIT
                IF BIT-IS-ON
                COMPUTE ADD-SUB-WRK-FLD = ADD-SUB-WRK-FLD
                                        - ADD-SUB-VALUE(LK-BIT-NBR)
                ELSE
                COMPUTE ADD-SUB-WRK-FLD = ADD-SUB-WRK-FLD
                                        + ADD-SUB-VALUE(LK-BIT-NBR)
                END-IF
           END-EVALUATE

      *---------------------------------------------------------------
      *===>  IF SUBPGM WAS EXECUTED FROM JCL, I.E. A TEST, DISPLAY
      *===>  THE BEFORE AND AFTER VALUES OF THE TARGET FIELD. ELSE
      *===>  MOVE IT TO THE LINKAGE FIELD FOR RETURN TO THE CALLER.
      *---------------------------------------------------------------

           IF LK-EXECUTED-FROM-JCL
              DISPLAY 'THE TARGET BYTE WAS CHANGED FROM >'
                      LK-TGT-BYTE '< TO >' ADD-SUB-WRK-BYTE '<'
           ELSE
              MOVE ADD-SUB-WRK-BYTE  TO LK-TGT-BYTE
           END-IF
           .
      ******************************************************************
       8000-VALIDATE-PARM-INFO.
      ******************************************************************

           EVALUATE TRUE
           WHEN LK-BIT-NBR NOT NUMERIC
           WHEN NOT VALID-BIT-NBR
                MOVE 3 TO RETURN-CODE
           WHEN NOT VALID-ACTION
                MOVE 4 TO RETURN-CODE
           END-EVALUATE
           .
      *===>  END OF PGM CODE
Back to top
View user's profile Send private message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Mon Apr 21, 2008 9:30 pm    Post subject: Reply to: Difference bw START and CSECT
Reply with quote

Do any body else know ? What is the exact difference?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 21, 2008 10:12 pm    Post subject:
Reply with quote

Hello,

Quote:
What is the exact difference?
You read the answer above. . .

Here it is again:
Quote:
START -- Start Assembly
The START instruction may be preceded by listing control
instructions and comments cards. The same label may not be used on a
START statement and a later CSECT statement.

CSECT -- Identify Control Section
No more than one CSECT may use a given symbol as a name,
and statements from different CSECT's may not be interspersed.

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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us