I am trying to import an excel spreadsheet and have been successful with the layout and making the new file. The problem I have been struggling with is:
The import has headers in the first row and I dont want them.
I cant seem to capture the 1st record and NOT write it to the output file.
Any ideas or maybe my syntax is missing something.
Thanks
strImportFile = "C:\Windows\Desktop\xl_tj\work.xls" &&TEST ONLY
strImportWorkSheet = "MWP" && TEST & PRODUCTION
strImportShortName = "NU TABLES" &&PROD
strExportFile = "C:\Windows\Desktop\tj\work2.txt" &&TEST ONLY
IMPORT FROM &strImportFile TYPE XL5 SHEET &strImportWorkSheet
SELECT PADL(ALLTRIM(a),1,'0') AS IND, ;
PADL(ALLTRIM(b),3,'0') AS HIC3, ;
PADL(ALLTRIM(c),5,'0') AS GCN, ;
PADL(ALLTRIM(d),11,'0') AS NDC, ;
PADL(ALLTRIM(f),8,'0') AS BegDate, ;
PADL(ALLTRIM(g),8,'0') AS EndDate, ;
PADL(ALLTRIM(LEFT(h,(AT(".",h)-1))),4,'0') AS MWP1, ;
PADR(ALLTRIM(SUBSTR(h,(AT(".",h)+1))),5,'0') AS MWP2 FROM "NU Tables" &&strImportShortName
*DO WHILE NOT EOF()
scan
* SKIP && skip to next record
messagebox(STR(recno(0)))
IF recno(0) = 0 && remove headers
SKIP
Messagebox(left(ind,1))
ELSE
COPY TO &strExportFile TYPE SDF && to COBOL flatfile
ENDIF
endscan
*ENDDO
Tom
GO Canucks!! (Vancouver Canucks Fan)