home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Cobol 24 Hours
/
Sams_Cobol_24_Hours.iso
/
Cobol32
/
PowerCBL
/
powercbl.Z
/
dbaccess.prc
< prev
next >
Wrap
Text File
|
1997-05-14
|
2KB
|
75 lines
@POWER POWSHEET SHEET1 WORKING
01 CURRENT-RECORD PIC 9(8) COMP-5 GLOBAL EXTERNAL.
* 01 CURRENT-RECORD-NUM REDEFINES CURRENT-RECORD PIC 9(9) GLOBAL EXTERNAL.
@POWER POWPSBTN PUSH1 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
* Connect to the database.
CALL OPENDB OF ODBC1.
IF PROGRAM-STATUS < 0 THEN
EXIT PROGRAM
END-IF.
* Select the record group.
CALL SELECTRECORDS OF ODBC1.
* Read the first record.
CALL READNEXTRECORD OF ODBC1
* EOD ruling.
IF PROGRAM-STATUS NOT = 1 THEN
EXIT PROGRAM
END-IF
* Display the read record in the edit fields.
MOVE EmployeeID OF ODBC1 TO CURRENT-RECORD
MOVE CURRENT-RECORD TO POW-TEXT OF EDIT1
MOVE FirstName OF ODBC1 TO POW-TEXT OF EDIT2
MOVE LastName OF ODBC1 TO POW-TEXT OF EDIT3
@POWER POWPSBTN PUSH2 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
CALL READNEXTRECORD OF ODBC1
* EOD ruling.
IF PROGRAM-STATUS NOT = 1 THEN
EXIT PROGRAM
END-IF
* Display the next record in the edit fields.
MOVE EmployeeID OF ODBC1 TO CURRENT-RECORD
MOVE CURRENT-RECORD TO POW-TEXT OF EDIT1
MOVE EmployeeID OF ODBC1 TO POW-TEXT OF EDIT1
MOVE FirstName OF ODBC1 TO POW-TEXT OF EDIT2
MOVE LastName OF ODBC1 TO POW-TEXT OF EDIT3
@POWER POWPSBTN PUSH4 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
* Close the sample application.
CALL CLOSESHEET OF SHEET1.
@POWER POWPSBTN PUSH3 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SEARCH-STRING.
02 FILLER PIC X(14) VALUE IS "EmployeeID >= ".
02 RECORDNUMBER PIC X(9).
* 02 RECORDNUMBER-NUM REDEFINES RECORDNUMBER PIC 9(8).
PROCEDURE DIVISION.
IF CURRENT-RECORD > 1 THEN
SUBTRACT 1 FROM CURRENT-RECORD
MOVE CURRENT-RECORD TO RECORDNUMBER
MOVE SEARCH-STRING TO POW-DBCONDITION OF ODBC1
CALL SELECTRECORDS OF ODBC1
* Read the first record.
CALL READNEXTRECORD OF ODBC1
* End of Data check.
IF PROGRAM-STATUS NOT = 1 THEN
EXIT PROGRAM
END-IF
* Display the read record in the edit fields.
MOVE EmployeeID OF ODBC1 TO CURRENT-RECORD
MOVE CURRENT-RECORD TO POW-TEXT OF EDIT1
MOVE FirstName OF ODBC1 TO POW-TEXT OF EDIT2
MOVE LastName OF ODBC1 TO POW-TEXT OF EDIT3
MOVE " " TO POW-DBCONDITION OF ODBC1
END-IF