You are on page 1of 34

Usi ng Peopl eSof t Fi l e Layout

(Thi r d Par t y Admi ni st r at or Fi l e Gener at i on)


( y )
J udi Doolittle, OCP, Oracle ACE
Natasha Garcia
S di N i l L b i Sandia National Laboratories
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
What w e w i l l c over
Writing Data to a Flat File
Methods to Read and Write (Plain Text Files)
Writing Files (Defined by a File Layout)
Creating an App Engine (to Export Data to
Flat File)
Creating Multilevel File Layout
PeopleCode for Multilevel File Layout
Segments in File Layout
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Wr i t i ng Dat a t o a Fl at Fi l e
File Class Methods
ReadLine (string)
Wit Li ( t i ) WriteLine (string)
WriteString (string)
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Peopl eCode Ex ampl e
Local string &string; Local string &string;
Local File &Myfile, &Myfile2;
&MyFile =GetFile(test txt R); &MyFile = GetFile( test.txt , R );
&MyFile2 = GetFile(c:\temp\test2.txt, W, %FilePath_Absolute);
If &M Fil I O Th If &MyFile.IsOpen Then
While &Myfile.ReadLine(&string);
&MyFile2.WriteLine(&string);
E d Whil End-While;
End-If;
&M Fil Cl () &MyFile.Close();
&MyFile2.Close();
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Peopl eCode Ex ampl e
L l X lD &i ld Local XmlDoc &inxmldoc
/* load message to file */
&xmlfile =GetFile("IB MSG TEMP xml" "W"); &xmlfile = GetFile("IB_MSG_TEMP.xml", "W");
If &xmlfile.IsOpen Then
&xmlstring =&inxmldoc GenFormattedXmlString(); &xmlstring = &inxmldoc.GenFormattedXmlString();
&xmlfile.WriteString(&xmlstring);
&xmlfile.Close(); &xmlfile.Close();
End-If;
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Met hods t o Read and Wr i t e Met hods t o Read and Wr i t e
(Pl ai n Tex t Fi l es)
WriteRecord- writes the contents of a record
object to the file. You can use this to write
one file record at a time and not have to one file record at a time and not have to
instantiate and populate a rowset object.
WriteRowset- writes the contents of a rowset
object rowset to the output file associated object, rowset, to the output file associated
with the file object that calls the method.
Calling this method one time writes the entire g
contents of the rowset to the file.
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Cr eat eRow set
Local Rowset &rs_carry_desig;
&rs_carry_desig =
CreateRowset(Record.AV_DESIGNATION);
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Cr eat eSQL Func t i on
I t ti t SQL bj t f th SQL l th it Instantiates a SQL object from the SQL classthen it
opens it on the sqlstring and/or input values.
The sqlstring is the parameter that holds the SQL The sqlstring is the parameter that holds the SQL
statement
SQL errors will cause PeopleCode to terminate with
an error
MetaSQL
%SelectAll is a way to select everything in a record %SelectAll is a way to select everything in a record
Tip: Remember to wrap DateTime fields with %DateOut,
%TimeOut, %DateIn, and %TimeIn
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Peopl eCode Ex ampl e
L l R d & 1 Local Record &rec1;
Local SQL &SQL;
/*Create Instance of Record */
&rec1 =CreateRecord(record tc help me tbl); &rec1 = CreateRecord(record.tc_help_me_tbl);
/*Create SQL object to populate rowset */ / Create SQL object to populate rowset /
&SQL = CreateSQL(%selectall(:1), &rec1);

N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Wr i t i ng Fi l es usi ng Fi l e Layout
Local File &M File Local File &MyFile;
Local Record &rec1;
Local SQL &SQL1;
/*Create Instance of Record */
&rec1 = CreateRecord(record.tc_help_me_tbl);
&MyFile = GetFile(c:\temp\help me.txt, A, %FilePath Absolute); y ( p p_ , , _ );
&MyFile.setFileLayout(FileLayout.help_me);
/*Create SQL object to populate rowset */
&SQL1 =CreateSQL(%selectall(:1) &rec1); &SQL1 = CreateSQL( %selectall(:1) , &rec1);
While &SQL1.Fetch(&rec1)
&MyFile.WriteRecord(&rec1);
End-While;
&MyFile.Close();
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Cr eat i ng an App Engi ne Cr eat i ng an App Engi ne
(t o Ex por t Dat a t o Fl at Fi l e)
Steps
Application Designer, File, New, Application
Engine Program Engine Program
Select Insert, Action
Save the Program Save the Program
Change the Action type to PeopleCode
Enter Code
Save
Run
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
St eps f or Cr eat i ng a Mul t i l evel St eps f or Cr eat i ng a Mul t i l evel
Fi l e Layout
1 C t Vi 1. Create a View
2. Create a new file layout
3 Drop and drag the viewinto the layout 3. Drop and drag the view into the layout
4. Use the toolbar arrows to determine hierarchy
5. Double-click the record name to set segment
properties
6. Assign a unique file record ID to each record
7 Note: start position and length are set automatically 7. Note: start position and length are set automatically
8. Click OK
9. Click Yes to increment the start position of all fields
10. Save the File
J
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Easi est Way t o do Fi l e Layout Easi est Way t o do Fi l e Layout
Mat c h t o Vi ew
Record SL_BEN_COBC_VW
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Fi l e Layout one t o one t o Vi ew
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Fi l e Rec or d I D
Identifies the record
Can be used with fixed and CSV files
ID must be included in your flat file
Assigned at the file layout segment level
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
COBRA TPA (Thi d P t COBRA TPA (Thi r d Par t y
Admi ni st r at or ) Fi l e Layout Ex ampl e
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Cr eat i ng Row set s and Fi l e
/***Create Rowset Instance***/ / Create Rowset Instance /
&sl_rowset = CreateRowset(Record.SL_BEN_COBC_VW);
&sl_rowset2 = &sl_rowset.GetRow(1).GetRowset(1);
/***Create File Instance***/
If &whereto = "local" Then
&path = "c:\temp\";
Else
/* Get Unix path for files */ /* Get Unix path for files */
SQLExec("Select sl_charval from sl_pr_parm_tbl where sl_keyval ='PATH-PROD-UNIX'", &path);
End-If;
/* Filename */
&filename = &curdate | "_CB_PAR_" | &clientid | ".txt";
/** Create an instance of the File - this will be opened in Write mode with an absolute
path. Then associate it with the appropriate File Layout */
&COBRAFil G tFil (& th | &fil "W" %Fil P th Ab l t ) &COBRAFile = GetFile(&path | &filename, "W", %FilePath_Absolute);
/*********** Filelayout ************************************/
&COBRAFile.SetFileLayout(FileLayout.SL_COB_PAR);
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
SQL St at ement s
/* Create SQL object to retrieve values */
&SQL1 = CreateSQL("%selectall(:1)", &recl);
&SQL2 = CreateSQL("%selectall(:1)", &rec2);
&SQL3 = CreateSQL("%selectall(:1)", &rec3);
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Loopi ng t he Level One Rec or d
/* Loop through the rowset to get the values and write the rowset to file */ / Loop through the rowset to get the values and write the rowset to file /
While &SQL_HDR.Fetch(&recl)
/*copy record to rowset */
&recl.CopyFieldsTo(&rowset1.GetRow(1).SL_BEN_COB_HDR);
/* Write rowset to file */
&COBRAFil W it R t(& t1) &COBRAFile.WriteRowset(&rowset1);
End-While;
/* Fetch data from SL_BEN_COBP_VW */
While &SQL_PAR.Fetch(&rec2)
&I = 1;
/* Copy record to the rowset */
&rec2.CopyFieldsTo(&rowset2.GetRow(&I).SL_BEN_COBP_VW);
&rowset2.InsertRow(&I);
&COBRAFile.WriteRowset(&rowset2);
&I = &I + 1; &I &I + 1;
End-While;
While &SQL_TRL.Fetch(&rec3)
/*copy record to rowset */
&rec3.CopyFieldsTo(&rowset3.GetRow(1).SL_BEN_COB_TRL);
/* Write rowset to file */
&COBRAFile.WriteRowset(&rowset3);
End-While;
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Segment s
Uses:
Specify the action to take for rows of data
Li it fi ld th fil l t Limit fields on the file layout
Identify File Layout
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
I ndi c at e Ac t i on
You need to send a flat file to another app
Indicate Action
Insert Insert
Update
Delete
Use Segment to indicate the action
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Li mi t Fi el ds
Following provided from: PeopleSoft
Integration Tools and Utilities, File Layout
and Data Interchange section and Data Interchange section
You have a file and you only want two fields
fromit from it
One way is to update everything and then
manually delete the unwanted data manually delete the unwanted data
Or insert a segment name it the same as the
table and insert only the two fields you want table and insert only the two fields you want
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Li mi t Fi el ds Cont .
You have data that changes or you need to
insert new rows
C t i l fi ld d AUDIT ACTION Create a single field named AUDIT_ACTION
which will indicate if the record is new or
changed changed
Use PeopleCode to look for the field and
value and process conditional logic value and process conditional logic
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
I dent i f yi ng t he Fi l e Layout
Use a segment to identify the part of the file
you want to import
999 P d t /* PRODUCT l t*/ 999 Product /*use PRODUCT layout*/
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
St eps t o w or k w i t h a Segment
D d d d i t th fil l t Drag and drop your record into the file layout
Select Insert
Segment Segment
Record Name, Max Length, & File Record ID (if you
have one))
Place your cursor on the Segment Name
Select
Insert File Field or
Insert Database Field
Then arrange the Segments in the order you want Then arrange the Segments in the order you want
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
St eppi ng Thr ough I nser t i ng a St eppi ng Thr ough I nser t i ng a
Segment
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Cr eat i ng a Chi l d Segment
Insert a Child Segmenthighlight record,
select Insert, ChildSegment, and enter file
record name record name
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Put t i ng i t al l t oget her Put t i ng i t al l t oget her
(r eal w or l d ex ampl e)
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
What w e c over ed
Writing Data to a Flat File
Methods to Read and Write (Plain Text Files)
Writing Files (Defined by a File Layout)
Creating an App Engine (to Export Data to
Flat File)
Creating Multilevel File Layout
PeopleCode for Multilevel File Layout
Segments in File Layout
N
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Book Si gni ng
Time: 11:45 am to 12:45 pm
Location: Bookstore
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Dow nl oad Pr esent at i on
http://www.oraclepressbooks.com/downloads/
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
Quest i ons
jhotsin@sandia.gov
J udi_doolittle@ioug.org
nygarci@sandia.gov
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.
C
h
a
n
g
e
d

w
i
t
h

t
h
e

D
E
M
O

V
E
R
S
I
O
N

o
f

C
A
D
-
K
A
S

P
D
F
-
E
d
i
t
o
r

(
h
t
t
p
:
/
/
w
w
w
.
c
a
d
k
a
s
.
c
o
m
)
.

You might also like