Hi All,
Can anyone tell me how we can MOVE value of a X(19)
variable to a S9(17) COMP-3 variable?
Answer with an Example will be of great help.
Answer Posted / nicx
The function NUMVAL can be used to change the X(19) to S
(17) and then moved to comp-3
Ex:
ws-variable PIC X(19)
ws-variable-1 PIC S9(17)
ws-variable-1 PIC S9(17) comp-3
Compute ws-variable-1 = function numval(ws-variable)
move ws-variable-1 to ws-variable-2.
Ofcourse you should be expecting a signed 9(17) value in
the ws-variable. Check out NUMVAL-C too. Both functions are
a great help in such situations.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What are the different types of condition in cobol and write their forms.
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
Which Search verb is equivalent to PERFORM…VARYING?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Have you used comp and comp-3 in your project? And how?
Name the divisions, which are available in a cobol program?
In which area will you utilize 88 level items in cobol?
) How do u handle errors in BMS macro?
how do you reference the esds vsam file formats from cobol programs
what happens if parmparameter passes zero bytes to the program
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
Are you comfortable in cobol or jcl?
what are decleratives in cobol?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
how do you reference the ksds vsam file formats from cobol programs