I've one string with spaces ( I N D I A ). My question is I
want remove the spaces & combine in to single string without
space (INDIA).How we can write the cobol program & wich
options we need to use. Please let me know.

Answer Posted / mayank rastogi

Use following code: It'll work

MOVE 'I N D I A' TO WS-NAME.

UNSTRING WS-NAME DELIMITED BY ' '
INTO WS-CHAR1, WS-CHAR2, WS-CHAR3, WS-CHAR4, WS-CHAR5.
STRING WS-CHAR1, WS-CHAR2, WS-CHAR3, WS-CHAR4, WS-CHAR5
DELIMITED BY SIZE INTO WS-NAME1.

ws-name1 is the new variable that will contain INDIA
without any spaces

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the difference is between continue and next sentence?

877


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

872


Can we change the password using ALTER? anyone tried and changed?

1750


How to print 10 to 1 if the input have only 10 digit number?

1032


Can you please let me know the centre name of INS certification in Kolkata.

1950


How do you differentiate between cobol and cobol-ii?

865


How do you reference the following file formats from cobol programs?

918


What is amode(24)?

888


Name the divisions, which are available in a cobol program?

931


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5602


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1758


What is Pic 9v99 Indicates in COBOL?

940


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

916


Differentiate between structured cobol programming and object-oriented cobol programming.

842


Name some of the examples of COBOl 11?

2887