Page 2 of 3

Re: COBOL Move

PostPosted: Wed Mar 12, 2014 4:49 pm
by NicC
You seem to have no decimals in your field definitions so how come you are showing them? what does the field show when you DISPLAY it? 0000000580930720?

Re: COBOL Move

PostPosted: Wed Mar 12, 2014 4:57 pm
by maragatham pp
The Input field is declared as MBS-AMORTN-VAL PIC 9(0012)V9(04)

Re: COBOL Move

PostPosted: Wed Mar 12, 2014 10:24 pm
by dick scherrer
Hello,

Yup, a pic of anythingvsomenumber has no decimal . . . It is implied and will be scaled properly when computations are done, but it will not be seen when displayed.

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 5:42 am
by BillyBoyo
The thing is, you have shown your output field defined with no decimal places, and then tell us that it has a large number of decimal places.

Can you show some representative values for your input, and the expected output you get for them, including whether the decimal places are implied, with the V, or explicit.

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 7:24 am
by Quasar
In addition to the comments above - you mention POSOUT-AMORTN-RATE is S9(14) COMP, the field has no decimal(fractional) places. Like Billy says, could you show some representative values for your input and the expected output values.

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 12:29 pm
by maragatham pp
Input field is MBS-AMORTN-VAL PIC 9(0012)V9(04)
Output Field is WW-NR-RATE PIC S9(14)

Input Data 58093.0720
When Displayed - 0000000580930720
Output Data Expected 58093
Displayed as - 0000000058093{

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 1:10 pm
by BillyBoyo
OK, thanks for that example. Can you give more examples, which test your range of valid data. At the moment it looks like a number with seven decimal places which you want to treat as three decimal places. Does that describe what you are trying to do? If not, what does?

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 2:22 pm
by maragatham pp
Hi, Below are the changes I did to intermediate variable declarations and their corresponding output.

01 WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(12)V9(4).
01 WS-MBS-ALIGNED-NO-DECS-R
REDEFINES WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(16).


Input 0000000580930720
Output 0000058093072{


01 WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(9)V9(3).
01 WS-MBS-ALIGNED-NO-DECS-R
REDEFINES WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(12).

Input 0000000580930720
Output 0000005809307B


01 WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(8)V9(4).
01 WS-MBS-ALIGNED-NO-DECS-R
REDEFINES WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(12).

Input 0000000580930720
Output 0000058093072{


01 WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(8)V9(4).
01 WS-MBS-ALIGNED-NO-DECS-R
REDEFINES WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(8).


Input 0000000580930720
Output 0000000005809C

01 WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(12)V9(4).
01 WS-MBS-ALIGNED-NO-DECS-R
REDEFINES WS-MBS-VAL-TRUNC-L-EXTEND-R PIC 9(12).

Input 0000000580930720
Output 0000000005809C

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 5:14 pm
by NicC
And what were you hoping to see for these values? At the moment you are getting the expected results for the definitions shown. Are you hoping to get 1234 if you put in 1234.5678 or are you hoping to get 12345678?

Re: COBOL Move

PostPosted: Thu Mar 13, 2014 5:39 pm
by maragatham pp
I expect 1234.