- 论坛徽章:
- 0
|
本帖最后由 pantierui 于 2010-03-24 15:21 编辑
下面是SQLRPG程序,欢迎讨论。
ID@DTA DS
I 1 132 D#DATA
I 133 135 D#KEY
IW@DTA DS
I 1 4 W#BLK
I 5 7 W#KEY
I 8 20 W#DTA
I 21 132 W#SPC
**
C MOVEL'111' ##KEY 3
**
C/EXEC SQL
C+ DECLARE C1 CURSOR FOR
C+ SELECT SPLF,SUBSTR(SPLF,5,3) AS KEY
C+ FROM PTRLIB/SPLF
C+ WHERE SUBSTR(SPLF,5,3) = :##KEY
C+ ORDER BY KEY
C/END-EXEC
**
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
**
C LABF TAG
C MOVEL*BLANK D@DTA
C/EXEC SQL
C+ FETCH C1 INTO : D@DTA
C/END-EXEC
**
C SQLCOD IFEQ *ZERO
C MOVELD#DATA W@DTA
C W#KEY DSPLY
C W#DTA DSPLY
C GOTO LABF
C ENDIF
**
C/EXEC SQL
C+ CLOSE C1
C/END-EXEC
**
C SETON LR
C RETRN |
|