Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equiv. to COBOL Redefine
Message
From
07/03/1998 23:42:01
Bob Thickens
Empire Medical Review Services, Inc
Mequon, Wisconsin, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00083230
Message ID:
00083254
Views:
21
>>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
Map
View

Click here to load this message in the networking platform