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


Please Help Members By Posting Answers For Below Questions

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?

1806


Difference between cobol and cobol-ii?

707


how to move the records from file to array table. give with code example

2219


What is the difference between Call and a Link?

700


What are declaratives and what are their uses in cobol?

714






what happens if parmparameter passes zero bytes to the program

1667


Mention the guidelines to write a structured cobol program?

620


How to know whether the module is dynamical or statistical?

656


What is an in line perform? When would you use it? Anything else you wish to say about it.

645


What are 77 levels used for?

659


HOw can I get the negative sign while deduct high value from low value

1790


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

712


how do you reference the variable block file formats from cobol programs

687


What are the different data types in cobol?

797


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2060