Hi,
I Have 3 fields which are of length 60 each
Filed1 (A60)
Field2 (A60)
Field3 (A60)
COpmress all these fields into Filed(4) and i need to display it (Filed4) ?
How should i do this ?
Hi,
I Have 3 fields which are of length 60 each
Filed1 (A60)
Field2 (A60)
Field3 (A60)
COpmress all these fields into Filed(4) and i need to display it (Filed4) ?
How should i do this ?
COMPRESS Field1 Field2 Field3 INTO Field4
DISPLAY Field4
or, is there more to the question than what you stated?
steve
I forgot to mention that i have done the compress, but during compilation its giving an error message
’ Element in WRITE/INPUT statement does not fit on 1 line.’
:idea: Why not use PRINT instead of WRITE?
PRINT works with (A) DYNAMIC and automatically split into lines.
:idea: Or use FORMAT (0) LS=248 to expand your output line size?
A third option, if you need the output on one line and you can’t widen the report is to use the AL parameter to shorten what is displayed.
DISPLAY FIELD4 (AL=78)
Its ok if the out put is not in one line. So in this case can i use
Write/Display filed4 (AL = 78 )
Assuming you do not mind “losing” the last 102 characters.
I really think you want PRINT as suggested by Weihnachtsbar.
steve
Since the output hasn’t to fit on one line, you can also redefine the target field #FIELD-4 and then display the redefinitions:
DEFINE DATA LOCAL
1 #FIELD-1 (A60) INIT FULL LENGTH <'1234567890'>
1 #FIELD-2 (A60) INIT FULL LENGTH <'abcdefghij'>
1 #FIELD-3 (A60) INIT FULL LENGTH <'ABCDEFGHIJ'>
1 #FIELD-4 (A180)
1 REDEFINE #FIELD-4
2 #FIELD-1-R (A79)
2 #FIELD-2-R (A79)
2 #FIELD-3-R (A22)
END-DEFINE
COMPRESS #FIELD-1 #FIELD-2 #FIELD-3 INTO #FIELD-4
WRITE
#FIELD-1-R /
#FIELD-2-R /
#FIELD-3-R
END