Sending data is aplhabetic size 7 (value 3000), I wantated
this value to be stored in database, which is defined as
s9(7)v9(2)comp-3.
Answer Posted / mvramesh
01 ws-in-data Pic X(7)
05 ws-numeric Pic x (4) value '3000'
05 ws-filler Pic x (1) value '.'
05 ws-decimial pic x (2) value '00'
01 WS-Temp-CHAR PIC X(6)
05 ws-num Pic x (4)
05 ws-dec Pic x (2)
01 WS-TEMP-NUM redefines WS-Temp-char pic 9(4)V9(2)
01 WS-OUT-Data PIC S9(7)V9(2) comp-3
move ws-numeric to ws-num
move ws-decimal to ws-dec
move ws-temp-num to WS-OUT-data
here is the logic, there may be syntax errors. need to modify based on the format of input data.
Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
Difference between cobol and cobol-ii?
how to move the records from file to array table. give with code example
What is the difference between Call and a Link?
What are declaratives and what are their uses in cobol?
what happens if parmparameter passes zero bytes to the program
Mention the guidelines to write a structured cobol program?
How to know whether the module is dynamical or statistical?
What is an in line perform? When would you use it? Anything else you wish to say about it.
What are 77 levels used for?
HOw can I get the negative sign while deduct high value from low value
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
how do you reference the variable block file formats from cobol programs
What are the different data types in cobol?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?