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 link edit in cobol?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
How do you define a variable of comp-1 and comp-2?
How do get the result of your program directly on your pc?
how do you reference the rrds file formats from cobol programs
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
Give some examples of command terminators?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
What is a scope terminator give example?
How do you differentiate between cobol and cobol-ii?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
Why did you choose to work with ibm mainframe cobol programming?
what is search and searchall?what is the diffrence between them?give an best example?
For rewrite, why is it mandatory that file needs to be opened?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?