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 is the default value(s) for an initialize? What keyword will allow for an override of the default?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What is the default value(s) for an initialize and what keyword allows for an override of the default?
What rules are to be followed while using the corresponding options?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
What kind of error is trapped by on size error option?
How you can read the file from bottom?
how to move the records from file to array table. give with code example
I have a File that has duplicate records. I need only those records that occur more than thrice.?
How do u write test cases?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
What is an in line perform? When would you use it? Anything else you wish to say about it.
How can you get the ksds file records into your cobol program?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning