asdbget-0.2.tar.gz - A utility to retreive AS/400 database files via FTP and translate them to ASCII.
asdbget-0.1.tar.gz - Initial release
asdb2tab.pl - Convert XML data from asdbget to tab delimited (included in version 0.2 and above)
Eraserhead's Home Page (Author of this utility)
I've started using asdbget after a bit of trouble. Hopefully some of my problems will allow you to use the utility sooner. This is a great program to have if you need data from the AS/400 on Linux.
It seems that the DSPFD command produces a smaller record on V4R2 than on the version that was used to develop this utility (V4R4?)
--- ../asdbget.c.orig Thu Jan 27 12:21:21 2000 +++ asdbget.c Tue Feb 8 10:00:17 2000 @@ -247,7 +247,7 @@ FtpLastResponse (nControl)); exit (1); } - get_file ("QTEMP/KEYS", 605, get_fd_data_cb); + get_file ("QTEMP/KEYS", 119, get_fd_data_cb); FtpDelete ("QTEMP/KEYS", nControl); }
Also, I had trouble with XML::Parser and patched with the following to make it happy (you may not need this in ver 0.2):
--- asdbget.c.orig Wed Feb 9 09:44:40 2000 +++ asdbget.c Wed Feb 9 09:50:46 2000 @@ -500,17 +500,17 @@ \n", DATADIR, PACKAGE); fprintf (outf, "\n\ - \n", DTDVERSION, file_lrl); + \n", DTDVERSION, file_lrl); if ((iter = fields) != NULL) { do { - fprintf (outf, " name, iter->type, iter->buffer_offset, iter->buffer_length); if (iter->type == 'P' || iter->type == 'S') - fprintf (outf, " PRECISION=%d", iter->precision); + fprintf (outf, " PRECISION=\"%d\"", iter->precision); fprintf (outf, ">\n %s\n \n", iter->desc); iter = iter->next; }
The final problem I noticed was in my AS/400 file's CCSID which is 37. Your results may vary greatly here, but this worked for three troublesome characters I ran across. (Minor issue in the EBCDIC to ASCII conversion. This should be fixed some day.)
--- asdbget.c.orig Wed Feb 9 09:44:40 2000 +++ asdbget.c Tue Feb 8 10:00:17 2000 @@ -90,7 +90,7 @@ 32, 160, 161, 162, 163, 164, 165, 166, /* 64 - 71 */ 167, 168, 91, 46, 60, 40, 43, 33, /* 72 - 79 */ 38, 169, 170, 171, 172, 173, 174, 175, /* 80 - 87 */ - 176, 177, 93, 36, 42, 41, 59, 94, /* 88 - 95 */ + 176, 177, 33, 36, 42, 41, 59, 94, /* 88 - 95 */ 45, 47, 178, 179, 180, 181, 182, 183, /* 96 - 103 */ 184, 185, 124, 44, 37, 95, 62, 63, /* 104 - 111 */ 186, 187, 188, 189, 190, 191, 192, 193, /* 112 - 119 */ @@ -102,7 +102,7 @@ 209, 126, 115, 116, 117, 118, 119, 120, /* 160 - 167 */ 121, 122, 210, 211, 212, 213, 214, 215, /* 168 - 175 */ 216, 217, 218, 219, 220, 221, 222, 223, /* 176 - 183 */ - 224, 225, 226, 227, 228, 229, 230, 231, /* 184 - 191 */ + 224, 225, 91, 93, 228, 229, 230, 231, /* 184 - 191 */ 123, 65, 66, 67, 68, 69, 70, 71, /* 192 - 199 */ 72, 73, 232, 233, 234, 235, 236, 237, /* 200 - 207 */ 125, 74, 75, 76, 77, 78, 79, 80, /* 208 - 215 */
If you have any comments, suggestions, complaints, etc. feel free to email me: sean at porterfield.net or browse/search the LINUX5250 mailing list archives