IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Declaratives in procedure division


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
blackzero

New User


Joined: 20 Mar 2008
Posts: 6
Location: INDIA

PostPosted: Fri Jul 04, 2008 9:42 pm
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
Craq Giegerich

Senior Member


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

PostPosted: Fri Jul 04, 2008 11:36 pm
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
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

Moderator Emeritus


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

PostPosted: Sat Jul 05, 2008 2:01 am
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: 1512
Location: Virginia, USA

PostPosted: Tue Jul 08, 2008 1:07 am
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
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: 1512
Location: Virginia, USA

PostPosted: Tue Jul 08, 2008 10:35 pm
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
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

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jul 11, 2008 9:20 pm
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: 258
Location: Salem, Oregon

PostPosted: Mon Jul 14, 2008 11:38 pm
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

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Jul 15, 2008 4:35 pm
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: 258
Location: Salem, Oregon

PostPosted: Tue Jul 15, 2008 7:18 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top