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

How many bytes S(8) comp field occupy and its maximum value?

1638


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

686


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1933


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

645


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

859






Can we redefine the field of x(200) to less than 200?

822


) how do u code after getting data?

1582


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

711


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1962


how can i see junk values in dclgen or in hostvariable of comp ?

2546


HOw can I get the negative sign while deduct high value from low value

1797


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

427


How do you reference the fixed block file formats from cobol programs

709


What are various search techniques in cobol? Explain.

650


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

1717