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

While Using "Function Numval"


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

New User


Joined: 02 Sep 2005
Posts: 26
Location: Hyderabad

PostPosted: Mon Nov 28, 2005 11:19 am
Reply with quote

Hi,

I m reading seq file where data is in the below mentioned form:
aaa,20.1,050402

I read this data, into variable A pic X(100).
Then, unstring and put it into 3 diff variables.
w-1,w-2,w-3 -----> pic x(3), pic x(6), pic x(6).
Now, to convert this w-2 to numeric, i am using
the Numval function:
Compute w-c = function numval(w-2) where ws-c -->pic s9(3)v99.
While compiling i am getting a compilation error. saying :

IGYPS2121-S "FUNCTION" was not defined as a data-name.

Is there any option in the compilation jcl, that i am missing.. or any suggestions....

Is sombeody could help...

Regards,
Jaya.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Nov 28, 2005 2:45 pm
Reply with quote

Hi frnd,
Quote:
w-1,w-2,w-3 -----> pic x(3), pic x(6), pic x(6).


so my frnd in ur query i have two solution for u..
solution 1: y cant u define it as w-2 pic 9(6) like that directly instead of changing from alpha-numeric.

solution 2: use this alternative way.
Code:
 05 w-2 PIC x(6).
 05 w-21 REDEFINES w-2 PIC 9(6).


and one more thing is check whether u have used the function at the right place. if possible post the code let us also try.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 03, 2005 8:43 am
Reply with quote

Hi Jaya,

I don't think you've given us enough info to answer. You showed us 20.1, but can it be 12, or -16.003, or 220146, or 220,146-, etc.?

You'll have to devise a receiving numeric field that could accommodate all the variations you see as possibilities.
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
Search our Forums:

Back to Top