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
What the difference is between continue and next sentence?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
Can we change the password using ALTER? anyone tried and changed?
How to print 10 to 1 if the input have only 10 digit number?
Can you please let me know the centre name of INS certification in Kolkata.
How do you differentiate between cobol and cobol-ii?
How do you reference the following file formats from cobol programs?
What is amode(24)?
Name the divisions, which are available in a cobol program?
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?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What is Pic 9v99 Indicates in COBOL?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Differentiate between structured cobol programming and object-oriented cobol programming.
Name some of the examples of COBOl 11?