String Palindrome Program In Cobol



COBOL Programming: how we do palindrome program in cobol. Code: 01 WS-PAL PIC X(3) VALUE 'WOW' IF WS-PAL = FUNCTION REVERSE(WS-PAL) THEN. C Program to Print String C Program to Add n Number of Times C Program to Generate Random Numbers C Program to Check whether the Given Number is a Palindromic C Program to Check whether the Given Number is a Prime C Program to Find the Greatest Among Ten Numbers C Program to Find the Greatest Number of Three Numbers C Program to Asks the User For a Number Between 1 to 9 C Program to Check.

  1. String Palindrome Program In Cobol Compiler
  2. String Palindrome Program In Cobol Tutorial
  3. String Palindrome Program In Cobol Programming
  4. String Palindrome Program In Cobol Tutorial
  5. Cobol Find String In String
  6. Cobol String Replace
  • COBOL Tutorial
  • COBOL Useful Resources
  • Selected Reading

String handling statements in COBOL are used to do multiple functional operations on strings. Following are the string handling statements −

  • Inspect
  • String
  • Unstring

Inspect

Inspect verb is used to count or replace the characters in a string. String operations can be performed on alphanumeric, numeric, or alphabetic values. Inspect operations are performed from left to right. The options used for the string operations are as follows −

Tallying

Tallying option is used to count the string characters.

Syntax

Following is the syntax of Tallying option −

The parameters used are −

  • input-string − The string whose characters are to be counted.
  • output-count − Data item to hold the count of characters.

Example

Mac os x lion boot camp. Boot Camp is a utility that comes with your Mac and lets you switch between macOS and Windows. Download your copy of Windows 10, then let Boot Camp Assistant walk you through the installation steps for Intel-based Macs. Get started with Boot Camp. In macOS, choose Apple menu System Preferences, then click Startup Disk. Click the lock, type an administrator name and password, then click Unlock. Select the startup disk that has the default operating system you want to use. If you want to start up using the default operating system.

JCL to execute the above COBOL program.

When you compile and execute the above program, it produces the following result −

Replacing

Cobol

String Palindrome Program In Cobol Compiler

Replacing option is used to replace the string characters.

Syntax

Following is the syntax of Replacing option −

The parameter used is −

  • input-string − The string whose characters are to be replaced from char1 to char2.

Example

JCL to execute the above COBOL program.

When you compile and execute the above program, it produces the following result −

String

String verb is used to concatenate the strings. Using STRING statement, two or more strings of characters can be combined to form a longer string. ‘Delimited By’ clause is compulsory.

Terms

Syntax

String Palindrome Program In Cobol

Following is the syntax of String verb −

Following are the details of the used parameters −

  • ws-string1 and ws-string2 : Input strings to be concatenated
  • ws-string : Output string
  • ws-count : Used to count the length of new concatenated string
  • Delimited specifies the end of string
  • Pointer and Overflow are optional

String Palindrome Program In Cobol Tutorial

Example

JCL to execute the above COBOL program −

String Palindrome Program In Cobol Programming

When you compile and execute the above program, it produces the following result −

Unstring

Unstring verb is used to split one string into multiple sub-strings. Delimited By clause is compulsory.

Syntax

String Palindrome Program In Cobol Tutorial

Following is the syntax of Unstring verb −

Example

Cobol Find String In String

JCL to execute the above COBOL program −

Cobol String Replace

When you compile and execute the above program, it produces the following result −