View previous topic :: View next topic
|
Author |
Message |
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
Hi,
I have a COBOL program which gets 11 different values as a PARM from a JCL.
Code: |
//STEP01 EXEC PGM=PROG1,PARM=('2009-01-21','1234','0012','1111',
// '2009-01-22','4321','32767','2222','TABLE_NAME','47',
// '999.88')
|
and in PROG1 after receiving the parms via the linkage section i unstring the parms to get individual values into variables.
Code: |
UNSTRING WS-EXEC-PRM-VALUE
DELIMITED BY ','
INTO DATE
SEQ-NO
FILE-NO
.
.
.
.
.
.
.
AMOUNT
END-UNSTRING |
.
The problem is the last field (amount) which is declared as
Code: |
05 AMOUNT PIC 9(8)V9(2). |
I am not getting the value passed. i get 7 spaces followed by 3 zeroes (for 999.88).
here is the display part of all the parms
Code: |
2009-01-21
000000000001234
00012
01111
2009-01-22
000000000004321
32767
02222
TABLE_NAME
00047
000 ---this one should be 999.88 |
can you guys help me point out where i am going wrong ??
Thanks in advance |
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
Hi Rakesh,
Here you are passing Amount as alphanumeric (character string) so you receiving the amount in cobol program in alphanumeric form and then move it to numeric. This could help you. |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
Quote: |
you receiving the amount in cobol program in alphanumeric form |
unstring is done into AMOUNT which is declared as
Code: |
05 AMOUNT PIC 9(8)V9(2). |
|
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
Please declare the AMOUNT as follows:-
05 AMOUNT PIC 9(10).
after that you can move it into another variable which is declared as 9(8)v9(2). |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
yes i did that, but the result was
Code: |
PARMS ARE: 0000000000 |
I am gonna try reference modification for this particular variable. let me see how it comes out. |
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
There are 2 options which you can try:-
1. Either pass value of Amount from JCL without quotes i.e. ..'47',998.88)
2. Or you recieve it in X(10) in the program. |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
Quote: |
1. Either pass value of Amount from JCL without quotes i.e. ..'47',998.88) |
this gives me a JCL error for decimal values,
Quote: |
2. Or you recieve it in X(10) in the program. |
This worked fine but then i need to type cast to decimal values. for this i used NUMVAL function and now i am good to go.
Thanks for helping me out. Much appreciated
[/quote] |
|
Back to top |
|
|
|