General information
Category:
Coding, syntax & commands
>>In order to communicate with Sterling Commerce EDI products I need to create a flat file that contains multiple record types. In COBOL I did this with a master record then an infinite number of REDEFINEs for that record for each record type. How does one do this in VFP?
>>
>>Regards/yb
>
>
>Maybe I'm missing something here, but wouldn't
>
>COPY TO (filename) TYPE SDF
>
>work?
We have extensive edi experience for both edi (proprietary formats) and EDI or ansi/edifact formats. For fixed length records we create tables with a single field or as many fields as we need to hold the fixed length strings such as anything longer than 256 characters. To output the flat file we can simply 'copy to path\filename.ext type sdf' We can also use the lo level read and write functionality of fox, fread() fget() fwrite() and fput(). The output of edi type messages usually consists of creating arrays which contain the segments you want and looping through the array and adding the delimiters on the fly. As an aside it is much easier to build translation tables which are of the form
edi table, position, segment name/id, data element #, loop, and a field which either contains the desire data element value or a function to be called via the eval() function. Make your output readable by adding cr/lf to your segment delimiter which can be removed once the format and content check out. hth b
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only