Focal Point
[SOLVED] creating csv field

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1547070495

November 21, 2010, 12:59 PM
pwoods
[SOLVED] creating csv field
I'm trying to create a single csv field that builds up as records are output, so that the last record would display a csv containing all the data from previous records within a given group.

I thought I could use something similar to the below but this gives me a format error with the MOD_CSV compute which I dont understand.

TABLE FILE CAR
PRINT
MODEL
COMPUTE CNTR/I3=IF COUNTRY EQ LAST COUNTRY THEN CNTR + 1 ELSE 1;
COMPUTE LAST_MODEL/A50 = IF CNTR EQ 1 THEN ' ' ELSE LAST MODEL;
COMPUTE MOD_CSV/A1000 = IF CNTR EQ 1 THEN MODEL ELSE MOD_CSV||','||LAST_MODEL;
BY COUNTRY
BY MODEL NOPRINT
END

Can someone explain why this doesnt work?

This message has been edited. Last edited by: Kerry,


AIX Server
WebFocus 7.6.11
November 22, 2010, 01:50 AM
Dan Satchell
Your COMPUTE for MOD_CSV is trying to write 1050 bytes (1000 + 50) into a 1000 byte field. Try changing your format from A1000 to A1000V. The 'V' makes the field variable length.


WebFOCUS 7.7.05
November 22, 2010, 05:09 AM
pwoods
Thanks Dan - thats solved it.


AIX Server
WebFocus 7.6.11