IBM MAINFRAME HELP FORUMS for COBOL, JCL, CICS, DB2, IMS etc...
Help & Support Forums for IBM Mainframe computers Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7, CA-11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, VSAM, ISPF, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Declaratives in procedure division

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> Mainframe COBOL
View previous topic :: View next topic  
Author Message
blackzero



Joined: 20 Mar 2008
Posts: 6
Location: INDIA

Posted: Fri Jul 04, 2008 9:42 pm    Post subject: Declaratives in procedure division  

Hey Guys,

I facing a problem in using Declaratives in procedure division. Plz see my code below and suggest me if i am doing anything wrong.
Back to top  
Craq Giegerich



Joined: 19 May 2007
Posts: 966
Location: Virginia, USA

Posted: Fri Jul 04, 2008 11:36 pm    Post subject:  

What problem are you having.
Back to top  
blackzero



Joined: 20 Mar 2008
Posts: 6
Location: INDIA

Posted: Sat Jul 05, 2008 12:26 am    Post subject:  

This code when runs should normally display the debug status like program start line number, procedure name etc sysout of the spool but in my case its not displaying anything.
Back to top  
dick scherrer



Joined: 23 Nov 2006
Posts: 7505
Location: 221 B Baker St

Posted: Sat Jul 05, 2008 2:01 am    Post subject:  

Hello,

Please post the jcl and spooled output from the step.

You may see nothing due to a missing dd statement. If this is the case, there should be a "dd statement missing" message somewhere.

When you post code, please do not use a screen capture. It just makes a mess. . . If you post the code via copy/paste and "Code" it using the Code tag, i'll replace your image with the text code so your post will be easier to use.
Back to top  
Craq Giegerich



Joined: 19 May 2007
Posts: 966
Location: Virginia, USA

Posted: Tue Jul 08, 2008 1:07 am    Post subject:  

Change
Code:
*SOURCE COMPUTER. IBM-370 WITH DEBUGGING MODE.
 SOURCE COMPUTER. IBM-370.


to
Code:
 SOURCE COMPUTER. IBM-370 WITH DEBUGGING MODE.
*SOURCE COMPUTER. IBM-370.


[/code]
Back to top  
blackzero



Joined: 20 Mar 2008
Posts: 6
Location: INDIA

Posted: Tue Jul 08, 2008 6:24 pm    Post subject:  

Here is my JCL

Code:
//EXECU EXEC PGM=REXXTEST                                               
//STEPLIB DD DSN=ABC.RUNLIB.LOAD,DISP=SHR                           
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN DD *                                                           
/*   


and this is SYSOUT

Code:
********************************* TOP OF DATA **********************************
Hey  - - -                                                                     
******************************** BOTTOM OF DATA ********************************
Back to top  
Craq Giegerich



Joined: 19 May 2007
Posts: 966
Location: Virginia, USA

Posted: Tue Jul 08, 2008 10:35 pm    Post subject:  

Until you change the SOURCE COMPUTER statement you won't get any output from the debug section.

Quote: When the debugging mode is suppressed by not specifying that option of the SOURCE compiler, any USE FOR DEBUGGING declarative procedures and all debugging lines are inhibited.
Back to top  
blackzero



Joined: 20 Mar 2008
Posts: 6
Location: INDIA

Posted: Wed Jul 09, 2008 4:46 pm    Post subject:  

Yes, i have changed the code. this is my code now -
Code:
       Identification Division.
       Program-Id. rexxtest.
       Environment Division.
       Configuration Section.
       Source-Computer. IBM-370 With debugging Mode.
      *Source-Computer. IBM-370.
       Object-Computer. IBM-370.
       Input-Output Section.
       Data Division.
       Working-Storage Section.
       Procedure Division.
       DECLARATIVES.
       DEBUG SECTION.
             USE FOR DEBUGGING ON ALL PROCEDURES.
       000-DEBUG-TRACE.
             DISPLAY DEBUG-NAME DEBUG-CONTENTS "LINE =" DEBUG-LINE.
       END DECLARATIVES.
       0000-Main Section.
       Hey-Manjulam.
            Display 'Hey  - - - '
            .
       0000-Main-Exit.
            Stop Run.


JCL is same as above

still i am getting the same output.
Back to top  
ashimer



Joined: 13 Feb 2004
Posts: 311
Location: Bangalore

Posted: Fri Jul 11, 2008 9:20 pm    Post subject:  

What was the TEST parm given to COBOL compiler ?
Back to top  
Mickeydusaor



Joined: 24 May 2006
Posts: 122

Posted: Mon Jul 14, 2008 11:38 pm    Post subject: Reply to: Declaratives in procedure division  

looks like you have missed a few required fields. This is how I got this to work.

Code:
01 WS-DEBUG-INFO.
  05 WS-DEBUG-FLAG              PIC X(01) VALUE ' '.
    88 WS-DEBUG-ON                        VALUE 'O'.

  05 WS-DEBUG-ITEM.
    10 WS-DEBUG-LINE            PIC X(06) VALUE SPACES.
    10 FILLER                          PIC X(01) VALUE SPACES.
    10 WS-DEBUG-NAME          PIC X(30) VALUE SPACES.
    10 FILLER                          PIC X(01) VALUE SPACES.
    10 WS-DEBUG-SUB1          PIC X(05) VALUE SPACES.
    10 FILLER                          PIC X(01) VALUE SPACES.
    10 WS-DEBUG-SUB2          PIC X(05) VALUE SPACES.
    10 FILLER                          PIC X(01) VALUE SPACES.
    10 WS-DEBUG-SUB3          PIC X(05) VALUE SPACES.
    10 FILLER                          PIC X(01) VALUE SPACES.
    10 WS-DEBUG-CONT         PIC X(30) VALUE SPACES.

PROCEDURE DIVISION.
DECLARATIVES.

DEBUG-TRACE SECTION.
    USE FOR DEBUGGING ON ALL PROCEDURES
    .

DEBUG-ACTION.
    SET WS-DEBUG-ON     TO TRUE

    INITIALIZE WS-DEBUG-ITEM

    MOVE DEBUG-LINE     TO WS-DEBUG-LINE
    MOVE DEBUG-NAME     TO WS-DEBUG-NAME
    MOVE DEBUG-SUB-1    TO WS-DEBUG-SUB1
    MOVE DEBUG-SUB-2    TO WS-DEBUG-SUB2
    MOVE DEBUG-SUB-3    TO WS-DEBUG-SUB3
    MOVE DEBUG-CONTENTS TO WS-DEBUG-CONT

    DISPLAY WS-DEBUG-ITEM
    .
 END DECLARATIVES
     .
/

//STEP010 EXEC PGM=XXXTEST1,PARM='/DEBUG'
Back to top  
ashimer



Joined: 13 Feb 2004
Posts: 311
Location: Bangalore

Posted: Tue Jul 15, 2008 4:35 pm    Post subject:  

Mickey ... whtever blackzero has shown is right .... and whtever u have shown is exactly wht was pictured earlier ... but in a different manner ... i think the compiler option TEST has something to do with this ... TEST(NONE) will not allow debugging ..instead it shud be TEST(ALL) or TEST(ALL,SYM) ...
Back to top  
Mickeydusaor



Joined: 24 May 2006
Posts: 122

Posted: Tue Jul 15, 2008 7:18 pm    Post subject:  

ashimer, as this was stated in one of the previous solutions, I did not repeat this...
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> Mainframe COBOL
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
Related Links