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
 

 

Can any one tel me the meaning of this data type.

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

New User


Joined: 16 Jan 2009
Posts: 2
Location: India

PostPosted: Tue Apr 07, 2009 6:01 pm    Post subject: Can any one tel me the meaning of this data type.
Reply with quote

Hi All,

I work in an application that is around 5 years old. While debugging a program to solve a prod error, I have come across a data type like
-10(9).99.

The error was that the variable with the above mentioned data type doesnt accept positive values and its size was 14 bytes. When I removed the negative sign it was accepting both positive and negative values but the size became 4 bytes(I saw the variable sizes through expeditor)


Can anyone tell me what this declaration means and also the significance of the negative sign
Back to top
View user's profile Send private message

leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Tue Apr 07, 2009 6:27 pm    Post subject: Reply to: Can any one tel me the meaning of this data type.
Reply with quote

5 yrs old Mainframe application is pretty new i would say.

Please post the complete declaration of the variable.

Also post the snapshot that you saw through expeditor.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Apr 07, 2009 6:39 pm    Post subject:
Reply with quote

Quote:
a data type like -10(9).99.
Like?
As in maybe it was -9(10).99?
Or something else?
I can see 0(9) works but I don't see how the '1' works.....
Back to top
View user's profile Send private message
Naresh Ch

New User


Joined: 16 Jan 2009
Posts: 2
Location: India

PostPosted: Tue Apr 07, 2009 6:51 pm    Post subject:
Reply with quote

The declaration looks like this..

05 WT-TOT-PRM-L1 PIC -(10)9.99 VALUE ZERO.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8125
Location: East Dubuque, Illinois, USA

PostPosted: Tue Apr 07, 2009 7:07 pm    Post subject:
Reply with quote

One of the reasons it is so important to cut and paste from the actual code is when you paraphrase, you get it wrong.
Quote:
I have come across a data type like -10(9).99.
-(10)9.99 makes sense, or -9(10).99 -- but you paraphrased it wrong.

Quote:
The error was that the variable with the above mentioned data type doesnt accept positive values
This is nonsense -- you misunderstand what COBOL is telling you, or you don't know enough COBOL to realize that your statement is wrong.

To wit:
Code:
       WORKING-STORAGE SECTION.
       01  WS-A1   PIC -(10)9.99.
       01  WS-B1   PIC -(10)9.99.
      /
       PROCEDURE DIVISION.
       S1000-MAIN       SECTION.
           MOVE -12345.67              TO  WS-A1.
           MOVE  12345.67              TO  WS-B1.
           DISPLAY  'WS-A1: ' WS-A1.
           DISPLAY  'WS-B1: ' WS-B1.
produces output of
Code:
 WS-A1:      -12345.67
 WS-B1:       12345.67
which very clearly proves that a -(10)9.99 field will accept a positive value. The negative sign is printed if and only if the value is negative -- otherwise a space is printed. The -(10)9.99 indicates there are 11 characters in front of the decimal point and 2 characters after the decimal point. If the value is negative, the negative sign will appear just before the first significant digit.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Apr 07, 2009 8:57 pm    Post subject:
Reply with quote

... all of which is explained in glorious detail in the COBOL Language Reference manual.
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 Unable to copy data from spool in a d... srikant314 JCL & VSAM 4 Fri Jul 28, 2017 9:10 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location Arun Raj DFSORT/ICETOOL 12 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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