View previous topic :: View next topic |
Author |
Message |
deepatred Beginner
Joined: 29 Nov 2005 Posts: 19 Topics: 6
|
Posted: Wed Apr 05, 2006 3:25 am Post subject: accepting a non-integer value passed through a JCL |
|
|
Hi,
Through JCL we can pass values that can be accepted in program using an ACCEPT statement.
like
//SYSIN DD *
0.003
/*
If i want to pass a value like 0.003 can i accept it in a variable of PICTURE 9(3)V9(3).
it is accepting the value in my program but giving an exception later.
Thanks.
Deepa |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Wed Apr 05, 2006 4:05 am Post subject: |
|
|
Deepa,
'V' in cobol picture declaration stands for assumed decimal point. So, it can never accept ".". So, the solution is - "You must also assume that you are passing a decimal point but actually you should not" !!! change your sysin as below.
Code: |
//SYSIN DD *
0003
/*
|
Numeric fields will be filled from rightmost digit and hence, '003' will be passed to decimal portion leaving the integer portion as "0".
Hope this helps,
Thanks,
Phantom |
|
Back to top |
|
 |
deepatred Beginner
Joined: 29 Nov 2005 Posts: 19 Topics: 6
|
Posted: Wed Apr 05, 2006 10:26 pm Post subject: |
|
|
Phantom,
Thanks.
But i could not get the funda clear.
When i tried passing 0.000 from sysin to variable of PIC 9V9(3), it displayed the accepted value as 0.00
When i tried passing 0.000 to variable of PIC 9(3)V9(3), it displayed the accepted value as 0.000
What does this mean?
Quote: |
'V' in cobol picture declaration stands for assumed decimal point. So, it can never accept ".".
|
Since V is assumed can we consider the PIC as 9999 in first case, then it looks as if the variable is treating decimal point also as numeric quantity. Hows that possible?
I solved that problem another way. I accepted the value in an alphanumeric variable and converterted it to numeric in program. This approach looks OK to me till now.
Please provide some help to clear my doubts.
Thanks,
Deepa |
|
Back to top |
|
 |
|
|