Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Declaratives in procedure division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
blackzero

New User


Joined: 20 Mar 2008
Posts: 6
Location: INDIA

PostPosted: Fri Jul 04, 2008 9:42 pm    Post subject: Declaratives in procedure division
Reply with quote

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
View user's profile Send private message
References
PostPosted: Fri Jul 04, 2008 9:42 pm    Post subject: Re: Declaratives in procedure division Reply with quote

Craq Giegerich

Senior Member


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

PostPosted: Fri Jul 04, 2008 11:36 pm    Post subject:
Reply with quote

What problem are you having.
Back to top
View user's profile Send private message
blackzero

New User


Joined: 20 Mar 2008
Posts: 6
Location: INDIA

PostPosted: Sat Jul 05, 2008 12:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


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

PostPosted: Sat Jul 05, 2008 2:01 am    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jul 08, 2008 1:07 am    Post subject:
Reply with quote

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
View user's profile Send private message
blackzero

New User


Joined: 20 Mar 2008
Posts: 6
Location: INDIA

PostPosted: Tue Jul 08, 2008 6:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Jul 08, 2008 10:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
blackzero

New User


Joined: 20 Mar 2008
Posts: 6
Location: INDIA

PostPosted: Wed Jul 09, 2008 4:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 309
Location: Bangalore

PostPosted: Fri Jul 11, 2008 9:20 pm    Post subject:
Reply with quote

What was the TEST parm given to COBOL compiler ?
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 122

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

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
View user's profile Send private message
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 309
Location: Bangalore

PostPosted: Tue Jul 15, 2008 4:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 122

PostPosted: Tue Jul 15, 2008 7:18 pm    Post subject:
Reply with quote

ashimer, as this was stated in one of the previous solutions, I did not repeat this...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1