The use of the dot on input from

tdi

Progress Fan
I haven't come to understand how to use the dot inside a file that's been used as input.

They use this technique to embed control string on a .df file, and treat the first part as data, and the rest as control.

I would like to use it. The handbook states that the dot is treated as an END-ERROR. but how would it be used in a REPEAT or something block?

Thanks in advance.

Octavio
 
The dot at the end of the data section of the file will generate an End-Error marker to the import, fooling it into not proceeding further.

A normal import will return an End-Error, causing the repeat loop that is reading the file to exit (on endkey undo, leave), thereby failing to read the control block and get messed up.

Progress use this in the Dictionary based Data Load programs (and other places)

To give an example:

<Lots of Data>
.
PSC
filename=ifrindx
records=0000000000342
ldbname=research
timestamp=2002/09/30-09:59:00
numformat=44,46
dateformat=dmy-1950
map=NO-MAP
cpstream=ibm850
.
0000057404

Open the file in the normal way with a named stream

seek stream <stream-name> to end
will reposition the input cursor at the end.

acquire the current offset in the file using
<variable> = seek(s1)

Use seek to reposition to the start of that line with

seek stream <stream-name> to <variable> - 11.

Read the line using an import.

import <variable2>

This gives the position of the first character of the control block.

seek to that position
seek stream <stream-name> to <variable2>.

import the line at that position.
import <CharVar>

If CharVar is PSC then this is a Progress footer and can be read etc by us.

I hope this is the information you wanted
 
Top