I have the file which is having the extension no as records.
sample file will look like below.
2310
3410
3256
4350
3781
5408
I need to replace the record which is starting with 3 to 5
(i.e) 3410 to 5410. How can we do it through cobol
and cobol-db2 program? I need the possible logic?
Answer Posted / thavasi
The answer is:
move each record to WS-REC PIC X(04).
then write the below statment to be executed for each rec.
INSPECT WS-REC REPLACING LEADING '3' by '5'.
why am i using LEADING instead of FIRST is that the
requirement says that 'STARTING with 3 by 5'
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
Explain the configuration section of a cobol program with examples of syntax.
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
how can i see junk values in dclgen or in hostvariable of comp ?
Write a program to explain size error.
Which division and paragraphs are mandatory for a COBOL program?
) how do u code after getting data?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
Explain how you can characterize tables in cobol?
What are the various section in data division and briefly explain them.
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Write down the divisions of cobol program?
What is the difference between Global and External Variables?
Write the code implementing the perform … varying.
I have a File that has duplicate records. I need only those records that occur more than thrice.?