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

Facing problems if I declare a variable as S9(13).9(1)


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

New User


Joined: 28 Sep 2005
Posts: 7

PostPosted: Wed Dec 06, 2006 12:10 am
Reply with quote

Is it not possible to declare a numeric variable as S9(13).9(1) in Cobol? I get compilation error if I try this.

Please help me out icon_sad.gif

Regards,
Lakshmi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 06, 2006 12:41 am
Reply with quote

Do yoy mean S9(13)V9(1) or -9(13).9(1)?
Back to top
View user's profile Send private message
lakshmi_p01

New User


Joined: 28 Sep 2005
Posts: 7

PostPosted: Wed Dec 06, 2006 12:48 am
Reply with quote

I tried declaring it as S9(13).9(1)..
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 06, 2006 2:14 am
Reply with quote

Do you mean S9(13)V9(1) or -9(13).9(1)?

The first is to define an item for computational purposes, a signed 14 digit number with one digit behind the implied decimal point.

The second is to define an item for display purposes, a 14 digit number with the minus sign (if negative) leading and the lowest digit behind a decimal point.

Using the "S" in the same definition with the "." is (apparently) illegal. icon_sad.gif
Back to top
View user's profile Send private message
lakshmi_p01

New User


Joined: 28 Sep 2005
Posts: 7

PostPosted: Wed Dec 06, 2006 3:03 am
Reply with quote

I tried with -9(13).9 and it works.. Thanks much William icon_smile.gif
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts C++ problems Java & MQSeries 3
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts MFT File transfer problems All Other Mainframe Topics 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top