Skip to content

OPEN

Open a File on I/O Channel

This directive requests access to a file or device on a designated input/output channel and, if successful, prepares the file or device for communication at its first data record.

OPEN (channel [,ERR=line-ref|,ERC=error-code] [,OPT=file-type]
[,ISZ=record-size] [,SEP=field-sep] [,DEV=dev-string]) file-name
OPEN (channel [,ERR=line-ref|,ERC=error-code], OPT="TEXT|FSEP=char")
file-name
OPEN (channel, OPT="SOCKET") host:port
OPEN (channel, OPT="DDE", ISZ=execute-mode) server|topic
channel
is an integer in the range of 1 to 32764 indicating the channel of an open file or device. If omitted, 0 is the default.
line-ref
is the program line number or label to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.
file-type
is the name of the Thoroughbred Basic file type (in quotations) to assume when OPENing file-name.
record-size
is an integer in the range of 1 to 65000 specifying the number of bytes to be accessed for each READ RECORD directive. This is not necessary unless the programmer wishes to override the existing record size.
field-sep
is a character that separates each field within a record.
dev-string
is a string that represents the configuration of a printer.
file-name
is a string that may contain a fully qualified path and file name up to 255 characters long in OPEN VMS; 64 characters long in UNIX. Can also be the name of a link defined in the system dictionary if OPT="LINK" or OPT="DLINK" is used.
host:port
is the TCP/IP host name and port number of a server you want to communicate with. For more information, please refer to the Using SOCKETS in the Thoroughbred Environment subsection in the REMARKS section.
execute-mode
is the mode of the DDE server when it is opened. Valid values are:
1,5,9
is normal with focus. Any of these values is the default.
2
is minimized with focus.
3
is maximized with focus.
4,8
is normal without focus.
6,7
is minimized without focus.

For more information on establishing a DDE conversation, please refer to the New OPEN directive under Thoroughbred Environment for Microsoft Windows subsection in the REMARKS section.

server
is the name of the DDE server. For more information on establishing a DDE conversation, please refer to the New OPEN directive under Thoroughbred Environment for Microsoft Windows subsection in the REMARKS section.
topic
is the name of the topic the you request from the server. The conversation will occur with the topic. For more information on establishing a DDE conversation, please refer to the New OPEN directive under Thoroughbred Environment for Microsoft Windows subsection in the REMARKS section.

The SEP= field-sep option is not generally used for normal I/O operations. This option is used to change the field separator to a character other than the default, usually $8A$.

The default separator for OPT= options is a vertical bar. This can be changed with a SEP= as the first option. For example, OPT=“SEP=$TEXT$FSEP=|”.

Creating files on VMS with -99 as the sector number will create files that are portable to UNIX and Windows.

If a file is created on VMS and -99 is not specified as the sector number, then an RMS file will be created and this file cannot be moved to UNIX or Windows and processed there.

Files with read-only permission can be opened. For example, the startup files (TCONFIGW, IPLINPUT, etc.) may now be set to read-only permission. Protected files may be read from without fear that someone else can modify their contents. Writing to these files produces an error and the XFD (,0) function can be used to determine if a file has been opened for reading only.

An OPEN directive must be issued for any file or device except this task’s terminal and keyboard or a ghost task’s inter-task communication before any input/output operations can take place.

OPT=“TEXT” takes priority over any ISZ=record-size specification (the ISZ= is ignored).

The ISZ= option should not be specified when OPENing MSORT, TEXT, or TISAM file types.

If the OPT=“TEXT” option is used to OPEN a file that is not a TEXT file, extreme care must be taken when READing data, WRITEing is not recommended. WRITEs may destroy the file’s true structure and corrupt its data.

The OPT=“APPEND” option is used for writing to the end of files opened with OPT=“TEXT”.

The OPT=“OLIB” option is used to OPEN a Thoroughbred Basic object library, a TEXT file which is a collection of Thoroughbred Basic programs in one file, plus a table of contents.

Channel 0 is reserved for the terminal and keyboard of the individual task or the inter-task communication channel for Ghost Tasks (see Program Control, Ghost Tasks). OPEN (0) is not necessary.

An OPEN printer device is unavailable to other tasks until CLOSEd. An OPEN file can be accessed by other tasks, unless that file has been reserved for this task by the LOCK directive.

An OPEN file or device and its channel number are released by the BEGIN, CLOSE, END, or STOP directives.

If an attempt is made to OPEN a channel that is already OPEN, an ERR=14 results.

If channel is negative, non-integer, or greater than 32764, an ERR=41 results.

The ISZ= option is generally not used for normal I/O operations. It is useful for certain system utilities, permitting the user to temporarily address any file as an Index file having a record size specified with the ISZ (internal size) option.

A printer mnemonic table, maintained by Thoroughbred Dictionary-IV, can be assigned to a printer. The “TABLE=” option assigns a specific printer mnemonic table to a printer. The “INITTAB” option reloads a printer mnemonic table that was initially loaded during Thoroughbred Basic startup. For more information on printer mnemonics, pleas refer to the Thoroughbred Basic Customization and Tuning Guide.

The OPT=“LINK” or OPT=“DLINK” option will allow existing Thoroughbred Basic programs to READ/WRITE fixed field data into/from a list of variables using a format to determine how the variables are to be populated by/moved into the data record.

The OPT=”REVERSED” option enables reading of a file in reverse order. On OPEN, the initial file position will be set to the end of the file. The READ [RECORD] and EXTRACT [RECORD] directives will return the previous record and the PREAD [RECORD] and PEXTRACT [RECORD] directives will return the next record. The KEY() function will return the previous key and the PKY() function will return the next key. The FKY() function will return the last key and the LKY() function will return the first key.

The OPT=“SHELL” option enables programmers to access operating system shell
commands, e.g., OPEN (1, OPT=“SHELL”) “ls -l x”.

The configuration of a printer can be temporarily modified, without exiting from Thoroughbred Basic, via the DEV=dev-string option. The format of the dev-string option is as follows:

DEV = “width,lock,type,timeout,command”

width
is a positive integer that specifies the maximum line width.
lock
is a positive integer that specifies whether or not a printer is to be locked out to other Thoroughbred Basic tasks:

0 = locked; default
1 = not locked

type
is a positive integer that specifies a printer type:

0 = direct, no spooling; default
1 = spooled, piped output
2 = slave printer
3 = spooled, /tmp file output

timeout
is a positive integer that specifies the number of seconds to wait for a printer to respond before generating a timeout error (default is 15 seconds).

command a UNIX command that specifies where to send output.

If an attempt is made to OPEN a file or device other than a printer with a DEV= option, an ERR=17 results.

Any attempt made to use a DEV= option to OPEN a printer that has already been OPENed by this task on another channel without a DEV= option results in an ERR=17.

Any attempt made to use a DEV= option to OPEN a printer that has already been reconfigured by this task on another channel results in an ERR=17.

The OPT=“DISK=Dx” option can be used to limit the search for a file to a single logical directory or a range of logical directories. The value of ‘x’ must be ‘0’ through ‘9’ or ‘A’ through ‘Z’ or ‘a’ through ‘z’. ERR=17 will result if Dx does not match a DEV in IPLINPUT for a logical directory. If an equal relation is specified, as in “DISK=Dx”, only the matching logical directory will be searched. If a less than relation is specified, as in” DISK<Dx”, only logical directories in IPLINPUT preceding Dx are searched. If a greater than relation is specified only directories after Dx will be searched. The option may be combined with other options such as OPT=“DLINK,DISK=D8” but must be last in the option list. Care should be taken when using this option to access multiple files with the same name.

If an attempt is made to OPEN a file that cannot be found in the available logical disk directories, an ERR=12 results.

If an attempt is made to OPEN a file that is LOCKed by another task or LOCKed by this task on another channel, an ERR=0 results.

The OPT=“TEXT|FSEP=char” file-name specifies processing of files described in RFC 4180 as Comma-Separated Values or MIME type “text/csv”. The file structure supports variable length records terminated with CRLF containing variable length fields separated by a single character. The FSEP=char specifies a character (no quotes) or a binary $XX$ field separator. The last field in a record will be followed by CRLF instead of the FSEP= character. Care must be taken to ensure that data fields will not contain the FSEP= character.

OPT=“DLINK” file-name will use the Link name not the data file name. An OPEN statement for the sort file (file-namesk) is not required.

OPEN(U,OPT="DLINK")"UTCUST";

Opens the LINK, not the data file.

OPT=“DATA-FILE” file-name will open the named data file. (See OPT=“DLINK example.)

OPT=“SORT-FILE” file-name will open the named sort file. (See OPT=“DLINK example.)

OPT=“TEXT-FILE” file-name will open the named text file. (See OPT=“DLINK example.)

All files specified by the DATA-FILE=, SORT-FILE= and TEXT-FILE= options when opening a link can be validated using the CHECK option. If a specified file’s parameters do not match the specifications of the link, an ERR=17 results.

OPT=“DLINK|DATA=FILE=UTCUST|CHECK|SORT-FILE=UTCUSTsk” works the same as “DLINK|DATA=FILE=UTCUST|SORT-FILE=UTCUSTsk|CHECK”

OPEN(1,OPT="DLINK|DATA-FILE=UTCUST|SORT-FILE=UTCUSTsk|CHECK") "UTCUST"

opens the UTCUST link with UTCUST for the data file and UTCUSTsk for the sort file on channel 1.

OPEN(1,OPT="DLINK|DATA-FILE=UTCUSTsk|SORT-FILE=UTCUST|CHECK") "UTCUST"

results in an ERR=17.

OPEN(1,OPT="DLINK|CHECK|DATA=FILE=UTCUST|SORT-FILE=UTCUSTsk")

results in an ERR=17 because at least one of the ****-FILE= options must be specified.

The file-names specified in the DATA-FILE=/SORT-FILE=/TEXT-FILE= options may not exceed 256 characters.

When opening a LINK with OPT=DLINK|CREATE the data file, secondary key file and text field file will be created if they do not exist.

OPT=LINK/DLINK file name processing includes a file prefix stored in the Common Global Variable name ]PFX$. When opening a link, the file prefix is first cleared. It can then be set in a file suffix method. The file prefix is prepended to the data file, secondary key or text field file name before being opened.

The UNT function and *FID will always return information for the Link when OPENed with the DLINK option, For example:

OPEN(1,OPT="DLINK")"OELCUST"; XS=UNT("OECUSTsk")

will return XS=1

OPT=“DLINK” Example

UTODLNK - Example OPT=DLINK 10/09/01 11:23:02 (1)
===============================================================================
METHOD MSG$[ALL]
* Example Basic code using the 8.50 OPT=DLINK option.
* This example uses the Format UTCUST and the Link UTCUST.
* It requires that the sample data for UTCUST has been generated.
* The option to Generate Sample Files is located on the System
* Administration menu.
*
* The UTCUST Link defines:
* Direct file UTCUST with a text field
* Sort file UTCUSTsk with the following sorts:
* Primary Sort: CUST-CODE
* SORT1: CUST-NAME
* SORT2: REP-CODE
* SORT3: STATE
* SORT4: ZIP-CODE
* SORT5: YTD-SALES(D)
************** Working with Direct files and Sort files *********************
* The secondary keys maintained in a sort file are composed of:
* (1,1) Sort number 1 byte binary +
* (2,n) data elements
*
* CASE SENSITIVE SORTS
* When a sort definition is defined with the C option (case sensitive), the
* case is preserved. The default is not case sensitive.
* Case sensitive strings are stored as:
* CVT(data-element,4096)
*
* On the WRITE, the Basic engine resolves the case based on the Link
* definition. On the READ of a secondary key, the data elements specified
* in KEY= must match the case defined for the sort or an ERR=11 will be
* returned.
*
* DESCENDING SORTS
* When a sort definition is defined with D option (descending order), the key
* value is adjusted force descending order.
* Numeric descending fields are stored as:
* NOT(STR(10000000+NUM(data-element):mask))
* For example UTCUST SORT5 YTD-SALES(D) is adjusted as follows:
* NOT(STR(10000000+NUM(E1$(118,10),NTP=1):"00000000.00"))
* String descending fields are stored as:
* NOT(data-element)
*
* On the WRITE, the Basic engine resolves the descending order based on the
* Link definition. On the READ of a secondary key, the data elements
* specified in KEY= must be match the descending order storage format or an
* ERR=11 returned.
*
************** Working with MSORT files **************************************
* MSORT and TISAM files follow the 'rules' as described in the Basic manual.
*
******************************************************************************
....
PROCEDURE
WINDOW CREATE (80,24,0,0) "BORDER=LG";
PRINT "Example OPEN with OPT=DLINK",'LF',
"This example uses the data from the UTCUST examples",'LF',
"If the sample data has not been generated please exit",'LF',
"<cr> to run the example or <F4> quit";
INPUT *;
IF CTL=4
GOTO CUEXIT
FI;
FORMAT INCLUDE #UTCUST; ! Include format for reads
U=UNT; ! Get available channel
* The OPEN will use the Link name not the data file name. An OPEN statement
* for the sort file UTCUSTsk is not required.
OPEN(U,OPT="DLINK")"UTCUST"; ! Open the LINK, not the data file.
* The KEY function with the SRT=n option will return the corresponding
* secondary key of the current key. This does not change the sort order or
* change the current key pointer.
K$=KEY(U); ! Get current key: cust code "0001"
READ(U); ! Advance key pointer for SORT0.
K$=KEY(U,SRT="2"); ! Get corresponding key for SORT2:
! returns sales rep "003" +
! cust code "0001"
K$=KEY(U); ! Get current key: cust code "0002"
* To establish a new sort order, perform a READ with the SRT=n option.
* This establishes the sort order for all subsequent READ and KEY functions.
READ(U,SRT="2",KEY="", ! Read to position the key pointer
ERC=99); ! at the start of SORT2.
K$=KEY(U); ! Get the first key for SORT2:
! returns sales rep "001" +
! cust code "0002"
READ(U)#UTCUST; ! Read the corresponding data area and
! advance the key pointer.
* Change UTCUST.REP-CODE and update files.
* Only one WRITE statement using the primary key is required. On the WRITE
* statement the KEY= is not specified. If a KEY= was supplied, it would be
* ignored. ALL KEY VALUES are resolved by the Basic engine based on the
* Link definition. In addition, all secondary keys in UTCUSTsk are maintained
* for you by the Basic engine.
#UTCUST.REP-CODE = "999"; ! Change the sales rep code.
WRITE(U)#UTCUST; ! Write data back to the link.
! Both the data of the primary key
! is updated as well as ALL secondary
! keys in UTCUSTsk.
K$= ! Build SORT2 key to read data:
CHR(2)+ ! sort nbr as 1 byte binary +
#UTCUST.REP-CODE+ ! sales rep code +
#UTCUST.CUST-CODE; ! cust code
FORMAT INIT #UTCUST; ! Initialize data area.
READ(U,KEY=K$)#UTCUST; ! Read the data with new SORT2 key.
* Change current sort, set sort to SORT0
READ(U,SRT="0",KEY="",ERC=99); ! Read with new Sort number and
! position at start of SORT0.
K$=KEY(U); ! Get the first key.
READ(U)#UTCUST; ! Read the record.
* Change primary key: Add new record.
* All secondary keys are maintained for you, all the new secondary keys will
* be added to UTCUSTsk by the Basic engine.
OLDKEY$=#UTCUST.CUST-CODE, ! Save old key for delete
#UTCUST.CUST-CODE="0000"; ! Change cust code
WRITE(U) #UTCUST; ! Write the new record to the link:
! do not use KEY=
FORMAT INIT #UTCUST; ! Initialize data area.
READ(U,KEY="0000")#UTCUST; ! Read data, current sort is SORT0.
K$=KEY(U); ! Get next key.
* Change sort order to SORT1
READ(U,SRT="1",ERC=99); ! Read with SRT= to establish SORT1.
! Build secondary key, this includes
! the sort number:
K$=CHR(1)+ ! sort number 1 byte binary +
CVT(#UTCUST.CUST-NAME,4096)+ ! cust-name all lower case:
! (sort 1 is defined as not
! case sensitive) +
#UTCUST.CUST-CODE; ! cust-code.
READ(U,KEY=K$)#UTCUST; ! Read the corresponding data.
K$=KEY(U); ! Get next key.
READ(U, ! Read the link using sort 2,
SRT="2", ! specify the sort and
KEY=CHR(2)+ ! supply the full
#UTCUST.REP-CODE+ ! secondary sort
#UTCUST.CUST-CODE)#UTCUST; ! key.
K$=KEY(U); ! Get next key
* Delete primary key. All secondary keys are maintained for you, all
* secondary keys will be removed from UTCUSTsk by the Basic engine.
* NOTE: all corresponding text records will also be deleted. The REMOVE of
* a key is the only case where text records are managed by the Basic engine.
REMOVE(U,KEY=OLDKEY$); ! Remove the old primary key and all
! secondary keys and text records
! are removed by the Basic engine.
PRINT "Example OPT=DLINK complete, <cr> to exit";
INPUT *;
GOTO CUEXIT

Using SOCKETS in the Thoroughbred Environment

OPT=”SOCKET” directs OPEN to establish a TCP/IP socket connection to a server. The server must be accepting connections. The host:port string specifies a host name or IP address followed by a colon and a port number. An ERR=17 indicates the host name cannot be resolved into an IP address. An ERR=13 indicates there was no response from the specified host and port.

The READ, READ RECORD, WRITE and WRITE RECORD directives can be used to receive and send data through the socket. The READ directive will receive data up to a $0A$ or $0D0A$ sequence. The READ RECORD directive will receive data until the SIZ= is satisfied. If a TIM= option is specified without a SIZ= option, any data received before a time out will be returned to the program without an error.

Basic Server-side Sockets

Startup

On the startup line, specify the socket to listen on:

./basic SOCKET=socket IPLFILE

Where socket is a numerical socket value to listen on.

ERR=13 results when trying to READ or WRITE to a socket if no socket was specified at startup (see code below).

Using Sockets

This is a listening (i.e. passive) socket, so a READ is done first on channel 0 as shown in the following example:

READ(0, OPT="SOCKET" [,TIM=timoutval]) A$

You can perform multiple READ and WRITE directives. The conversation is only terminated with:

WRITE(0,OPT="SOCKET|CLOSE") "some data going back"

Using the TIM= option is recommended to prevent the appearance that Basic hangs. If no TIM= is present, the READ will wait for a connection indefinitely.

New OPEN directive under Thoroughbred Environment for Microsoft Windows

DDE conversations are established using the file I/O subsystem. A DDE conversation is started by opening a channel to a server application. All communications will occur through this channel or channels.

The syntax of the new OPEN directive that enables you to start a conversation is:

OPEN (channel, OPT="DDE" [, ISZ=execute-mode]) server|topic
channel
is an integer in the range of 1 to 32764 indicating the channel of an open file or device. If omitted, 0 is the default.
execute-mode
is the mode of the DDE server when it is opened. Valid values are:
1,5,9
is normal with focus. Any of these values is the default.
2
is minimized with focus.
3
is maximized with focus.
4,8
is normal without focus.
6,7
is minimized without focus.
server
is the name of the DDE server.
topic
is the name of the topic the you request from the server. The conversation will occur with the topic.

The WRITE RECORD directive enables you to perform POKE or EXECUTE operations on the topic:

WRITE RECORD (channel, SRT="operation", KEY="item") Data$
channel
is an integer in the range of 1 to 32764 indicating the channel of an open file or device. This value must match the value specified in an OPEN directive.
operation
is the type of operation to perform. Valid values are POKE or EXECUTE.
item
is the name of the item you plan to POKE or EXECUTE.
Data$
is the data you plan to POKE or EXECUTE.

The READ RECORD directive enables you to perform a REQUEST operation:

READ RECORD (channel, KEY="item") Data$
channel
is an integer in the range of 1 to 32764 indicating the channel of an open file or device. This value must match the value specified in an OPEN directive.
item
is the name of the item that will provide the data you request.
Data$
is a string variable that will contain the requested data.

The CLOSE directive enables you to terminate the DDE conversation:

CLOSE (channel)
channel
is an integer in the range of 1 to 32764 indicating the channel of an open file or device. This value must match the value specified in an OPEN directive.

Terminating a DDE conversation does not always terminate the server product. To terminate the DDE server you can execute the server’s QUIT command, or the equivalent command, before you use the CLOSE command.

The Thoroughbred Environment can also act as a DDE server. It uses B as its application name and BASIC as the topic. It can accept EXECUTE or POKE transactions of text strings only. It will append a carriage return to the text string and put the string into the keyboard buffer.

Example of Thoroughbred Environment as a DDE client

OPEN(1,OPT="DDE",ISZ=7) "Excel|System"
OPEN(2,OPT="DDE") "Excel|Sheet1"

The first OPEN directive opens Microsoft Excel on channel 1. The window is minimized without focus. The second OPEN command opens the Microsoft Excel spreadsheet named Sheet1 on channel 2.

You can size the Thoroughbred window and the Excel window so that you can view them both. Make sure the Thoroughbred window has the focus before you issue the following commands:

WRITE RECORD(2,SRT="POKE",KEY="R1C1") "500"
WRITE RECORD(2,SRT="POKE",KEY="R2C1") "300"

These two directives populate the first two cells of column 1 with values of 500 and 300.

Make the Excel window the active window and enter a value in Row 3, Column 1. To read the value, make the Thoroughbred window active and enter the following commands:

READ RECORD(2,KEY="R3C1") A$
PRINT A$

The READ RECORD directive retrieves the value you placed in Row 3, Column 1 of Sheet1 and places the value in A$. The PRINT command prints the value.

Make the Excel window the active window and terminate the Excel application. You can issue the following commands:

CLOSE(2)
CLOSE(1)

These two directives close the channels on which the DDE conversation was established.

Starting with release 8.7.1 the “CTC=#” option can be used with the LINK option to override an SQL DataServer’s commit count on the specified channel.

Specifying the “CTC=#” option on a channel that is not opened to a table via one of the SQL DataServers results in an ERR=17.

Specifying a commit count greater than 65535 results in an ERR=17.

Starting with release 8.8.0 the “SID=server-id”, “TABLE-NAME=table-name” and “TEXT-FILE=text-table-name” can be used with the LINK option to override the server id, table name and text field table name when opening a table via an SQL DataServer.

OPEN (1) "INDEX"

assigns channel number 1 to the file INDEX for use in any I/O operations.

OPEN (2) "LP"

assigns channel number 2 to the device named LP (parallel printer) and restricts access by any other task to that device until it is CLOSEd.

OPEN (CHANNEL_NUMBER, ERR=7999, ISZ=32) FILE_NAME$

if CHANNEL_NUMBER = 1, FILE_NAME$ = “INDEX”, assigns channel number 1 to the file INDEX, forcing a record size of 32 bytes, and branches to statement 7999 if this directive produces an error.

OPEN (3,OPT="TEXT",ISZ=80) "VI-FILE"

assigns channel number 3 to the file named VI-FILE and OPENs it as a TEXT file; the record size specified by ISZ=80 is ignored.

OPEN (C,OPT="OLIB") LIBFILE$

opens an object library and loads its table of contents into memory.

OPEN(5,OPT=”TABLE=HPLJ+",ERR=8000) "PW"

assigns channel number 5 to the device named PW and loads a printer mnemonic table
named “HPLJ+” from the system dictionary. If an error occurs, statement 8000 is executed.

OPEN (CHL,DEV="80,,1,5cat>print.file") "P0"

OPENs the printer P0 and reconfigures it to be 80-characters wide, locked out to other Thoroughbred Basic tasks, pipe-spooled, have a five-second timeout, and be loaded into a UNIX file named print.file.

FORMAT INCLUDE #OEFCUST;
CLEAR ERC;
FORMAT DELETE #OEACUST,ERC=86;
FORMAT INCLUDE #OEFCUST, OPT=”ALIAS=#OEACUST”
OPEN(1,OPT="DLINK|ALIAS=#OEACUST") "OELCUST"

loads the format named “OEFCUST”, deletes the format alias named “OEACUST”, creates the format alias “OEACUST” from the format named “OEACUST”and then opens the link on channel 1 using the format alias “OEACUST” for I/O processing.

FORMAT INCLUDE #SQFTBL01;
CLEAR ERC;
FORMAT DELETE #SQATBL01,ERC=86;
FORMAT INCLUDE #SQFTBL01, OPT=”ALIAS=#SQATBL01”
OPEN(1,OPT="LINK|ALIAS=#SQATBL01") "SQLTBL01"

loads the format named “SQFTBL01”, deletes the format alias named “SQATBL01”, creates the format alias “SQATBL01” from the format named “SQFTBL01”.and then opens the table on channel 1 using the format alias “SQATBL01” for I/O processing.

SET CTC "DS",100;
OPEN(1,OPT="LINK|CTC=25") "SQLTBL01"

sets the commit count to 25 on channel 1 after the commit count has been changed to 100 for the SQL DataServer being accessed via “DS”.

For the next 3 examples, the values for the SQLTBL01 link are as follows:
Server ID: DS
Table Name: SQLTBL01
Text Field Table Name: SQLTBL01_TXT

OPEN(1,OPT="LINK|CREATE|SID=S2") "SQLTBL01"
OPEN(2,OPT="LINK|TEXT|SID=S2") "SQLTBL01"

creates the table “SQLTBL01” and text field table “SQLTBL01_TXT” on SQL DataServer “S2” then opens the table “SQLTBL01” on channel 1 and opens the text field table “SQLTBL01_TXT” on channel 2.

OPEN(1,OPT="LINK|CREATE|TABLE-NAME=NEWTBL01|TEXT-FILE=NEWTBL01_TXT")
"SQLTBL01"
OPEN(2,OPT="LINK|TEXT|TEXT-FILE=NEWTBL01_TXT") "SQLTBL01"

creates the data table “NEWTBL01” and text field table “NEWTBL01_TXT” on SQL DataServer “DS” then opens the data table “NEWTBL01” on channel 1 and opens the and text field table “NEWTBL01_TXT” on channel 2.

OPEN(1,OPT="LINK|CREATE|SID=S2|TABLE-NAME=NEWTBL01|TEXT-
FILE=NEWTBL01_TXT") "SQLTBL01"
OPEN(2,OPT="LINK|TEXT|SID=S2|TEXT-FILE=NEWTBL01_TXT") "SQLTBL01"

creates the data table “NEWTBL01” and text field table “NEWTBL01_TXT” on SQL DataServer “S2” then opens the data table “NEWTBL01” on channel 1 and opens the and text field table “NEWTBL01_TXT” on channel 2.

CLOSE, LOCK, TEXT, and UNLOCK directives

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF