Text : Reads table from a text file using the ODBC Text Driver
Example of using SQL2GMS to read text files using the ODBC Text Driver
Note: uses schema.ini
Files: Text.gms ODBCData.txt ODBCData2.txt Schema.ini
$ontext
Example of using SQL2GMS to read text files using the ODBC Text Driver
Note: uses schema.ini
$offtext
set i /SEATTLE,SAN-DIEGO/;
set j /NEW-YORK,CHICAGO,TOPEKA/;
$onecho > fixedtextcmd.txt
C=DRIVER={Microsoft Text Driver (*.txt; *.csv)};DBQ=%system.fp%;
Q=select city1,city2,distance from ODBCData.txt
O=fixed.inc
$offecho
$call =sql2gms @fixedtextcmd.txt
parameter p1(i,j) /
$include fixed.inc
/;
display p1;
$onecho > separatedtextcmd.txt
C=DRIVER={Microsoft Text Driver (*.txt; *.csv)};DBQ=%system.fp%;
Q=select city1,city2,distance from ODBCData2.txt
O=fixed2.inc
$offecho
$call =sql2gms @separatedtextcmd.txt
parameter p2(i,j) /
$include fixed2.inc
/;
display p2;