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 value clause for decimal- causing problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOl value clause for decimal- causing problem
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: 686
Location: Earth

PostPosted: Wed Mar 17, 2010 9:43 pm    Post subject:
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

Site Director


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

PostPosted: Wed Mar 17, 2010 11:56 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Thu Mar 18, 2010 12:52 am    Post subject: Reply to: COBOl value clause for decimal- causing problem
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: 686
Location: Earth

PostPosted: Thu Mar 18, 2010 1:22 am    Post subject:
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    Post subject:
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: 662
Location: Pennsylvania

PostPosted: Thu Mar 18, 2010 10:59 pm    Post subject:
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: 686
Location: Earth

PostPosted: Fri Mar 19, 2010 12:20 am    Post subject:
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

Site Director


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

PostPosted: Fri Mar 19, 2010 1:03 am    Post subject:
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    Post subject:
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    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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm


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