We use something like this to open the files which we have the name
stored in a control record.
READ CUST.HIST.FILELIST FROM CTL.MSTR.FILE, "HIST.FILES" ELSE
ABORT.MSG = 'Missing CTL.MSTR HIST.FILES! '
CALL ERRORLOG ('MAP.CHANGES', ABORT.MSG, 'Aborting', '', '')
RETURN
END
HIST.FILE.CNT = DCOUNT(CUST.HIST.FILELIST,@AM)
DIM CUST.HIST.FILES(20)
MAT CUST.HIST.FILES = ""
FOR FILE.PTR = 1 TO HIST.FILE.CNT
OPEN CUST.HIST.FILELIST<FILE.PTR> TO CUST.HIST.FILES(FILE.PTR)
ELSE
ABORT.MSG = 'Cannot open ':CUST.HIST.FILELIST<FILE.PTR>:'!'
CALL ERRORLOG ('MAP.CHANGES', ABORT.MSG, 'Aborting', '', '')
RETURN
END
NEXT FILE.PTR
Later we have the file name that a customer is in stored in a field of a
cross reference file, we read that then locate the file like so.
READ.OK = FALSE
READV FILE.NAME FROM CUST.HIST.XREF.FILE, CUST.MSTR.ID, 2 THEN
LOCATE FILE.NAME IN CUST.HIST.FILELIST SETTING FILE.FND THEN
HIST.FILE = CUST.HIST.FILES(FILE.FND)
MATREAD CUST.MSTR.ITEM FROM HIST.FILE, CUST.MSTR.ID THEN
READ.OK = TRUE
END
END
END
Hope this helps.
Brenda
-----Original Message-----
From: Dave R [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 05, 2007 4:47 PM
I am trying to open a group of files from a list of files in the table
file.
Does anyone know how to make the constant in the open file statement
work. I
get the good old IMPROPER DATA TYPE error message when I try to read the
file
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/