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
What type of SDLC u followed? Why?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
What is the Purpose of POINTER Phrase in STRING command in COBOL?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
In COBOL programming, what is PERFORM? What is VARYING?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
how do you reference the rrds file formats from cobol programs
what is s000 u4087 error? please give the all error codes in cobol,jcl.
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
What is the difference between Global and External Variables?
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
What are the different rules for performing sort operation?
What are the different rules of SORT operation?
how do you reference the esds vsam file formats from cobol programs
How do get the result of your program directly on your pc?