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
Explain the configuration section of a cobol program with examples of syntax.
Write a cobol program making use of the redefine clause.
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What kind of error is trapped by on size error option?
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?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What is the difference between next sentence and continue in cobol programing language?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
how do you reference the printer file formats from cobol programs