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
 

 

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: 6966
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: 2502
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am


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