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
 

 

Declaratives in procedure division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
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

Site Director


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

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: 1512
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: 1512
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

Active Member


Joined: 13 Feb 2004
Posts: 551
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: 258
Location: Salem, Oregon

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

Active Member


Joined: 13 Feb 2004
Posts: 551
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: 258
Location: Salem, Oregon

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm
This topic is locked: you cannot edit posts or make replies. Stored procedure on Federated thru DB2 arif677 DB2 6 Tue May 31, 2016 11:48 pm
No new posts Identification Division anandgbe COBOL Programming 2 Sat May 28, 2016 11:51 am


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