• No se han encontrado resultados

4. RESULTADOS

4.1 EL FUNDADOR

4.1.2 ANÁLISIS DE LA ESTRUCTURA DE LOS VALORES

In this section, you will learn the formats of OFM loadable ASCII Flat Files for various table types. You will then create a new OFM project from the text files (provided in the installed program directory).

You MUST load the definition file and the (master) key data file (in that order) first. Most of the ASCII data files do not have to be loaded into your OFM project in order. Load the table definition file (for one or many tables) before loading the data files for those tables. If you choose to create the tables interactively (without using the definition files), they MUST exist before the data files can be loaded.

This is also true if you want to load data into a group table

(different entity key than the key in the master table), as you must define that group entity before OFM can load the data. For example, if you want to load production data at the reservoir level into a table called RES_PROD, the reservoir entity has to be associated (as a sort category, a foreign key, a wellbore, etc.) before load time. The table definition for that table also has to be created beforehand.

OFM automatically recognizes the table types if the text load files have some specific extensions. If the data files don’t have the commonly used extensions that OFM expects, they will be treated as typical data files, and will be parsed into the specified tables.

Here are some commonly used file extensions:

*.def – table definition file

*.xy – master (key) data

*.srt – sort category data

*.dly – daily frequency data

*.prd – monthly frequency data

*.tst – test (sporadic) data

*.lku – lookup data

*.xrf – cross-reference data

*.par – parser (i.e., calculated variable) data

*.dev – deviation data

*.not – note (i.e., plot annotation) data

*.flt – fault data

*.log – log (trace) data

*.mrk – marker data

*.wbd – wellbore diagram data

*.pat – pattern data

*.ano – map annotation data

TIP: Most of the time, each data file contains information from only one table.

Multiple data files can be loaded into one table (appending).

One definition file can hold information of one or more tables.

Multiple files (definition and data) can be loaded into the project at the same time.

OilField Manager 2007 Fundamentals 39

Schlumberger Public

We have constantly used the terms definition file and data file. Not all the tables in OFM require table definitions before load time.

These are tables that do not require table definitions before load time:

• Deviation table

• Fault table

• Marker table Sort category (filter) table

• Pattern table

• Wellbore diagram table

• Parser table*

*Parser table is not a typical table in many ways, even though parser information does get stored in a table.

Viewing the (ASCII) Text Load Files

OFM does expect the text files to follow certain file formats so that it can read and write the data to the database correctly. The files have to contain keywords to designate/separate all information stored in the files. A comprehensive list of all keywords can be searched from the on-line help file provided with the application.

In this procedure, you will study the characteristics of some important table definition and data files in the Demo (usually located in the \\…\Sample Databases\Demo Database\Text Load Files\ directory, where \\…\ denotes your installed OFM program directory).

1. Launch a text editor such as Notepad or WordPad. (If you have already associated the application with the file extension, you can open the file directly from Windows Explorer).

2. Select File > Open.

3. The Open Window displays, select All Files or All Documents from the Files of Type drop-down list.

4. Locate the \Sample Databases\Demo Database\Text Load Files\ from your program directory.

5. Select Demo Definitions File.def.

Schlumberger Public 6. Click Open. The definition file displays, as shown below

(partial file only):

Notes:

• The row beginning with the *Tablename keyword defines the table name, table type and indicates that it will be the master table. The file format is space delimited so whatever text lies between the next two spaces,

consecutive spaces are treated as one, will be the name of the table, followed by the table type and the master table designation.

• In this example HEADERID is the table name and it is a static table and most importantly it is the master table. A project can have as many static tables as desired, but there can only be one master table.

• In the fields/variables section, each field is assigned a data type, text or numeric (with size). As many other PC

applications, OFM has several precision specific numeric types such as INT2, FLOAT, DOUBLE, etc …

• In the definition file, the field’s attributes can be assigned, identified by the keywords such as *pn for Plot Name, *pa for Plot Attribute, *u for Unit, and *mu for Multiplier. These attribute keywords can be searched from the help file.

OilField Manager 2007 Fundamentals 41

Schlumberger Public

• Project Settings keywords may appear in the definition file.

*DateLabel is one of them, denoting the displayed DATE name for the project. For example, a Spanish speaking user can select to use FECHA for date; the user has to insert *DateLabel FECHA at the top of this definition file.

Another Project Settings keyword you may see quite often is *Metric, which alerts OFM to treat the project as in Metric unit system.

• The static master table must be the very first table defined in the primary definition file (there may be many multiple definition files).

• If the table name, variable name, or even the attribute contains two or more words and has space(s) between them (or non-ASCII characters), they should be enclosed in quotes (for instance, MY WELL) for OFM to treat it properly.

• Comment lines have to be started with either comment identifiers // or /*. These lines are just descriptive information and will be ignored by OFM at load time. All texts are case-insensitive.

Now take a look at the definition of the monthly production table named MONTHLYPROD. Scroll down the file and locate the line *TABLENAME MONTHLYPROD Monthly. Notice the structure of the definition file.

Schlumberger Public In this case, MONTHLYPROD is the name of a MONTHLY

table, which has fields like DAYS (an int4 type), OIL (a float type), and more.

7. Continue to scroll up and down the definition file to study other tables, their fields and attributes. Notice the CHOKE and the RES_PROD tables.

The CHOKE table is a DUALKEY SPORADIC table.

Therefore, the *DUALKEY keyword is required after the

*Tablename line.

Likewise, RES_PROD is a GROUP level table. OFM needs to know at which level its data are associated. Thus, the word GROUP is required, followed by the group name. In this case, it is RESERVOIR (a Sort Category).

TIPS – NUMERIC SIZE Numeric Type Value Ranges:

• INT1: -128 to 127

• INT2: -32,768 to 32,767

• INT4: -2,147,483,648 to 2,147,483,647

• UINT1: 0 to 255 (unsigned int1)

• UINT2: 0 to 65,535 (unsigned int2)

• UINT4: 0 to 4,294,967,295 (unsigned int4)

• FLOAT: occupies 4 bytes, 7 decimal places, and values of approximately -3.4E-38 to 3.4E38.

• DOUBLE: occupies 8 bytes, 19 decimal places, and values of approximately -1.7E308 to 1.7E308.

• Knowing the appropriate range of your variable data and assigning the proper size to the variable may help you save memory and improve performance.

TIPS - Reserved Keywords

There are reserved keywords that may be used in the text load files. They have special meanings to OFM and cannot be reused as variable names. The following table is a list of the most commonly used reserved keywords:

*DateLabel *KeyLength *ReadOff

*Day *KeyLimit *Skip

*DD *KeyName *TableName

*DDMMYY *Metric *TVD

*Define *MM *XDelt

*Depth *MMYYDD *YDelt

*End_Define *Month *Year

*EOF *Null *YYMM

*End_Format *Quiet *YYMMDD

*Format *ReadOn

OilField Manager 2007 Fundamentals 43

Schlumberger Public

Analyzing Data Files

The procedures below will assist you in analyzing static data, monthly data, daily data, hourly data and sporadic data.

Static Data

To begin analyzing static data follow the instructions below.

1. Launch any text editor.

2. From the File menu select Open and navigate to the Demo Key Data.XY file located in the Text Load Files directory.

Study the file (please scroll to the right to see all field data).

The variable identifiers exist before the data section, right below the *tablename line. OFM parses data into the

corresponding fields, based on the order they appear on that variable identifier's line.

Monthly Data

To begin analyzing monthly data, follow the instructions below.

1. From the open text editor select Open.

2. Navigate to the Demo Monthly Prod Data.prd file.

Schlumberger Public Notice the *KeyName line. This tells OFM which entity the

next data section will be loaded into (until the next instance of

*KeyName).

3. Scroll down to see the rest of the file.

Daily Data

To begin analyzing daily data follow the instructions below.

1. From the open text editor select Open.

2. Navigate to the Demo Daily Prod.dly file and view the data.

Hourly Data

To begin analyzing hourly data follow the instructions below.

1. Export the Hourly data to notepad.

2. Select Database > Export > Selected Text Load File(s) >

Table Data. The Table to Export window displays.

OilField Manager 2007 Fundamentals 45

Schlumberger Public

3. Select HourlyProd and click OK. The Save As dialog displays.

4. Navigate to the desired save location and click Save.

5. Open the HourlyProd.hly file and view the data.

Sporadic Data

1. From the open text editor select Open.

2. Navigate to the Demo Sporadic Test Data.tst file and view the data.

Schlumberger Public The Sort Category table is a non-defined table. The table

definition is specified at the beginning of the file, between the

*Define and the *End_Define keywords.

In OFM 2007 (as well as in any versions after 2002), it is not mandatory to physically have a Sort Category table in the OFM project. Any field, preferably a text field, from a static table can be used as a category. Refer to the Editing Sort Categories section for additional information.

There are additional text load files provided with the Demo project.

With the help of the instructor, you are encouraged to become familiar with those files, especially the typical format of each file/table.

Study Other Text Format Files

Continue to study the other text file formats in the \…\Text Load Files\ directory.

Exercise 8 Creating a Project from ASCII