View previous topic :: View next topic
|
Author |
Message |
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
Hi ,
I have the following pic clause
05 S-SALES-AMOUNT PIC S9(13)V99 COMP-3.
05 RPT-GROSS-S PIC Z,ZZZ,ZZZ,ZZZ,ZZ9.99-.
Requirement is to move RPT-GROSS-S to S-SALES-AMOUNT.
I tried with inspect and string with no success.
Please suggest.
Anand |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Moving a numeric edited to comp-3 might give a wrong result ...
if i move 100000 to RPT-GROSS it will be 100,000.00 and moving RPT-GROSS to SALES-AMOUNT will give 000000010000000 .....
Wht is the requirement ? and y was string and inspect used ?? |
|
Back to top |
|
|
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
I used inspect to replace all spaces with zeros.
then unstring to split the variable delimited by spaces.
String to concatenate all variables.
it is working fine now . I want to know is there any function to handle this. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
redefine RPT-GROSS-S as PIC x and then use FUNCTION NUMVAL |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I think this support started w/later releases of COBOLII.
Try "MOVE RPT-GROSS-S TO S-SALES-AMOUNT". |
|
Back to top |
|
|
|