String palindrome program in cobol5/26/2023 ![]() ![]() More UNSTRING Examples: 01 WW-UNSTRING.Ġ1 WW-U4-INPUT PIC X(12) VALUE 'AAA B CCCC '. Name-in-string is ‘mahender,ramu, robert,phil,Chris’, these can be separated as below UNSTRING NAME-IN-STRING DELIMITED BY ','ĮND-UNSTRRING. Here we have used the delimiter SPACE, but we can use any other delimiter as well.įor ex: if we have a string with name list seperated by commas and we want to exatract each name into an array. NAME-OUT is ‘Mahender Reddy G ‘ and it needs to be divided into first name, last name and initial it can be done using unstring verb. UNSTRING verb is used to unstring/divide the source string into different sub-strings. Now NAME-OUT would be ‘Mahender Reddy G ‘. If we want to further modify the output, it can also be done using STRING STRING So this can be avoided by using the STRING function. If you display the ‘name-in’ it shows like ‘ Mahender Reddy G ‘ i.e: it shows the full length of each variable INCLUDING THE SPACES. ![]() String is used to combine two or more strings/variables in to a single string.Ġ5 first-name pic x(10) value 'Mahender ' STRING AND UNSTRING with examples: TALLYING and COUNT options
0 Comments
Leave a Reply. |