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
 
COBOL S9(5) COMP fields display in SPOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Appu

New User


Joined: 26 Apr 2010
Posts: 74
Location: India

PostPosted: Fri Nov 05, 2010 2:53 pm    Post subject: COBOL S9(5) COMP fields display in SPOOL
Reply with quote

Hi,

Please see the below COBOL code.

COBOL Declarations
Code:

01  ERROR-PCB.                                           
    05      ERROR-DBNAME        PIC     X(8).             
    05      ERROR-SEGLEVEL      PIC     XX.               
    05      ERROR-STATUS        PIC     XX.               
    05      ERROR-PROCOPT       PIC     X(4).             
    05      ERROR-RESERVE       PIC     X(4).             
    05      ERROR-SEGNAME       PIC     X(8).             
    05      ERROR-KEYLENGTH     PIC     S9(5)   COMP.     
    05      ERROR-SENSNUM       PIC     S9(5)   COMP.     
    05      ERROR-KEYAREA       PIC     X(25).           
    05      FILLER              PIC     X(50).           
01  IOBER.                   
   03 PCB-IO        POINTER. 

01  IO-PCB                 PIC X(100). 



COBOL Code
Code:

SET   PCB-IO              TO   ADDRESS OF IO-PCB.
SET  ADDRESS OF ERROR-PCB TO PCB-IO.


The spool display of IO-PCB is as follows :
Code:

4444444410444444444444444444444444444444444444440000
0000000000000000000000000000000000000000000000000000


I tried printing ERROR-PCB after the assignment and in the spool all the items declared inside ERROR-PCB are coming correctly but i am getting unexpected values for ERROR-KEYLENGTH and ERROR-SENSNUM.
I am getting the value 52576 for ERROR-KEYLENGTH and ERROR-SENSNUM. But from the spool display of IO-PCB i was expecting the values from position 29-36 in the hex output above.


Could please anyone explain why ERROR-KEYLENGTH and ERROR-SENSNUM is showing a values which is not at all present in IO-PCB.
Is there any relation since these two fields are PIC S9(5) COMP ?

Please help.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Nov 05, 2010 3:34 pm    Post subject:
Reply with quote

in which section are PCB-IO, IO-PCB, ERROR-PCB defined
all in working storage? all in linkage?
which level of cobol are you using? (cobol II or enterprise?)
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Nov 05, 2010 3:36 pm    Post subject: Reply to: COBOL S9(5) COMP fields display in SPOOL
Reply with quote

Try this instead -

Code:

SET  PCB-IO            TO ADDRESS OF ERROR-PCB.
SET  ADDRESS OF IO-PCB TO PCB-IO.


The contents of IO-PCB is now the same as the contents of ERROR-PCB, because they are pointing to the same address of ERROR-PCB.

You had just the opposite, pointing both at the address of IO-PCB, which looks to be uninitialized.

Why not just display the contents of ERROR-PCB? Is there a real reason to monkey around with storage addresses as this is foreign to many folks using COBOL.

What version/release of COBOL are you using?

Are these WS or LINKAGE items?

Bill
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am

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