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 / nk
05 MY-NUM-ALPHA PIC X(9).
05 MY-NUM REDEFINES MY-NUM-ALPHA PIC S9(17) COMP-3.
MOVE 'ABCDEFGHI' to MY-NUM-ALPHA.
note that comp-3 stores 2 numbers per byte so 17 digits
takes 9 bytes (half of one byte stores the sign.) So you
could move a 19-character variable to a 9-byte field but it
will be truncated.
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is the difference between Call and a Link?
what happens if parmparameter passes zero bytes to the program
What are the rules of the move verb?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is a report item?
What guidelines should be followed to write a structured cobol prgm?
What is the difference between goback, stop run and exit program in cobol?
what are decleratives in cobol?
What are the different rules for performing sort operation?
What is the difference between comp and comp-3 usage?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
What is the problem of ordered sequential files access?