Skip to main content

This article addresses COBOL search and replace of substrings in a string, the size of searched string and replacing strings being different.

Problem:

When doing a COBOL search and replace of substrings in a string, the COBOL statement INSPECT … REPLACING cannot be used. Why is the size of the searched string and replacing strings different?

Resolution:

The attachment CobSearchReplace.cbl is a COBOL implementation of a ‘search and replace’, the size of searched string and replacing strings being different. This sample was tested on Net Express 5.1 and Server Express 5.1.

Incident Number: 2420505

Old KB# 14755

This article addresses COBOL search and replace of substrings in a string, the size of searched string and replacing strings being different.

Problem:

When doing a COBOL search and replace of substrings in a string, the COBOL statement INSPECT … REPLACING cannot be used. Why is the size of the searched string and replacing strings different?

Resolution:

The attachment CobSearchReplace.cbl is a COBOL implementation of a ‘search and replace’, the size of searched string and replacing strings being different. This sample was tested on Net Express 5.1 and Server Express 5.1.

Incident Number: 2420505

Old KB# 14755

Hello,

Attachment CobSearchReplace.cbl is missing, please add.

Hope i could reuse the cobol program to replace FINDREP in sort.

Thanks

Jay