May 11, 2010, 07:04 AM
Dan SatchellI see a couple of issues with your code:
1. Your DEFINE syntax is not quite correct.
2. You are missing a verb (PRINT, SUM) in your TABLE request.
3. Using a DEFINE assumes the data is already sorted in proper order; if not, you should sort the data in your TABLE request and use a COMPUTE instead of a DEFINE.
4. Using a variable length field (A800V) with hard concatenation (||) is simpler and safer than using function SUBSTR, unless you use function ARGLEN in conjunction with SUBSTR.
Your code should probably look more like this:
TABLE FILE RESERV
PRINT
COMPUTE LG_4CMD/A800V = IF ITEM2 EQ LAST ITEM2 THEN (LG_4CMD || (' ' | CHAMP)) ELSE CHAMP ; AS 'Liste des Cmdes magasin'
BY ITEM2 NOPRINT
BY CHAMP NOPRINT
ON TABLE HOLD AS TAB_FINA FORMAT HTMTABLE
END
.
.
.
May 15, 2010, 05:38 AM
Ram Prasad EAre you looking for something like this?
TABLE FILE CAR
BY COUNTRY
BY CAR
ON TABLE HOLD
END
DEFINE FILE HOLD
CAR_CON/A400V=IF COUNTRY EQ LAST COUNTRY THEN (CAR_C|| (' ' | CAR)) ELSE CAR;
END
TABLE FILE HOLD
SUM
LST.CAR_CON AS 'Car Concatenated'
BY COUNTRY AS 'Country'
END
May 17, 2010, 09:50 AM
GamPI think this may be helpful:
DEFINE FILE CAR
CR/A1=HEXBYT(10,CR);
TESTSTR/A200V = IF COUNTRY EQ LAST COUNTRY THEN
TESTSTR || CR || CAR ELSE CAR;
END
TABLE FILE CAR
PRINT TESTSTR
ON TABLE PCHOLD FORMAT EXL2K
END
Hope this helps ...
May 17, 2010, 10:31 AM
YazidYSLHello,
Yes it works is fantastic,
thank you for all.