Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert RPG data

Status
Not open for further replies.

rickesilaw

Programmer
Jun 24, 2002
154
CA
Has anyone ever converted rpg data to vfp? We have a client that wants to convert their data.
 
I have converted many files from the IBM midrange S/34, S/36, and AS400, (RPG files). If there are no "packed-decimal" fields, or "signed-numeric" fields; it can be as simple as copying the EBCDIC file to an ASCII file, then importing into a .DBF file. If there are "packed-decimal" or "signed-numeric" fields, you will need an RPG program to create a text file that still needs to be converted to an EBCDIC file to an ASCII file.

Harry
 
Some fields must be packed decimal or signed numeric - is there way to write routine in other language to decode?
 
is there way to write routine in other language to decode

There must be, or it wouldn't have been done. You just need to do a little Google-ing and find what the algorithm is. Work up some pseudo code, and write it out.



-Dave S.-
[cheers]
Even more Fox stuff at:
 
Packed decimal fields contain two digits per byte, (except for the last which has a "zone" character and the last digit). The zoned decimal fields are all digits except for the last byte. If the amount is credit, the last byte will contain the last digit as well as a "zone" to signify a credit.

If the files reside on an IBM midrange computer, (RPG), they are stored in EBCDIC format, this must be converted to ASCII for use in VFP.

The process I use to convert the files is:

1. Write an RPG program to read the file in and create a text file output, "unpacking" the packed-decimal fields, and creating a following "-" after an amount field that is a credit.

2. Then, I use third party emulation software to transfer the file from the host to an attached PC that converts it from EBCDIC to ASCII.

3. Lastly, I write a one-time VFP program to read in the text file and insert the records into the VFP DBF file. For those fields with a credit sign, I multiply the amount field by -1 to get a credit.

If you have no other resources to do this, I do this for customers on a fee-basis.

Harry
 
Hi Harry

We have data on a DOS system - no file structures or programs as converting another systems data. Send me you e-mail and we can discuss this (your fee if we can convince the client).

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top