免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3545 | 回复: 3
打印 上一主题 下一主题

求助:编程问题 [复制链接]

论坛徽章:
0
1 [报告]
发表于 2008-06-12 11:14 |显示全部楼层
两种方法:

1)用sql或query打开这个表,就可以看到字段名。

2)用程序描述文件记录,在这个记录的相应位置上应以一个名字,就可以对其进行数据操作。

论坛徽章:
0
2 [报告]
发表于 2008-06-12 12:08 |显示全部楼层
原帖由 jerry_1754 于 2008-6-12 11:23 发表
关于第2种方法能否详细说明下,最好帖段代码示范,谢谢!
另:RPG里有无类似数组的取值,即IM(1)代表第一个字段.
敬候解答~

请查看《RPG User‘s Guide》SC09-1816-00
         
P429 程序描述RPG例子。

论坛徽章:
0
3 [报告]
发表于 2008-06-12 17:18 |显示全部楼层
原帖由 jerry_1754 于 2008-6-12 15:25 发表

找不到手册,能否发一份到我邮箱:jerry_1754@sina.com
谢谢!

我把相关例子放在下面:

*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*
F********************************************************************
F* SUBROUTINES USED:
F* L1CLR - Control level detail time clear of work fields
F* UPDSR - Project and reason code master update and detail print
F* TOTL1 - Control-level total-time employee master update and
F* total time print
F********************************************************************
F* This program uses program-described files. Files
F* used are: TRWEEK - weekly transaction entry file
F* EMPMST - employee master file
F* PRJMST - project master file
F* RSNMST - reason code master file
F* QSYSPRT - printer file
F********************************************************************
FFilenameIPEAF....RlenLK1AIOvKlocEDevice+......KExit++Entry+A....U1.*
FTRWEEK IP    F      53                      DISK
FEMPMST UF   F    103      4PI       2  DISK
FPRJMST  UF   F    120      8AI       2  DISK
FRSNMST UF   F      73      8AI       2  DISK
FQSYSPRT O   F    132         OF         PRINTER
E*
E* The following extension specification describes the compile-time
E* table TABMTH. This table contains an entry for each month of
E* the year with the alternating entry TABNAM containing the month's
E* descriptive name. The table is accessed to provide the month
E* name in the heading line date field.
E*
E....FromfileTofile++Name++N/rN/tbLenPDSArrnamLenPDSComments++++++++*
E TABMTH 1 12 2 0 TABNAM 9
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*
I*
I* The weekly transaction entry file containing all time entries
I* is processed by employee number with control-level indicator L1
I* defined to control processing on a change of employee number.
I*
IFilenameSqNORiPos1NCCPos2NCCPos3NCC................................*
ITRWEEK NS 01
I....................................PFromTo++DField+L1M1FrPlMnZr...*
I                                    P      2    50 EMPNO L1
I                                            6    13 EUSRI
I                                          20  250 CWKDT
I                                          14 190  ACDAT
I                                          32   39  PRCDE
I                                          40   47 RSCDE
I                                   P     48 501 EHWRK
I                                   P     51 530 TFRRN
。。。。。。

论坛徽章:
0
4 [报告]
发表于 2008-06-12 17:23 |显示全部楼层
原帖由 jerry_1754 于 2008-6-12 17:15 发表

不是的,其实字段名是知道的,但是由于字段上百个,我想通过循环方法读取,这样的话就不能用字段名了,最好是类似数组,第一个..第二个之类.

其实实现你的方法很简单,把表结构拷贝到一个pf中,只要在程序中使用这个PF,就可以按循序读取每条记录,即字段名。就可以处理了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP