lc_root = '\\Server1\ImpData\' lc_file = lc_root+'rawdata\file1.' lc_dbf = lc_root+'rawdbf\rd_zpair.dbf' ln_fh = fopen(lc_file) && open the file from mainframe for input create table (lc_dbf) FREE ( origzip C(3), ; destzip C(3), ; scalenum c(6), ; MinChgUnd I, ; MinChgOvr I, ; L5CRate I, ; M5CRate I, ; M1MRate I, ; M10MRate I, ; M40MRate I ) USE use (lc_dbf) ALIAS File1 && open the output table we created above do while ! feof(ln_fh) * read 97 characters from the file from the mainframe lc_linebuf = fread(ln_fh,97) * and then add a record to File1 using parts of the record read insert into File1 VALUES ( SUBSTR(lc_linebuf,2,3), ; SUBSTR(lc_linebuf,8,3), ; PADL(TRIM(SUBSTR(lc_linebuf,20,5)),6,'0'), ; VAL(SUBSTR(lc_linebuf,27,6)), ; VAL(SUBSTR(lc_linebuf,34,6)), ; VAL(SUBSTR(lc_linebuf,41,6)), ; VAL(SUBSTR(lc_linebuf,48,6)), ; VAL(SUBSTR(lc_linebuf,55,6)), ; VAL(SUBSTR(lc_linebuf,76,6)), ; VAL(SUBSTR(lc_linebuf,90,6)) ) enddo =fclose(ln_fh) USE IN File1