I want to Concatenate all elements of a table elements are mon,tue,wed till sun.i want to display them in a single line with appropriate spaces but not able to do.please help me out it's urgent for me.
I have written the following code:-
01 WS-WEEKS.
05 DAY1 PIC X(3) VALUE 'MON'.
05 DAY2 PIC X(3) VALUE 'TUE'.
05 DAY3 PIC X(3) VALUE 'WED'.
05 DAY4 PIC X(3) VALUE 'THR'.
05 DAY5 PIC X(3) VALUE 'FRI'.
05 DAY6 PIC X(3) VALUE 'SAT'.
05 DAY7 PIC X(3) VALUE 'SUN'.
01 WS-WEEKS-TABLE REDEFINES WS-WEEKS.
05 WS-DAYS PIC X(03) OCCURS 7 TIMES.
01 I PIC 9(2) VALUE ZEROS.
01 STR PIC X(35) VALUE SPACES.
01 SPC PIC X(3) VALUE SPACES.
then i m doing this:-
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 7
STRING WS-DAYS(I)
SPC
STR DELIMITED BY SPC
INTO STR
output desired is:-
mon tue wed thr fri sat sun