EasyManua.ls Logo

HP TACL - Figure 4-6 Comparing Two Files

HP TACL
235 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Comparing Files
Accessing Files
107365 Tandem Computers Incorporated 4–13
f2
is an ending field range (optional).
result
is a file that will contain the results of the comparison (optional).
Figure 4-6. Comparing Two Files (Page 1 of 3)
?SECTION fcomp ROUTINE
#FRAME
== Define a character array; the maximum line length is 239
== characters.
#DEF char_array STRUCT BEGIN CHAR column(1:239); END;
== Use the character array to define two STRUCTs that contain
== character arrays. Fcomp uses these STRUCTS to compare
== lines of data.
#DEF line1 STRUCT LIKE char_array;
#DEF line2 STRUCT LIKE char_array;
#PUSH linecount file1_err file1_var file1_prompt
#PUSH file2_err file2_var file2_prompt
#SET linecount 0
== Call the getargs macro to parse FCOMP arguments
[getargs required FILENAME file1
required FILENAME file2
optional NUMBER f1
optional NUMBER f2
optional FILENAME/SYNTAX/ results
]
== Call defaultvars to set defaults if parts of the column
== range were not specified.
[defaultvars f1 1 f2 239]
== Check to make sure the column range is between 1 and 239.
== If not, display a message and exit.
[#IF (f1<1) OR (f1>239) OR (f2<1) OR (f2>239) OR (f1>f2)
|THEN|
#OUTPUT Illegal field range value
#UNFRAME
#RETURN
]

Table of Contents

Related product manuals