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

COBOl value clause for decimal- causing problem


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

New User


Joined: 15 Oct 2009
Posts: 23
Location: Pune

PostPosted: Wed Mar 17, 2010 9:26 pm
Reply with quote

Hi all,

My Literal is defined like this- WS-LIT PIC V9(01) VALUE 0.5.

when compiling in Changeman set-up, I am getting these errors.

IGYDS0001-W A blank was missing before character "5" in column 67. A blank was assumed.
IGYDS1159-E A "PICTURE" clause was not found for elementary item "FILLER". "PICTURE X(1)" was assumed.

At column 67 is the value "5" in value clause. It is detecting decimal "." at col-66 as statement terminator.
But outside ChangeMan, the same code is compiling clean!!
Please suggest what might be causing the problem or any alternate defination for decimal in Enterprise COBOL.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Mar 17, 2010 9:43 pm
Reply with quote

Maybe you should take a look at P symbol in the cobol-manual.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 17, 2010 11:56 pm
Reply with quote

Hello,

Or, you might try WS-LIT PIC V9(01) VALUE .5.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 18, 2010 12:52 am
Reply with quote

check if the options used for the compilation are the same..
what about the message about a filler?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Mar 18, 2010 1:22 am
Reply with quote

enrico,
IMHO the error message about filler is just fine.
Compiler interprets 2 statements out of
Code:
WS-LIT PIC V9(01) VALUE 0.  5.

(Warning seems to confirm that)
5 is level. No variable name makes it a filler and no picture clause means PIC X(1).
Maybe I am extrapolating too much but seems logical to me.
Back to top
View user's profile Send private message
Deja vu

New User


Joined: 15 Oct 2009
Posts: 23
Location: Pune

PostPosted: Thu Mar 18, 2010 10:55 pm
Reply with quote

Hi All,

I had tried with VALUE .5. & also checked the compiler options still same problem. Also when I hard coded 0.5 in my program, I had the same error.
As a tentative solution, I am dividing litereals 1 by Lit 2 & storing the result in a variable defined with PIC V9. this variable I am using in my program instead of declaring a literal with value "0.5".
I would appreciate if some one could explain this error or suggest a better solution for this problem.

Many Thanks for your replies!! icon_smile.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 18, 2010 10:59 pm
Reply with quote

The compiler does not like a decimal in the value.

I think your 'tentative' solution is perfect as a permanent one.

What is wrong with one line of code at the begining of the procedure division setting the value as you need it?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Mar 19, 2010 12:20 am
Reply with quote

Deja Vu,
Can you tell us the first line of your compiler listing in both cases
a. when you compile using JCL and
b. using Changeman?
For ex It should look like -
Code:
1PP 5655-G53 IBM Enterprise COBOL for z/OS  3.X.X

I am thinking there are two different compiler versions.
I assume this is a pure cobol program and no db2 preprocessor/cics precompiler steps before compiler. If this is true then the code shown in original post should compile clean using Enterprise COBOL.

Also, please paste your working storage code snippet in full. I mean the level number and all.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Mar 19, 2010 1:03 am
Reply with quote

Hello,

Quote:
But outside ChangeMan, the same code is compiling clean!!

Quote:
The compiler does not like a decimal in the value.

I suspect there is some "bad magic" in ChangeMan rather than the compiler. . . Note that neither variable generated an error in this compile:
Code:
PP 5655-S71 IBM Enterprise COBOL for z/OS  4.1.0

     01  V1                PIC V9(01) VALUE 0.5.
     01  V2                PIC V9(01) VALUE  .5.

End of compilation 1,  program DSCHTEST,  no statements flagged.
Return code 0
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 Mar 19, 2010 1:21 am
Reply with quote

I can create the same error by adding
Code:
SPECIAL-NAMES.             
   DECIMAL-POINT IS COMMA. 
to the configuration section.

Code:
    05 TEST7       PIC V999 VALUE 0.5.                                   
A blank was missing before character "5" in column 44.  A blank was     
assumed.                                                                 
A "PICTURE" clause was not found for elementary item "FILLER".  "PICTURE
X(1)" was assumed.                                                       


but this works fine
Code:
05 TEST7       PIC V999 VALUE 0,5.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top