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
 

 

While Using "Function Numval"

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: While Using "Function Numval"
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: 680
Location: NJ

PostPosted: Mon Nov 28, 2005 2:45 pm    Post subject: Var caluse
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm


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