home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!VTVM1.BITNET!USDGK
- Organization: Computing Center, Virginia Tech.
- Message-ID: <SPIRES-L%92122111185974@PUCC.PRINCETON.EDU>
- Newsgroups: bit.listserv.spires-l
- Date: Mon, 21 Dec 1992 10:56:44 EST
- Sender: SPIRES Conference List <SPIRES-L@PUCC.BITNET>
- From: Greg Kroll <USDGK@VTVM1.BITNET>
- Subject: detecting end-of-file with a line-by-line input format
- Lines: 63
-
- I hope someone can help me out with this. I have a line-by-line input
- format for which I am NOT able to detect when the end of the input data
- (file) is reached. According to what I read the $ENDATA variable should
- be set (true=1) when the format executes a GETDATA after the last line
- of data has been read, a subsequent GETDATA would cause an S808 error.
- The problem is this format is NOT setting $ENDATA and somehow already
- knows it is at the end of the input file. I need to test for this
- condition so I can do some processing before exiting the format.
- Here are the important (I hope) parts of the format.
-
- ...
- FRAME-ID = READ.MAIL;
- DIRECTION = INPUT;
- FRAME-DIM = 0,80;
- USAGE = FULL;
- LABEL;
- uproc = if $ftrace then * 'Executing first label group of format';
- ...
- FORMAT-NAME = TESTMAIL;
- ACCOUNTS = USDGK;
- ALLOCATE = USDGK:CHIPMAIL;
- FRAME-NAME = READ.MAIL;
- FRAME-TYPE = DATA;
-
- Trace of format execution:
-
- ...
- ->
- input add
- * Format TESTMAIL
- * Format TESTMAIL
- Enter frame READ.MAIL <<== multiple records added
- Executing first label group of format
- ... <<== last line of input file read
- Leave frame READ.MAIL; at label no. 19
- * Leave format
- - ADD @Line 267 Key = 71 <<== adds last record to database
- * Format TESTMAIL <<== reenters format
- Enter frame READ.MAIL
- * Leave format <<== never executes first label
- * Format TESTMAIL <<== group, simply exits format
- * Format TESTMAIL <<== no getdata executed
- * Leave format <<== $endata = 0
- ->
-
-
- As you can see when the format is reentered the last time it should try to
- read the input file, discover it is at the end-of-file, set the $endata
- flag, then exit according to a test of this condition in the format.
- None of this ever occurs, it simply enters the format the last time and
- exits. How does it know it is at the end of the file? Why are no label
- groups processed the last time though?
-
- What I would like to do is reinitialize the variables in the local vgroup
- and issue a subsequent input add command. I cannot do this from an initial
- frame since this is NOT a report format. I can always reissue the SET FORMAT
- command to reinitialize the variables but I was trying NOT to do this,
- as sometime down the road I may forget and mess up the input add operation.
- If anyone can think of a better way to get the variables reinitialized
- I am open to suggestions.
-
-
- --Greg Kroll
-