I have one column say 'X' defined as VARCHAR
Can anyone tell me What are the different ways to update
this column thru COBOL-DB2 program?

Answer Posted / priyanka

If a variable is defined as varchar, the filed will have a
length variable also. Before updating the value 'X', you
need to move the length of the new value to length filed
of 'X'.
Eg: If you want to update 'TEST' in 'X'.

MOVE LENGTH OF 'TEST' TO X-LENGTH
exec sql
UPDATE table
SET X = 'TEST'
Where clause
end-exec

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

668


Define static linking and dynamic linking.

658


In COBOL, what is the different between index and subscript?

752


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

672


how to refer the data field?

1798






Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

813


how to access the file from prodution from changeman tool and to submit a file to production

6667


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2718


Can we redefine the field of x(200) to less than 200?

814


What is rmode(24)

676


What are the different open modes available in cobol?

713


What is static and dynamic call in cobol?

589


What is length is cobol?

641


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

2050


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

2095