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

Write the code to count the sum of n natural numbers.

697


What are the rules of the move verb?

695


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

989


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

804


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

810






) How do u handle errors in BMS macro

1500


What is a scope terminator give example?

652


how do you reference the variable unblock file formats from cobol programs

738


What is amode(24)?

679


What is the difference between PIC 9.99 and PIC9v99?

771


Why did you choose to work with ibm mainframe cobol programming?

625


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2050


How many sections are there in data division in COBOL?

675


Give some examples of command terminators?

749


how to convert the recors form vsam file to db2 table tru file aid

2752