7.2.1 有关RPGLE中日期型数据的用法 *from
code400.com
7.6 如何将报表(Spooled File)使用e-mail传输至使用者
7.9.4 Code
Pages and Character Sets for the CCSIDs
H*-----------------------------------------
H* %MSeconds %Seconds, %Minutes, %Hours,
H* %Days, %Months, and %Years.
H* %Date, %Time, and %TimeStamp
H*
H*
H*
H*
H*-----------------------------------------
D*-----------------------------------------
D* Program Info
D*-----------------------------------------
D
SDS
D @PGM
001 010
D @PARMS
037 039 0
D @JOB
244 253
D @USER
254 263
D @JOB#
264 269 0
D*
D* Field
Definitions.
D*
D ISOdate
S
D
D USAdate
S
D DatFmt(*
D XMASDate
S
D Inz(D'
D LogonDate S
D
D Date_Start S
15
D MonthNames S
12 Dim(12) CtData
D Date_String S
40
*
* Time Stamp
*
DTimeStamp
S
Z
*
D WorkISO
S
D
D Month
S
2 0
D Day
S
2 0
D Year
S
4 0
D Decimal8
S
8 0
D LogMonth
S
2 0
D LogDay
S
2
D LogYear
S
4 0
D NextMonth S
D
D EndOfMonth S D
*
* Variables for
free RPG example + some above
*
D DateIn
S
D
D FromISO
S
D
D ToISO
S
D
D DiffDays
S
3 0
D WorkField S
5 0
D Name
S
9 Based(NamePtr)
D Name2
S
9
D NamePtr
S
* Inz(%ADDR(Names))
D Names
S
63 Inz('Sunday
Monday Tuesday Wedn+
D
esdayThursday Friday
Saturday ')
D*
D* RPG-defined date formats and separators for Date data type
D*
* 2-Digit Year
Formats
* *MDY Month/Day/Year mm/dd/yy 8
* *DMY Day/Month/Year dd/mm/yy 8
* *YMD Year/Month/Day yy/mm/dd 8
* *JUL Julian
yy/ddd 6 03/926
C*=====
* 4-Digit Year
Formats
* *ISO Int
Standards Org yyyy-mm-dd 10
* *
* *EUR IBM European
Std dd.mm.yyyy 10
26.09.2003
* *JIS
*
*
C*
*
* Okay first
lets get todays date
* For display purposes
the date is now
* Friday
* so date now
looks like this
* because the
default date type is *ISO
*
C
Eval
ISOdate = %Date()
*
* Now that I
have the date in a date format
* (*ISO) I can
do stuff to it.
* Once I move
this date to a decimal 8,0 field
* the date is
now in format 20030926
* Not very
exciting..yet
*
C
Move
ISODate Decimal8
*
* Now back to
the *ISO date lets add
* 1 month to the
date.
* date after
will equal
* %days and %
years works the same as %months
*
C
Eval
WorkISO =
ISODate + %Months(1)
*
* Logon date is
set equal to today then the month is extracted
* the
"*M" is the same as "*Months" LogMonth = 09.
*
LogDay = 26.
*
C
Eval
LogonDate =
%Date()
C
Extrct
LogonDate:*Y
LogYear
C
Extrct
LogonDate:*M
LogMonth
C
Extrct
LogonDate:*D
LogDay
*
* Build the date
string - Later we will add the day name
*
C
Eval
Date_String =
C
%Trim(MonthNames(LogMonth))
C
+ %trim('@') + %Trim(LogDay)
C
+ %trim(',@') + %Char(LogYear)
*
* convert the
"@" back to *Blanks
* Date_String =
'
*
C '@':'
'
Xlate
Date_String
Date_String
*
* TimeStamp =
yyyy-mm-dd-hh.mm.ss.mmmmmm (length 26).
* TimeStamp = '
*
C
Eval
TimeStamp = %TimeStamp()
*
* Free Format
date stuff By the way Name2 =
'Friday'
*
/Free
DateIn = %Date()
;
ISODate = %Date()
;
ISODate =
DateIn
;
Year = %Subdt(ISODate:*Y)
;
Month = %Subdt(ISODate:*M)
;
Day
= %Subdt(ISODate:*D)
;
FromISO =
ISODate - %YEARS(1)
;
ToISO =
ISODate
;
DiffDays = %Diff(ToISO:FromISO:*DAYS) ;
ISODate =
DateIn
;
WorkField = %Diff(ISODate:D'
WorkField = %REM(WorkField:7);
NamePtr = NamePtr + (WorkField * 9);
Name2 = Name;
/End-Free
*
* Build the date
string - With The Day Name
* DATE_STRING =
'
*
C
Eval
Date_String =
C
%trim(Name) + %Trim('@@')
C
+ %trim(MonthNames(LogMonth))
C
+ %trim('@') + %Trim(LogDay)
C
+ %trim(',@') + %Char(LogYear)
C
Eval
Date_String = %Xlate('@':' ':Date_String)
*
* Calculate the
last day of the month
* ENDOFMONTH = '
*
C
ISODate
AddDur
1:*Months
NextMonth
C Extrct NextMonth:*D DiffDays
C
NextMonth
SubDur
DiffDays:*D EndOfMonth
C
Eval
*INLR = *On
C*----------------------------------------------------
** CTDATA MonthNames
January
February
March
April
May
June
July
August
September
October
November
December
* reference:<go indicatorless in RPG> By
Paul Ladouceur
一直以来,指示器(indicators)都是rpg程序中很重要的一部分。但是,我们应该认识到,属于指示器的编程时代已经过去了,我们应该用21世纪的编程方式。
首先我们要开始摆脱指示器的地方就是C-Specs.通常,当对文件进行I/O操作的时候,需要一个或者多个只是起来表示该操作的状态,在RPG IV中,可以用%EOF,%FOUND,%EQUAL,%OPEN等等这些内置函数来实现这些功能。他们返回一个类似指示器的逻辑值true(*on) 或者false(*off).
下面是一些内值函数的例子以及等效的指示器用法。***************************************************
• Traditional Way of Handling I/O
C CusKey Setll Customer
C CusKey Reade CustomerR
C Endif
C If *IN
C Leave
C Endif
C CrdKey Chain CreditCdR
C Leave
C Endif
C Enddo
C Endif
• Indicatorless
Way
C CusKey Setll(e) Customer
C If %Equal(Customer)
C Do *Hival
C CusKey Reade(e) CustomerR
C If %Eof
C Leave
C Endif
C If %Error
C Message1 Dsply
C Leave
C Endif
C CrdKey Chain (e) CreditCDR
C If Not %Found(CreditCD) or %Error
C Message2 Dsply
C Leave
C Endif
C Enddo
C Endif
另外,值得一提的是%Error这个内置函数。你必须在输入/输出操作后面带上扩展符(e)。当I/O发生错误的时候,它返回true.比如在读数据库文件的时候,%Error的值为true,那么可能是因为记录被锁住。为了找到问题所在,你可以用%Status来返回错误代码。
显示文件(DSPF)一般都会用到很多指示器。下面的代码中,定义了各种显示文件中用到的关键字的指示器:
F LUPASTD CF
• Declare Named Indicators
DIndicators DS Based(IndicatorP)
D SFLNXTCHG 8 8
D SFLCLR 40 40
D SFLCTLDSP 41 41
D SFLDSP 42 42
D SFLINZ 43 43
DIndicatorP S * Inz(%Addr(*In))
或者我们可以这样:
F LUPASTD CF
• Declare
Named Indicators
DIndicators DS
D SFLNXTCHG 8 8N
D SFLCLR 40 40N
D SFLCTLDSP 41 41N
D SFLDSP 42 42N
D SFLINZ 43 43N
语句EVAL
SFLNXTCHG = *On就使*IN08的状态变为*on.是用字段名代替指示器,能使你的程序更自由易懂。可以看出,这种方法实际上相当于为指示器取了个好听易懂的名字。我们在编程过程中就能把它们作为普通的逻辑变量来使用了(这里说他们是逻辑变量实际上是表示他们的值只有’
同理,我们如果在程序里面要把每个功能键很容易的份清楚,可以定义:
D F03 03 03N
D F05 05 05N
D F12 12 12N
在这之前,我们还是需要在DSPF里面把CA03与*In03关联,这样当我们就可以在程序里面使用这样的描述:
IF F03
EVAL INLR=*ON
ENDIF
你可以用program-to-system
fields(P-fields)来代替指示器控制一个栏位在画面上的显示。
P-fields用来控制显示的栏位的属性。首先,为你要控制的栏位另外再定义一个栏位,如,你要控制的栏位是LUPAST#,那么你再建一个P-field
@LUPAST#,当然你可以用其它你喜欢的名字。你可以用这个栏位来控制PR,RI,BL等所有的属性。
下面是程序中对P-fields的一些定义,基本上包含了所有的显示属性。
• RI=Reverse
Image, HI=Hi Intensity, BL=blink, UL=Underline
• ND=Non
Display
• NON
Protect fields
d Normal c const(x’
d RI c const(x’
d HI c const(x’
d HIRI c const(x’
d UL c const(x’
d ULRI c const(x’
d ULHI c const(x’
d ND c const(x’
d BL c const(x’
d BLRI c const(x’
d BLHI c const(x’
d BLHIRI c const(x’2B’)
d BLUL c const(x’
d BLULRI c const(x’2D’)
d BLULHI c const(x’2E’)
• Protect
field
d PRNormal c const(x’A
d PRRI c const(x’A
d PRHI c const(x’A
d PRHIRI c const(x’A
d PRUL c const(x’A
d PRULRI c const(x’A
d PRULHI c const(x’A
d PRND c const(x’A
d PRBL c const(x’A
d PRBLRI c const(x’A
d PRBLHI c const(x’AA’)
d PRBLHIRI c const(x’AB’)
d PRBLUL c const(x’AC’)
d PRBLULRI c const(x’AD’)
d PRBLULHI c const(x’AE’)
注意每个缩写的常量名字都有一个相应的十六进制的值。从常量的名字我们可以看出来它所控制的显示属性。假如你有一个可输入的栏位,当出错的时候反色显示(riverse),当要提示用户一些东西的时候让它闪烁(blink),通常你会用到3个指示器来控制。但是现在我们只要一个控制栏位就可以了。我们现在可以花更多时间在程序的逻辑上,而不用为管理一大堆的指示器大费脑筋了。
例如:当用户输入一个不正确的客户代号的时候,我们要让LUPAST#反色显示,我们要做的是:EVAL
@LUPAST# = RI. 这里,RI是一个代表十六进制X21的常量.上面的代码中我们可以看到,这里有两组常量的定义,一组可以控制栏位的保护属性(PR头),另一组控制未保护的栏位。你如果只想从把栏位从可输入变成只能输出的状态,那就选择PR头的常量栏控制。反过来,用没有PR开头的常量。
继续上面客户代码栏位的例子,DSPF中我们对控制LUPAST#栏位的P-field的定义如下:
A**** For the
full source code see MNTLUPASFM ****
A DSPSIZ(24 80 *DS3)
A PRINT
A CF
. . . . Other Functions keys DECLARED . . .
A
A CF
A PAGEUP
A*A R PANEL
A*A RTNCSRLOC(&RCD &FLD &POS)
A CLRL(10)
A CSRLOC(ROW# COL#)
A OVERLAY
A RCD
A FLD
A POS 4S 0H
A ROW# 3S 0H
A COL# 3S 0H
A @LUPAST#
A @LUPAST#TX
. . . . Other P Fields Declared . . .
A @CREDLM
A @CREDLMTX
A TITLE
A 1 60DATE
A EDTCDE(Y)
A 1 70TIME
A 3
A DSPATR(&@LUPAST#TX)
A LUPAST# R B 3 20REFFLD(LUPASTOMERR/LUPAST#
LUPASTOMER)
A DSPATR(&@LUPAST#)
A 3
A DSPATR(&@CREDCDTX)
A CREDCD R B 3
44REFFLD(LUPASTOMERR/CREDCD *LIBL/LUPASTOA MER)
A DSPATR(&@CREDCD)
A DESC R O 3 47REFFLD(CREDITCDR/DESC
*LIBL/CREDITCA D)
A DSPATR(&@DESC)
A 5
A DSPATR(&@CNAMETX)
A CNAME R B 5 20REFFLD(LUPASTOMERR/CNAME
*LIBL/LUPASTOMA ER)
A DSPATR(&@CNAME)
A 7
A DSPATR(&@CADD1TX)
A CADD1 R B 7 20REFFLD(LUPASTOMERR/CADD1
*LIBL/LUPASTOMA ER)
A DSPATR(&@CADD1)
A 8
A DSPATR(&@CADD1TX)
A CCITY R B 8 20REFFLD(LUPASTOMERR/CCITY
*LIBL/LUPASTOMA ER)
A DSPATR(&@CCITY)
A CSTATE R B 8
37REFFLD(LUPASTOMERR/CSTATE *LIBL/LUPASTOA MER)
A DSPATR(&@CSTATE)
A CZIP R B 8 40REFFLD(LUPASTOMERR/CZIP
*LIBL/LUPASTOMEA R)
A DSPATR(&@CZIP)
A 11
A DSPATR(&@CREDLMTX)
A CREDLM R B 11
16REFFLD(LUPASTOMERR/CREDLM *LIBL/LUPASTOA MER)
A DSPATR(&@CREDLM)
A EDTCDE(Z)
A 23
A 23
A 23
A*A R MSFL
A*A SFL
A SFLMSGRCD(24)
A MSGKEY SFLMSGKEY
A PGMNAM SFLPGMQ(10)
A R MSFLC
A SFLCTL(MSFL)
A LOCK
A OVERLAY
A SFLSIZ(50)
A SFLPAG(1)
A N26 SFLEND
A SFLDSP
A SFLDSPCTL
A SFLINZ
A PGMNAM SFLPGMQ
@LUPAST# 定义为一个字节长,位置38我们用P,表示这是一个program-to
–system field., 关键字DSPATR用到@LUPAST#的时候,必须使用符号&作为前缀,程序将根据@LUPAST#的值控制客户代码栏位显示的属性。
如:
EVAL @LUPAST#=UL
EXFMT PANEL
* If cust# exits
EVAL @LUPAST#=PR
* If cust# not exits
EVAL @LUPAST#=RI
那么,下次显示画面的时候,栏位LUPAST#就会按照@LUPAST#所代表的相应属性来显示了。
另外一点就是:P-fields 也可以用来控制常量.上面的DSPF代码中,@CREDLMTX用来作为@CREDLM的显示控制。
我们怎样才能不通过指示器来定位光标所在的栏位呢?DDS中有一个关键字CRSLOC,如上面的DDS定义:
A ROW# 3S 0H
A COL# 3S 0H
A CSRLOC(ROW# COL#)
要系统自动返回光标的位置,使用RTNCSRLOC关键字。
* 我们也可以调用API QDFRTVFD来返回光标位置的,具体的用法可以参考IBM information centre的详细说明。
也许你在想怎么才知道用户按下了ENTER键还是其他什么键呢?DDS并不支持把ENTER键同指示器关联,但是我们可以在程序中判断。方法就是通过用在WORKSTN文件的关键字INFDS.首先,你要在DDS定义你要用到的所有功能键如CA03,CA12等等,如:
A PRINT
A CF
A
A
在RPG程序中,我们通过INFDS与WORKSTN文件关联了一个information data structure,第369位就叫做AID (Attention Indicator).我们直接把它和F3常量(关于各功能键对应得常量值见附表)相比较,就知道用户有没有按下F3.
我们可以用subfile来显示给用户一些出错信息。这样可以避免为每个信息指定一个指示器。Message subfiles 显示在画面的最下面,同时出错的栏位会被反亮显示。
定义一个message subfile ,需要在sflctl定义SFLPAG, SFLDSP, SFLDSPCTL, SFLSIZ这些关键字。SFLEND是必须要有一个指示器控制的关键字。它在画面右下角上显示一个‘+’或者‘More’来提示尚有更多的信息。Subfile 里面,必须要定义的关键字有:SFLMSGRCD,
SFLMSGKEY, SFLPGMQ. SFLMSGRCD 指定显示消息的行数, SFLMSGKEY可以让你在程序中为消息指定一个关键字段。SFLPGMQ是程序消息队列的名字。你的程序从这个消息队列中接收错误消息,或者发送错误消息到消息队列中。SFLPGMQ (10)生成一个10-byte 的栏位。10是默认值,你只能指定它为10或者276。
我们可以用API QMHSNDPM发送消息到消息队列中。
SFLMESSAGE 包含了两个模块, SendSFLMSG 和 ClearSFLMsg.
ClearSFLMsg 从消息队列中移除消息,SendSFLMSG 往消息队列中写入消息。当输入到一个栏位的值有错的时候,我们不仅可以反亮显示该栏位,也同时往消息队列中写入一条消息。使用消息队列可以避免使用硬代码(hard code)定义指示器。你可以从程序直接发送消息文本到subfile,或者发送消息标识(message ID),消息文件或者库。我觉得把错误消息存储在一个array中,然后从中取出来传递给画面十分好用。
现在,我们可以让我们的程序彻底摆脱指示器了。下面是应用的基本逻辑:
1. 显示画面
2. 按下ENTER或者其他功能键。画面上包含有可输入栏位,我们用一个P-field(program-to-system)来控制它的显示属性。3. Clear the subfile message
queue.
4. 程序中检查AID 的值,判断是按下了ENTER键或者是什么功能键。程序中检查其有效性。
5. 重置用P-field控制的所有栏位属性到默认设置,比如可输入栏位初始会有一个UL属性。
6. 开放被控制的输入/输出栏位,将光标放在出错的第一个栏位,并反亮显示出错的栏位。程序中可以用到%FOUND 或者其他的内置函数。
7. 为每个栏位的错误发送一个信息到SFL消息队列中。
8. 重新显示画面,再次开始。或者更新文件,退出程序。
显示文件中关于SFL部分的定义:
A*****************************************************************
A R
SFL10
SFL
A
KEEP
A
SFFLD1
A
SFFLD2 20O O 7 18TEXT(' ')
A*****************************************************************
A
R CTL10
SFLCTL(SFL10)
A
CSRLOC(D1ROW D1COL)
A
RTNCSRLOC(&D1RCD &D1HELP)
A
RTNCSRLOC(*MOUSE &D2ROW &D2COL)
A
A
SFLCSRRRN(&D1RRN)
A
SFLPAG(16) SFLSIZ(32)
A
22
SFLDSPCTL
A
23
SFLDSP
A
24
SFLCLR
A*
A
DSPSF1
4S 0H
SFLRCDNBR
A*
RPG中关于显示文件调用声明:
FDSPFILE CF
F
XRRN1 KSFILE SFL10
其中XRRN1为SubFile的纪录号
SubFile纪录的写入:
C
ADD 1
XRRN1
C
WRITESFL10
如果对于同一个纪录号,重复使用了两次WRITE操作的话,系统就会出错。所以每次写的时候XRRN1是必须加1的。
SubFile的显示:
C
MOVE ON *IN22
C
MOVE ON *IN23
C
Z-ADD1
DSPSF1
C
EXFMTCTL10
C
MOVE OFF *IN22
C
MOVE OFF *IN23
其中DSPSF1为显示文件的纪录号,一般设置为1,使光标位置出现在第一条纪录,当然也可以根据需要来定位。
SubFile纪录的的定位和更新:
C
X
CHAINSFL10
80
C*纪录字段值及状态更新操作
C
UPDATSFL10
其中X等同于XRRN1,为SubFile的纪录号。
SubFile纪录的整体删除:
C
Z-ADD*ZERO
XRRN1
C
MOVE ON
*IN24
C WRITECTL10
C
MOVE OFF *IN24
The RPG to generate a Progress Bar for source files
FUtl4020D cf e
WorkStn
*---------------------------------------------------------------------
D
TimeStart
S
T
D
TimeNow
S
T
D TimeHMS
S
T TimFmt(*HMS)
D TotalSecs S
9S 0
D TimeHMSa
S
8
*
D CurrentRec S
7S 0
D TotalRecs S
7S 0
D PCT
S
3S 0
*
* play
stuff
C
Eval
TotalRecs = 2000
C
Time
TimeStart
C
dow CurrentRec
< TotalRecs
C
Eval
CurrentRec = CurrentRec + 1
* Set the xx%
value
C
EVAL
pct = CurrentRec * 100 / TotalRecs
C
EVAL
PRGBAR = '
' +
C
%Triml(%EditC(CurrentRec:'3')) +
C
' records of ' +
C
%Triml(%EditC(TotalRecs:'3')) + ' read. ' +
C
%EditW(PCT:' %')
* Estimated time
to completion:
* (Below 5% the
estimated time is probably badly misleading)
C
If
Pct > 5
C
Time
TimeNow
* Time elapsed
so far:?
C TimeNow
SubDur
TimeStart
TotalSecs:*S
C
Eval
TotalSecs = TotalSecs/pct * (100 - pct)
C T'
C
MoveL
TimeHMS Tmp20
20
C
Move
'remaining ' Tmp20
C Move Tmp20
PrgBar
C
End
* Set the RI
placement
C*
EVAL
pct = (CurrentRec * %size(PRGBAR))/TotalRecs
C
EVAL
pct = (CurrentRec * 74)/TotalRecs
C
If
Pct > 0
C
EVAL
%subst(PRGBAR:pct:1) = x'21'
C
Write
FMT01
C
End
C
EndDo
C
EVAL
%subst(PRGBAR:74:1) = ' '
C
Exfmt
FMT01
C
eval
*inLR = *on
1. ---------------------------------------------------------------------
The DDS for
the screen format
A******************************************************************
A*%%EC
A
DSPSIZ(24 80 *DS3)
A
ERRSFL
A
R FMT01
A
TEXT('A displayable Progress bar')
A OVERLAY
A
WINDOW(22 2 1 74 *NOMSGLIN)
A
PRGBAR
74 O 1 1DSPATR(RI)
A
COLOR(RED)
A
R DUMMY
A
TEXT('PREVENTS PREVIOUS SCREEN FROM-
A
BEING
CLEARED')
A
ASSUME
A
1 9'
'
a)
利用导航器的中央管理—监控器—系统
参照样本创建一个就可以了
b)
利用PM400
c)
利用ACCOUNTING
JOURNAL
创建QACGJRN即可检测JOB的资源使用情况
在分析QACGJRN的时候,需要套用系统已有的文件格式
拷贝系统现有的文件格式----QSYS/QAJBACG4
DSPJRN JRN(QACGJRN)
OUTPUT(*OUTFILE)
OUTFILFMT(*TYPE4)
OUTFILE(YOURLIB/QAJBACG4)
DDS:
A
DSPSIZ(24 80 *DS3)
A
CA03(03 'EXIT')
A
R SCRN01
A
4 6'ENTER
YOUR PASSWORD TO -
A
CONTINUE:'
A
PWD
A
DSPATR(ND)
A
23 2'F3
= EXIT'
A
MSG
78 24 2
CL:
PGM
DCLF
FILE(CHKPWDD)
RETRY:
SNDRCVF
CHGVAR &MSG ' '
IF
(&IN03 = '1') GOTO END
CHKPWD PASSWORD(&PWD)
MONMSG MSGID(CPF2362 CPF2363 CPF2364) EXEC(DO)
RCVMSG MSGTYPE(*LAST) RMV(*NO) MSG(&MSG)
GOTO RETRY
ENDDO
END:
ENDPGM
1.
查看QUSRWRK子系统下名为QZRCSRVS的JOB,查看JOBLOG就可以知道使用者
2.
通过CLP可以实现
pgm
/*
*/
/* *Usrspc variables...
*/
/*
*/
dcl
&usrspc
*char
20 /* Space
name/lib */
dcl
&offslst *char 4 /* Offset to list */
dcl
&sizlste *char 4 /* Size list entries */
dcl
&nbrlste *dec ( 7 0 ) /* Number of entries */
dcl
&us_hdr
*char
150 /* Space
header */
dcl
&us_jobe *char 512 /* A single entry */
/*
*/
/* Job selection variables...
*/
/*
*/
dcl
&jobname *char 26 /* Select job name */
dcl
&dftuser *char 10 value( 'QUSER ' )
/* Prestart user
*/
/* Variable keys to select
*/
dcl
&nbrkeys *char 4 value( x'00000002' )
/* bin( 2 ) */
dcl
&rtvcurusr
*char
4 value( x'00000131' )
/*
bin( 305 ) */
dcl
&rtvsts
*char
4 value( x'00000065' )
/* bin( 101 ) */
/* Variable key list...
*/
dcl
&varkeylst
*char 400
/*
*/
/* Retrieved values
from job list...
*/
/*
*/
dcl
&job
*char
10
dcl
&user
*char
10
dcl
&nbr
*char
6
dcl
&curuser *char 10 /* Current user */
dcl
&sts
*char
4 /* Job status */
/*
*/
/* Global message monitor...
*/
/*
*/
monmsg (
cpf0000 mch0000 ) exec( goto Std_Err )
/*
*/
/* Create a *usrspc to
work with...
*/
/*
*/
chgvar
&usrspc (
'ODBCJOB ' *cat 'QTEMP ' )
call QUSCRTUS
( +
&usrspc
+
'TMPLST '
+
x'00001000'
+
X'00'
+
'*ALL
'
+
'Temp list ODBC
jobs ' +
'*YES
'
+
x'0000000000000000' +
)
/*
*/
/* This sets up
selection criteria for list jobs API... */
/*
*/
/* The jobname we're
after...
*/
chgvar
&jobname ( 'QZDASOINIT'
*cat +
&dftuser *cat +
'*ALL '
+
)
/* Include current job
user and active job status...
*/
chgvar
&varkeylst (
&rtvcurusr *cat &rtvsts )
/*
*/
/* This lists active
jobs with the job name specified. */
/*
*/
call QUSLJOB
( +
&usrspc
+
'JOBL0200'
+
&jobname
+
'*ACTIVE '
+
x'0000000000000000' +
'B'
+
&nbrkeys
+
&varkeylst
+
)
/*
*/
/* Get the *usrspc header for the list
attributes...
*/
/*
*/
call QUSRTVUS
( +
&usrspc
+
x'00000001'
+
x'00000096'
+
&us_hdr
+
)
/*
*/
/* Get the offset to the list within the space,
the number */
/*
of list entries and size of each entry from the header. */
/*
*/
chgvar
&offslst
%sst( &us_hdr
125 4 )
chgvar
&nbrlste
%bin( &us_hdr
133 4 )
chgvar
&sizlste
%sst( &us_hdr
137 4 )
/* If no entries, then get out of here...
*/
if (
&nbrlste *eq 0 )
do
sndpgmmsg msgid( CPF9898 ) msgf( QCPFMSG )
+
msgdta( 'No ODBC jobs found.' )
goto Clean_up
enddo
/* Set the offset to the list within the
space...
*/
chgvar
%bin( &offslst ) ( %bin( &offslst ) + 1 )
Nxt_JobE:
/* Get an entry from the list...
*/
call QUSRTVUS
( +
&usrspc
+
&offslst +
&sizlste
+
&us_jobe
+
)
/* Extract job info from list entry...
*/
chgvar
&job
%sst( &us_jobe 1 10 )
chgvar
&user
%sst( &us_jobe
11 10 )
chgvar
&nbr
%sst( &us_jobe
21 6 )
chgvar
&curuser
%sst( &us_jobe
81 10 )
if (
&curuser *eq &dftuser ) do
chgvar &curuser
'*DEFAULT'
enddo
chgvar
&sts
%sst( &us_jobe 109 4 )
/* Display the result...
*/
sndpgmmsg msgid(
CPF9898 ) msgf( QCPFMSG ) +
msgdta( 'Job<' *cat &nbr *tcat +
'/' *cat &user *tcat +
'/' *cat &job
*tcat +
'> Current user<' *cat &curuser *tcat +
'> Status<' *cat &sts *tcat '>')
/* Perform loop
testing...
*/
chgvar
&nbrlste ( &nbrlste -
1 )
if (
&nbrlste *gt 0 )
do
chgvar %bin( &offslst ) ( %bin(
&offslst ) + +
%bin( &sizlste ) )
goto Nxt_JobE
enddo
/*
*/
/* Exit processing...
*/
/*
*/
Clean_up:
dltusrspc
%sst( &usrspc 11 10 )/%sst( &usrspc 1 10 )
return
Std_Err:
/*
Move any *DIAG messages up the stack... */
Qsys/call
pgm( QSYS/QMHMOVPM ) parm( +
' '
+
'*DIAG
' +
x'00000001' +
'*
' +
x'00000001' +
x'00000000' +
)
Qsys/monmsg
( CPF0000 MCH0000 )
/*
Resend any *ESCAPE messages up the stack... */
Qsys/call
pgm( QSYS/QMHRSNEM ) parm( +
' '
+
x'00000000' +
)
Qsys/monmsg
( CPF0000 MCH0000 )
return
endpgm
由于E-mail的普及,所以常会有 AS/400报表下载到PC,并经常要利用outlook传输,很是麻烦,所以我们將之整合至 AS/400 中,直接利用
AS/400 的 SMTP 功能即可直接传送报表。SMTP设置方法请参考ESPLF的说明文档。
下面的程序默认设置是转换繁体中文 "*BG5",如果是简体中文,请将 ESPLFC 中 指令
CPYTOPC参数 TRNIGC 值改为 "*SCGS",即可转换为简体。
File : QCLSRC
Member: ESPLFC
Type : CLP
Usage
: CRTCLPGM ESPLFC
OS Version: V4R1(含)以後
/**================================================================**/
/* ESPLF ** EMAIL SPOOL
FILE
*/
/* Compile: CRTCLPGM PGM(QGPL/ESPLFC)
*/
/**================================================================**/
PGM PARM(&FILE &EMAIL &QJOB &SPLNBRD)
DCL VAR(&QJOB) TYPE(*CHAR) LEN(26) /* job name */
DCL VAR(&FILE) TYPE(*CHAR) LEN(10) /* spool file +
name */
DCL VAR(&SPLNBRD) TYPE(*DEC) LEN(5 0) /* spool +
file number */
DCL VAR(&EMAIL) TYPE(*CHAR) LEN(40) /* to email +
address */
DCL VAR(&JOB)
TYPE(*CHAR) LEN(10)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
DCL VAR(&NBR)
TYPE(*CHAR) LEN(6)
DCL VAR(&SPLNBR)
TYPE(*CHAR) LEN(6) /* spool +
file number */
DCL VAR(&FNAME)
TYPE(*CHAR) LEN(12)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))
/**================================================================**/
/* Translate
JOB special values
*/
/**================================================================**/
IF
COND(&QJOB = '*') THEN(RTVJOBA
JOB(&JOB) +
USER(&USER) NBR(&NBR))
ELSE
CMD(DO)
CHGVAR VAR(&JOB)
value(%SST(&QJOB 1 10))
CHGVAR VAR(&USER) value(%SST(&QJOB 11 10))
CHGVAR VAR(&NBR)
value(%SST(&QJOB 21 6))
ENDDO
/**================================================================**/
/* Translate
SPLNBR special values
*/
/**================================================================**/
IF
COND(&SPLNBRD = -1) THEN(CHGVAR
VAR(&SPLNBR) +
value('*ONLY'))
ELSE
CMD(IF COND(&SPLNBRD = -2) THEN(CHGVAR +
VAR(&SPLNBR) value('*LAST')))
ELSE
CMD(CHGVAR VAR(&SPLNBR) value(&SPLNBRD))
/**================================================================**/
/* E-mail
*/
/**================================================================**/
CHKOBJ OBJ(QTEMP/ESPLF) OBJTYPE(*FILE)
MONMSG MSGID(CPF9801) EXEC(CRTPF FILE(QTEMP/ESPLF) +
RCDLEN(198) IGCDTA(*YES) SIZE(*NOMAX))
CPYSPLF FILE(&FILE) TOFILE(QTEMP/ESPLF) +
JOB(&NBR/&USER/&JOB)
SPLNBR(&SPLNBR) +
MBROPT(*REPLACE)
CHGVAR VAR(&FNAME) value(%SST(&FILE 1 8) *TCAT '.TXT')
CPYTOPCD FROMFILE(QTEMP/ESPLF) TOFLR('temp') +
TODOC(&FNAME) REPLACE(*YES) +
TRNTBL(*NONE) TRNIGC(*BG5)
SNDDST TYPE(*DOC) TOINTNET((&EMAIL)) DSTD(&FILE) +
LONGMSG(&FILE) DOC(&FNAME) FLR('temp')
+
SUBJECT(&FILE *BCAT 'TESTED' )
DLTDLO DLO(&FNAME) FLR('temp')
SNDPGMMSG
MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Spooled +
file' |> &FILE |> 'sent to' |>
&EMAIL)
RETURN
/**================================================================**/
/* Global exception
handler
*/
/**================================================================**/
ERROR: CALL PGM(QMHRSNEM) PARM(' ' X'00000000')
MONMSG MSGID(CPF0000)
SNDPGMMSG
MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('Error(s) occured, see previously +
listed messages') MSGTYPE(*ESCAPE)
ENDPGM
File : QCMDSRC
Member: ESPLF
Type : CMD
Usage
: CRTCMD CMD(ESPLFC)
PGM(ESPLFC)
OS Version: V4R1(含)以後
/* sample: ESPLF FILE(QPJOBLOG) EMAIL(support@yahoo.com) */
/* V4R1 or later is
required. */
/*You must create a
temporary folder using the command CRTFLR FLR(TEMP) */
/* 1.Using CFGTCP,
Option 10=Work with TCP/IP host table entries, */
/* verify your mail server name is
in the table (add if necessary). */
/* ADD TWN6CPD 145.172.2.11 MAIL SERVER
*/
/* ADD WTWNAS01 145.172.1.1 LOCAL AS/400 HOST
*/
/* 2.
/* 3. CHGSMTPA, verify AUTOSTART(*YES) and MAILROUTER(mail-svr-name) */
/* 4. ADDDIRE USRID(INTERNET SMTPRTE) +
*/
/* USRD('Internet SMTP gateway') SYSNAME(INTERNET) + */
/* PREFADR(NETUSRID *IBM ATCONTXT)
*/
/* CHGDSTA SMTPRTE(INTERNET
SMTPRTE)
*/
/* 5. STRTCPSVR
*SMTP
*/
/* If you changed the mail
server address, you need restart SMTP*/
/* 6. Test : SNDDST TYPE(*LMSG) TOINTNET(E-mail address) + */
/*
DSTD('Test message') LMSG('Test message') */
/* use the Work with Directory
Entries (WRKDIRE) command to */
/* enroll you in the system
directory.
*/
/*
*/
/* preventing large
e-mail messages from splitting
*/
/*
CHGPOPA MSGSPLIT(*NOMAX)
*/
/*
*DFT size is 128k
*/
CMD PROMPT('E-mail Spooled File')
PARM
KWD(FILE) TYPE(*NAME) MIN(1) PROMPT('Spooled +
file')
PARM
KWD(EMAIL) TYPE(*CHAR) LEN(40) MIN(1) +
PROMPT('To e-mail address')
PARM
KWD(JOB) TYPE(JOB) DFT(*) SNGVAL((*)) +
PROMPT('Job name')
PARM
KWD(SPLNBR) TYPE(*DEC) LEN(4) DFT(*ONLY) +
SPCVAL((*ONLY -1) (*LAST -2)) +
PROMPT('Spooled file number')
JOB:
QUAL
TYPE(*NAME) DFT(*)
QUAL
TYPE(*NAME) PROMPT('User')
QUAL
TYPE(*CHAR) LEN(6) RANGE(000000 999999) +
PROMPT('Number')
RLU的意思为Report
Layout Utility(报表设计工具)。
RPG程序设计的初衷就是为了设计报表以供系统打印。随着技术的改进和OS/400版本的不断升级,现在的许多输出设备都已经改变了传统报表的用法,原来使用程序定义定义文件设计报表,目前则经常采用报表设计工具RLU来设计打印文件PRTF,然后再通过RPGIV+PRTF组合来编制程序。
下面将以OS/400 V5R
一、PF文件说明:
1、EDISYSTEM/QDDSSRC(REFILE)为数据公共字典PF:
代码:
A* CREATE BY TRF.LIUYUANYAO
2004.12.12
A* DATA DICTIONARY
REFERENCE FILE
A*----------------------------------------------------
A
R REFMT
**
A* CHARACTER SET
A
CODE
A
ID
**
A* DBCS-OPEN SET
A
NAME1
12O
A NAME2
12O
A
DESCRPT 30O
**
A** NUMERIAL SET
A
AMOUNT 15 2
A
PRICE
11 2
A
QUATITY 7 0
**
A** DATE SET
A
DATE
2、EDISYSTEM/QDDSSRC(EMPLOYEES)为参照数据公共字典的其中一个PF:
代码:
A* PROGRAMER : TRF.LIUYUANYAO 2004.12.14
A* PROGRAM NAME : EMPLOYEES
A*****************************************************************
A
REF(*LIBL/REFILE)
A
UNIQUE
A
R EMPLOY
A
EYCODE R
REFFLD(ID)
A
COLHDG('雇员码')
A
DPCODE R
REFFLD(CODE)
A
COLHDG('部门码')
A
EYNAME R
REFFLD(NAME2)
A
COLHDG('雇员名')
A
SUBTOTAL R
REFFLD(AMOUNT)
A
COLHDG('小计')
A*
A
K EYCODE
A
K DPCODE
二、使用RLU的具体操作步骤:
2.1 为打印文件选择数据库:
1、在OS/400命令行敲入STRRLU+F4,分别在Source
file、Library、Source member输入对应内容,并且定义Page
width...198 。
代码:
Start Report Layout Utility (STRRLU)
Type choices, press Enter.
Source file . .
. . . . . . . . > QDDSSRC Name,
*PRV
Library . . . . . . . . . .
. > EDISYSTEM Name, *LIBL, *LUPARLIB, *PRV
Source member .
. . . . . . . . > LPRTF01 Name,
*PRV
Option . . . . . . . . . . . . . 2
2, 6
Page width . . . . . . . . . . . > 198
1-378, *SAME
Text 'description' . . . . . . . > 'DEMO for Design
Report'
2、执行后出现如下效果,RLU展示出报表设计屏面。
我们可以使用SEU对其进行编辑:左边的'''''''为功能定义区域,空白区为设计编辑显示区域;左侧开始BASE显示了打印时出标尺;...+... 1
...+... 2 最大可以定义378个字符位置。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
-------------------------
Start of Page 001 ---------------------------
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
Record length of source file
greater than 92.
+
3、按F10,输入Library、File、Record,将光标停在Field栏按F4 :
代码:
Work
with Database Fields
Type options, press Enter.
1=Add
field 4=Remove 8=Display field description
Option Field
Library
File
Record
1
EDISYSTEM
EMPLOYEES
EMPLOY
(No
database fields selected)
Bottom
F3=Exit
F4=Prompt
F5=Refresh
F12=Cancel F16=Delete
all fields
4、出现如下界面后再在Field栏按F4:
代码:
Add Database Fields
Type choices, press Enter.
File . .
. . . . . . . . .
EMPLOYEES Name, F4
for list
Library . . . . . . . . EDISYSTEM Name, *LIBL,
*LUPARLIB
Record
format . . . . . . EMPLOY
Name, F4 for list
Field . . . . . . . . .
.
Name, F4 for list
F4=Prompt
F5=Refresh
F12=Cancel
Specify field
name.
5、执行后可见下图,键入1=Select,选择数据库所有的字段;然后连续键入3次执行:
代码:
Select Database Fields
File . . . . . . . . : EMPLOYEES Record . .
. . . . . : EMPLOY
Library . . . . . : EDISYSTEM
Position to . .
. . .
Field
Subset . . . . . . . . *ALL
*ALL, name, *generic*
Type options, press Enter.
1=Select 8=Display
field description
Column
Opt
Field
Length
Type
Heading
1
DPCODE
5
Character
DPCODE
1
EYCODE
7
Character
EYCODE
1 EYNAME
12
Bracketed DBCS
EYNAME
1
SUBTOTAL
15,2
Zoned decimal
SUBTOTAL
Bottom
F5=Refresh
F11=Display unsorted
F12=Cancel
DBCS characters in field DPCODE column heading. Heading
defaults to field... +
6、我们可以发现刚才所选择的数据库字段已经放置在设计界面底端。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys F24=More
keys
2.2 定义记录格式:
打印过程是通过RPGIV程序使用写语句将记录输出写至打印文件。写语句后面所调用的是记录格式,每执行一次RPGIV写程序,就调用一次RLU文件中的记录格式,因此我们首先需要定义记录格式。
1、在左侧定义键入DR(Define Record Format):
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
DR
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2、键入执行后,可以看见DR定义自动生成的名为RCD001记录格式。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
RCD001
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
3、不够规范吧,那就改名。键入F18,选择记录关键字。
代码:
Work with Record Keywords
Record format .
. . . : RCD001
Type options, press Enter.
2=Specify
4=Remove
Opt
Keyword
Opt
Keyword
Opt
Keyword
CDEFNT
LPI
CHRSIZ
PAGRTT
CPI
PRTQLTY
DFNCHR
SKIPA
DFNLIN
SKIPB
DRAWER
SPACEA
FNTCHRSET
SPACEB
FONT
TEXT
HIGHLIGHT
IGCCDEFNT
IGCCHRRTT
INDTXT
Bottom
F3=Exit F5=Refresh F9=Input keyword parameters F10=Rename record
F12=Cancel
F16=Remove all keywords
4、再按F10=Rename
record,将记录格式名改为:DETAIL。
代码:
Rename Record
Format
Number of keywords . . . . . . . . . : 0
Type choice, press Enter.
Record
format . . . . . . . . . . . DETAIL Name
F3=Exit
F5=Refresh
F12=Cancel
5、连续2次执行键后,记录格式名已经改为了DETAIL。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
DETAIL
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2.3 放置数据库字段:
1、在DETAIL键入VF(View
Field)插入字段观察命令:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
VF
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2、键入执行,可见左侧显示生成一个FLD1字段区准备放置F10所选择的数据库文件字段:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
DETAIL
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
3、将编辑屏幕下方的数据库文件字段序号按字段比例键入对应位置,c表示将字段表头放在上方。
注意:一定要放置与FLD1同一行上;同时要预先估算一下留出的每个字段长度与下个字段长度的间隔,防止字段相互覆盖。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
DETAIL
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
4、键入执行,将数据库字段放置在设计报告上。
假设出现了字段间互相覆盖,可以使用F13消除字段区,F15移动字段区,F16字段删除,以调整各个字段间隔。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001 ---------------------------
FLD1
<....>
<....>
<....>
<......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field F16=Delete
field
F22=Alternative keys
F24=More keys
5、在DETAIL命令行键入样本数据命令SD5(Sample Data),执行后参见下图,可见已经生成5行样本数据:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<....>
<....>
<....>
<......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00003
00004
00005
00006
00007
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2.4 定义表头:
1、在左侧命令行键入I插入一行,并键入DR定义一个记录格式,执行:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
DR
FLD1
<....>
<....>
<....> <......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX 999999999999999
00003
00004
00005
00006
00007
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys F24=More
keys
2、然后在刚刚生成的记录格式上键入DF,并且在同一编辑行居中位置键入“hhhhhhhhhh”,定义一个常数字段:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
DF
hhhhhhhhhh
FLD1
<....>
<....>
<....>
<......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX 999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
3、键入执行,生成新的记录格式名RCD004以及表头字段:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
RCD004
hhhhhhhhhh
FLD1
<....>
<....>
<....>
<......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
DF created 1 fields in record
format RCD004.
4、使用F18然后再F10,跟上面同样方法改变RCD004记录格式名为:HEADER
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
HEADER
hhhhhhhhhh
FLD1
<....>
<....>
<....>
<......>
RCD002
DPCODE
EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
---------------------------
End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
5、将光标移至常数字段hhhhhhhhhh上,键入F23进行编辑字段:
代码:
Work with Field Keywords
Field . . . . .
. . . : FLD001
Record format . . . . : HEADER
Type options, press Enter.
2=Specify
4=Remove
Opt
Keyword
Opt
Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN
REFFLD
COLOR
FNTCHRSET
SKIPA
CPI FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP
IGCCDEFNT
TIME
More...
F3=Exit
F5=Refresh F9=Input
keyword parameters
F10=Specify information
F12=Cancel
F16=Remove all keywords
6、在DFT选项上键入2编辑常数项,执行,键入' 职工信息 ' ,此处定义的是本报表的表头,然后再键入2次执行:
代码:
Specify Default
Keyword . . . .
. . . : DFT
Field . . . . .
. . . : FLD001
Record format .
. . . : HEADER
Type text of constant, press Enter.
' 职工信息
'
F3=Exit
F5=Refresh
F12=Cancel F16=Remove
keyword
7、键入F10,然后再键入F11将其转换为常数项:
代码:
Specify Field Information
Edited length . . . . . . . . . . . . : 10
Record format . . . . . . . . . . . . : HEADER
Number of keywords
. . . . . . . . . :
1
Number of indicators
. . . . . . . . :
0
Constant keyword
. . . . . . . . . . :
' 职工信息 '
Type choices, press Enter.
Option
indicators . . . . . . . . . .
01-99, N01-N99
More indicators . . . . . . . . . . N
Y=Yes, N=No
Starting
line . . . . . . . . . . . .
1-255
Starting
position . . . . . . . . . .
23
1-255, +nn
F3=Exit
F5=Refresh F11=Convert
to named field
F12=Cancel
8、按2次执行键退出编辑。
用Work with Field Keywords同样的定义方法,可以对表头字体进行编辑,下图显示了定义字形CHRSIZ为2×2时的编辑状态。
注意:只有当打印以后才能看见实际字形,而在5250终端上显示仅仅是普通尺寸字体。
代码:
Specify Character Size
Keyword . . . .
. . . . . . . . . . :
CHRSIZ
Field . . . . .
. . . . . . . . . . :
FLD005
Record format .
. . . . . . . . . . :
HEADER
Type choices, press Enter.
Expand
character size:
Width multiplier . . . . . .
. . . 2
1.0-20.0
Height multiplier . . . . . . . . . 2
1.0-20.0
F3=Exit
F5=Refresh
F12=Cancel F16=Remove
keyword
9、同时定义表头跳页关键字SKIPB:
代码:
Work with Field Keywords
Field . . . . .
. . . : FLD005
Record format . . . . : HEADER
Type options, press Enter.
2=Specify
4=Remove
Opt
Keyword
Opt
Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
> CHRSIZ
FLTPCN
REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
2
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV TEXT
DATSEP
IGCCDEFNT
TIME
More...
F3=Exit
F5=Refresh F9=Input
keyword parameters F10=Specify
information
F12=Cancel
F16=Remove all keywords
10、为什么要定义SKIPB呢?对于链式打印纸来说,每次换页时,应该跳过纸缝再打印表头,SKIPB就是完成这个功能的。
键入执行,完成对表头的关键字的设计。
在表头设计我们共定义了CHRSIZ、SKIPB、DFT这3个关键字。
代码:
Specify Skip Before
Keyword . . . .
. . . . . . . . . . :
SKIPB
Field . . . . .
. . . . . . . . . . :
FLD005
Record format .
. . . . . . . . . . :
HEADER
Number of indicators . . . . . . . . : 0
Type choices, press Enter.
Line
number to skip to before
printing . . . . . . . . . . . . . 1
1-255
Option
indicators . . . . . . . . .
01-99, N01-N99
More indicators . . . . . .
. . . N
Y=Yes, N=No
F3=Exit
F5=Refresh
F12=Cancel F16=Remove
keyword
11、键入执行返回设计报告:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
HEADER
职工信息
FLD1 <.......> <.......>
<.......>
<.....>
RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
12、定义表头页号,使得每打印1页,表头页号自动加1。将光标移动至表头的右上侧,键入F11定义一个页号字段:
代码:
Define Field
Information
Edited length . . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . : HEADER
Number of keywords
. . . . . . . . . :
0
Number of indicators
. . . . . . . . :
0
Type choices, press Enter.
Field .
. . . . . . . . . . . . . . .
FLD009 Name
Option
indicators . . . . . . . . . .
01-99, N01-N99
More indicators . . . . . . . . . . N
Y=Yes, N=No
Starting
line . . . . . . . . . . . .
1-255
Starting
position . . . . . . . . . .
+31
1-255, +nn
Length
of data . . . . . . . . . . . 1
1-378, +nn, -nn
More...
F3=Exit
F5=Refresh F10=Work
with keywords F11=Convert to
constant field
F12=Cancel
13、再键入F10,在关键字PAGNBR选项键入2:
代码:
Work with Field Keywords
Field . . . . .
. . . : FLD009
Record format . . . . : HEADER
Type options, press Enter.
2=Specify
4=Remove
Opt
Keyword
Opt Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
2
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN
REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP
IGCCDEFNT
TIME
More...
F3=Exit
F5=Refresh F9=Input
keyword parameters
F12=Cancel
F16=Remove all keywords
Field FLD009 created in record format HEADER.
14、键入4次执行,定义页号关键字PAGNBR,在定义过程中按执行不必理睬在提示行出现的ERROR信息;返回到Specify Field
Information界面:
代码:
Specify Field Information
Edited length . . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . : HEADER
Number of keywords
. . . . . . . . . :
1
Number of indicators
. . . . . . . . :
0
Type choices, press Enter.
Field .
. . . . . . . . . . . . . . .
FLD009 Name
Option
indicators . . . . . . . . . .
01-99, N01-N99
More indicators . . . . . . . . . .
N
Y=Yes, N=No
Starting
line . . . . . . . . . . . .
1-255
Starting
position . . . . . . . . . .
+31
1-255, +nn
Length
of data . . . . . . . . . . . 1 1-378, +nn, -nn
More...
F3=Exit
F5=Refresh F10=Work
with keywords F11=Convert to
constant field
F12=Cancel
15、键入F11将其转换为常数字段。键入执行,可见PAGNBR字段定义在表头右侧:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<..>
HEADER
职工信息
9999
FLD1
<.......>
<.......>
<.......>
<.....>
RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
16、在左侧命令行上HEADER记录格式上键入DF(Define Field),同时在PAGNBR字段左侧相应位置键入Page:,执行后在页号字段左侧生成常数字段Page:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<..>
DF
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
17、键入执行,现在报表设计完成如下:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2.5 合并记录格式:
我们见到记录格式一共有三个:HEADER、DETAIL、RCD002,需要将HEADER与RCD002合并在一起。
1、在左侧命令行RCD002上键入CLC(Change Line Format and Combine):
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
CLC 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2、键入执行,可见RCD002被合并到HEADER记录格式中,在其行最左侧显示+表示此行为HEADER的记录格式续行:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........> <.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00004
00005
00006
00007
00008
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
3、进一步使用DR(定义一个记录格式)、DF(定义虚线字段)、CLC(合并记录格式至表头)生成按字段宽度分割虚线,即每一个字段与标题之间生成‘------’修饰报表。
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........> <...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........>
<...........>
<.............>
00003 +
----------
-----------
-------------
---------------
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX 999999999999999
00005
00006
00007
00008
00009
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2.6 建立变量型字段:
1、首先使用DR、DF以及重命名功能定义一个记录格式TOTALN。将光标移至小计字段SUBTOTAL下方,键入F11定义一个汇总字段。
字段名我们定义为TOTALX,字段长度17,数据类型为2。
代码:
Define Field Information
Edited length . . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . : TOTALN
Number of keywords
. . . . . . . . . :
0
Number of indicators
. . . . . . . . :
0
Type choices, press Enter.
Field .
. . . . . . . . . . . . . . .
TOTALX Name
Option
indicators . . . . . . . . . .
01-99, N01-N99
More indicators . . . . . . . . . . N
Y=Yes, N=No
Starting
line . . . . . . . . . . . .
1-255
Starting
position . . . . . . . . . .
51
1-255, +nn
Length
of data . . . . . . . . . . . 17
1-378, +nn, -nn
More...
F3=Exit
F5=Refresh F10=Work
with keywords F11=Convert to
constant field
F12=Cancel
2、PageDown下翻一页,定义小数点位置为2位,参照字段Y,使用参照值为N:
代码:
Define Field Information
Edited length . . . . . . . . . . . . : 1
Record format . . . . . . . . . . . . : TOTALN
Number of keywords
. . . . . . . . . :
0
Number of indicators
. . . . . . . . :
0
Type choices, press Enter.
Data
type . . . . . . . . . . . . . .
2
1=Character
2=Zoned
3=Floating point
4=Open
5=Graphic
6=Date
7=Time
8=Time stamp
Decimal
positions . . . . . . . . . .
2
0-31, +n, -n
Reference a field . . . . . . . . . . Y
Y=Yes, N=No
Use
referenced values . . . . . . .
N
Y=Yes, N=No
Bottom
F3=Exit
F5=Refresh F10=Work
with keywords F11=Convert to
constant field
F12=Cancel
3、按2次F10进入Work
with Field Keywords,在REFFLD使用选项2定义参照数据库字段:
代码:
Work with Field Keywords
Field . . . . .
. . . : TOTALX
Record format . . . . : TOTALN
Type options, press Enter.
2=Specify
4=Remove
Opt
Keyword
Opt Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN 2 REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP
IGCCDEFNT
TIME
More...
F3=Exit
F5=Refresh F9=Input
keyword parameters
F12=Cancel
F16=Remove all keywords
Field TOTALX created in record format TOTALN.
4、键入执行,在Field使用F4,选择对应字段SUBTOTAL,然后再键入3次执行返回设计报告:
代码:
Specify Referenced Field
Keyword . . . . . . . . . . . . . . : REFFLD
Field . . . . . . . . . . . . . . . : TOTALX
Record format . . . . . . . . . . . : TOTALN
Type choices, press Enter.
Field .
. . . . . . . . . . . . . .
SUBTOTAL Name
F4 for list
Record format . . . . . . . . . . EMPLOY Name
F4 for list
File . . . . . . . . . . . .
. . . EMPLOYEES Name
*SRC
F4
for list
Library . . . . . . . . . . . . . EDISYSTEM Name
*LUPARLIB
*LIBL
F3=Exit
F4=Prompt
F5=Refresh
F12=Cancel F16=Remove
keyword
5、将光标放置在刚刚生成的字段TOTALX使用F23编辑字段显示格式:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........>
<...........>
<.............>
00003 + ---------- ----------- -------------
---------------
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00005
00006
00007
00008
00009
FLD1
<...............>
TOTALN
99999999999999999
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
6、键入2定义编辑码EDTCDE,键入执行,将编辑码定义为O,然后键入2次执行:
代码:
Specify Edit Code
Keyword . . . .
. . . . . . . . . . :
EDTCDE
Field . . . . .
. . . . . . . . . . :
TOTALX
Record format .
. . . . . . . . . . :
TOTALN
Type choices, press Enter.
Edit
code . . . . . . . . . . . . . O
1-9, A-D, J-Q, W-Z
Fill
character . . . . . . . . . . .
*
Currency symbol
F3=Exit
F5=Refresh
F12=Cancel F16=Remove
keyword
7、使用Insert插入/Delete删除键向左/右调整TOTALX字段位置。
最后完整的报表设计完成如下:
代码:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........>
<...........>
<.............>
00003 +
----------
-----------
-------------
---------------
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00005
00006
00007
00008
00009
FLD1
<.....................>
TOTALN
9 999,999,999,999,999.99
--------------------------- End of Report -----------------------------
F3=Exit
F11=Define field
F16=Delete field
F22=Alternative keys
F24=More keys
2.7 保存报表设计名生成打印文件PRTF:
1、按F3退出,选择生成打印文件Create printer file,改变默认值Change defaults,可以选择生成原型报告Prototype report 。
代码:
Exit RLU
Type choices, press Enter.
Option . . . . . . . . . . .
. . . 1
1=Save and exit
2=Exit without saving
3=Resume
Member . . . . . . . . . . .
. . LPRTF01 Name
File . . . . . . . . . . . .
. . QDDSSRC Name
Library . . . . . . . . . . . . . EDISYSTEM Name
Text . . . . . . . . . . . .
. . Demo for
Design Report
Create
printer file . . . . . . . . y
Y=Yes, N=No
Change defaults . . . . . . . . . y
Y=Yes, N=No
Prototype report . . . . . .
. . . y
Y=Yes, N=No
Change defaults . . . . . . . . . N
Y=Yes, N=No
Submit
to batch . . . . . . . . . .
N
Y=Yes, N=No
Job description . . . . . . . . . *USRPRF Name, *USRPRF,
*RLU
Library . . . . . . . . . . . . .
Name, *LIBL, *LUPARLIB
F5=Refresh
F12=Cancel
2、键入执行,转到生成打印文件界面Create Printer File (CRTPRTF),再使用F10修改附加值,横向压缩打印字符:在生成打印文件选项将每英寸10个字符改为15个字符,按A3尺寸的纸型设计时,纸宽为12英寸,每行打印198或者204个字符(与具体打印机有关),15CPI(每英寸字符数)× 198 ≈ 12英寸 。
代码:
Create Printer File (CRTPRTF)
Type choices, press Enter.
Additional Parameters
Page size:
Length--lines per page . . . . 66
.001-255.000
Width--positions per line . . > 198
.001-378.000
Measurement method . . . . . . *ROWCOL *ROWCOL,
*UOM
Lines per inch . . . . . . . . . 6
6, 3, 4, 7.5, 7,5, 8, 9, 12
Characters per inch
. . . . . . 15
10, 5, 12, 13.3, 13,3, 15...
Front margin:
Offset
down . . . . . . . . . *DEVD
0-57.790, *DEVD
Offset
across . . . . . . . .
0-57.790
Back margin:
Offset
down . . . . . . . . . *FRONTMGN 0-57.790, *FRONTMGN,
*DEVD
Offset
across . . . . . . . .
0-57.790
Overflow line number . . . . . . 60
1-255
More...
F3=Exit
F4=Prompt
F5=Refresh
F12=Cancel F13=How to
use this display
F24=More keys
3、系统提示已经成功生成了打印文件LPRTF01。
我们可以使用PDM选项19=Change using RLU 对其源文件进行修改。
当然,我们也可以通过2直接对源码进行修改;除非有特别需要,对于RLU,我们不提倡直接对源码进行修改。
代码:
Work with Members Using PDM
S
File . . . . .
. QDDSSRC
Library
. . . .
EDISYSTEM
Position to . . . . .
Type options, press Enter.
16=Run
procedure 17=Change
using SDA
19=Change using RLU
25=Find
string
54=Compare
55=Merge ...
Opt
Member Type
Text
19
LPRTF01
PRTF Demo
for Design Report
MASCDP PF
SYSTEM CODE DETAIL
MCITAP PF
<V1.3 >ITEM MASTER
MCITCL5 LF
<XLLC>
MCITCP PF
PROCESS SEQUENCE ITEM MASTER
MENUPGM PF
EDI System Pulldown Menu PF
MJR84TJ PRTF ITEM
RECEIPT PAGESIZE(51 132 *ROWCOL) OVRFLW(51)N
REFILE PF
Data Dictionary Reference File (exercise)
More...
Parameters or command
===>
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve F10=Command
entry F23=More
options
F24=More keys
4、我们可以通过SPLF检查编译出现的问题和表样输出,对于编译错误,我们可以通过SPLF编译列表检查错误并修正。
最终生成的报表样本如下:
代码:
列 . . . : 1 71
设计报告
EDISYSTEM/QDDSSRC
RLU==>
LPRTF01
BASE
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7
--------------------------- 开始页码 001 ----------------------------
FLD1
<........>
<...><..>
HEADER
职工信息
Page:9999
FLD1
<.......>
<......>
<......>
<....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........>
<...........>
<.............>
00003 +
----------
-----------
------------- ---------------
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL
XXXXX
XXXXXXX
XXXXXXXXXXXX
999999999999999
00005
00006
00007
00008
00009
FLD1
<.....................>
TOTALN
999,999,999,999,999.99
----------------------------- 报告结束 ------------------------------
F3= 退出 F11= 定义字段 F16= 删除字段
F22= 备用键
F24= 其余键
附:LPRTF01这个PRTF的源码:
代码:
A*%%TS DD 20041214 190605 LIU
REL-V5.1 iSeries
WDT
A*%%FI+1066660100000000000000000000000000000000000000000000000000
A*%%FI
0000000000000000000000000000000000000000000000000
A*%%PR 1066198I
A*%%FD Demo for Design Report
A*%%EC
A
R HEADER
A*%%TS DD 20041214 190447 LIU
REL-V5.1 iSeries
WDT
A*%%RI 00000
A
FLD005
A
SKIPB(1)
A
FLD010
A
+0PAGNBR
A
FLD008
A
+3'部门码'
A
+8'雇员名'
A
+12'小计'
A
FLD011
A
FLD012
A
FLD013
A
FLD014
A*%%GP REPORT1
01
A*%%SS
A*%%SN FLD005
职工信息
A*%%SN FLD010
Page:
A*%%SN FLD008
雇员码
A*%%SN FLD011
----------
A*%%SN FLD012
-----------
A*%%SN FLD013
-------------
A*%%SN FLD014
---------------
A
R DETAIL
A*%%TS DD 20041214 190447 LIU
REL-V5.1 iSeries
WDT
A*%%RI 00005
A
SPACEB(1)
A
DPCODE R
O 4REFFLD(EMPLOY/DPCODE +
A
EDISYSTEM/EMPLOYEES)
A
EYCODE R
O +6REFFLD(EMPLOY/EYCODE +
A
EDISYSTEM/EMPLOYEES)
A
EYNAME R
O +10REFFLD(EMPLOY/EYNAME
+
A
EDISYSTEM/EMPLOYEES)
A
SUBTOTAL R
O
+7REFFLD(EMPLOY/SUBTOTAL +
A
EDISYSTEM/EMPLOYEES)
A*%%GP REPORT1
02
A
R TOTALN
A*%%TS DD 20041214 190447 LIU
REL-V5.1 iSeries
WDT
A*%%RI 00000
A
SPACEB(1)
A
TOTALX R 17S 2O 48REFFLD(EMPLOY/SUBTOTAL
+
A
EDISYSTEM/EMPLOYEES)
A
EDTCDE(O)
A*%%GP REPORT1
03
A*%%SS
A*%%SN TOTALX
99999999999999999
A*%%CS+99999CRTPRTF
A*%%CS+ FILE(QTEMP/QPRDRPT )
A*%%CS+ DEVTYPE(*SCS)
A*%%CS PAGESIZE(*N 198 *N )
RPG程序设计的初衷就是为了设计报表以供系统打印。随着技术的改进和OS/400版本的不断升级,现在的许多输出设备都已经改变了传统报表的用法,原来使用程序定义定义文件设计报表,目前则经常采用报表设计工具RLU来设计打印文件PRTF,然后再通过RPGIV+PRTF组合来编制程序。
本文将以本地OS/400 V5R
一、PF文件说明:
1、EDISYSTEM/QDDSSRC(REFILE)为数据公共字典PF:
A* CREATE BY
TRF.LIUYUANYAO 2004.12.12
A* DATA DICTIONARY
REFERENCE FILE
A*----------------------------------------------------
A
R REFMT
**
A* CHARACTER SET
A
CODE
A
ID
**
A* DBCS-OPEN SET
A
NAME1
12O
A
NAME2
12O
A
DESCRPT 30O
**
A** NUMERIAL SET
A
AMOUNT 15 2
A PRICE
11 2
A
QUATITY 7 0
**
A** DATE SET
A
DATE
2、EDISYSTEM/QDDSSRC(EMPLOYEES)为参照数据公共字典的其中一个PF:
A* PROGRAMER :
TRF.LIUYUANYAO 2004.12.14
A* PROGRAM NAME : EMPLOYEES
A*****************************************************************
A
REF(*LIBL/REFILE)
A
UNIQUE
A
R EMPLOY
A
EYCODE R
REFFLD(ID)
A
COLHDG('雇员码')
A
DPCODE R
REFFLD(CODE)
A
COLHDG('部门码')
A
EYNAME R
REFFLD(NAME2)
A
COLHDG('雇员名')
A
SUBTOTAL R
REFFLD(AMOUNT)
A
COLHDG('小计')
A*
A
K EYCODE
A
K DPCODE
二、使用RLU的具体操作步骤:
2.1 为打印文件选择数据库:
1、在OS/400命令行敲入STRRLU+F4,分别在Source
file、Library、Source member输入对应内容,并且定义Page width...198 。
Start Report Layout Utility (STRRLU)
Type choices, press Enter.
Source file . . . . . . . . . . > QDDSSRC Name,
*PRV
Library . . . . . . . . . . . > EDISYSTEM Name, *LIBL, *LUPARLIB, *PRV Source member . . . . . . . . . > LPRTF01 Name,
*PRV Option . . . . . . . . . . . . . 2
2, 6
Page width . . . . . . . . . . . >
198
1-378, *SAME
Text 'description' . . . . . . . >
'DEMO for Design Report'
Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More
keys
|
2、执行后出现如下效果,RLU展示出报表设计屏面。
我们可以使用SEU对其进行编辑:左边的'''''''为功能定义区域,空白区为设计编辑显示区域;左侧开始BASE显示了打印时出标尺;...+...
1 ...+... 2 最大可以定义378个字符位置。
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01
BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- '''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
''''''' '''''''
'''''''
'''''''
'''''''
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
Record length of
source file greater than 92. + |
3、按F10,输入Library、File、Record,将光标停在Field栏按F4 :
4、出现如下界面后再在Field栏按F4:
Add Database Fields
Type choices, press Enter.
File . . . . . . . . . . . EMPLOYEES Name, F4
for list
Library . . . . . . . . EDISYSTEM Name, *LIBL,
*LUPARLIB
Record format . . . . . . EMPLOY
Name, F4 for list
Field . . . . . . . . . . Name,
F4 for list
F4=Prompt F5=Refresh F12=Cancel
Specify field
name.
|
5、执行后可见下图,键入1=Select,选择数据库所有的字段;然后连续键入3次执行:
Select Database Fields
File . . . . . . . . : EMPLOYEES Record .
. . . . . . : EMPLOY Library . . . . . : EDISYSTEM
Position to . . . . .
Field
Subset . . . . . . . . *ALL
*ALL, name, *generic*
Type options, press Enter.
1=Select 8=Display field description
Column
Opt Field
Length Type Heading
1 DPCODE
5 Character
DPCODE
1 EYCODE
7 Character
EYCODE
1 EYNAME
12 Bracketed DBCS EYNAME
1 SUBTOTAL 15,2 Zoned decimal
SUBTOTAL
Bottom F5=Refresh F11=Display unsorted F12=Cancel
DBCS characters in field DPCODE column
heading. Heading defaults to field... + |
6、我们可以发现刚才所选择的数据库字段已经放置在设计界面底端。
Columns . . .
: 1 71
Design Report EDISYSTEM/QDDSSRC
RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001 ---------------------------
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
--------------------------- End of Report
-----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2.2 定义记录格式:
打印过程是通过RPGIV程序使用写语句将记录输出写至打印文件。写语句后面所调用的是记录格式,每执行一次RPGIV写程序,就调用一次RLU文件中的记录格式,因此我们首先需要定义记录格式。
1、在左侧定义键入DR(Define
Record Format):
Columns . . . : 1 71 Design
Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- DR
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
--------------------------- End of Report
-----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2、键入执行后,可以看见DR定义自动生成的名为RCD001记录格式。
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- RCD001
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
3、不够规范吧,那就改名。键入F18,选择记录关键字。
Work with Record Keywords
Record format . . . . : RCD001
Type options, press Enter.
2=Specify 4=Remove
Opt Keyword
Opt
Keyword
Opt
Keyword
CDEFNT
LPI
CHRSIZ
PAGRTT
CPI
PRTQLTY
DFNCHR
SKIPA
DFNLIN
SKIPB
DRAWER
SPACEA
FNTCHRSET
SPACEB
FONT
TEXT
HIGHLIGHT
IGCCDEFNT
IGCCHRRTT
INDTXT
Bottom F3=Exit
F5=Refresh F9=Input
keyword parameters
F10=Rename record F12=Cancel F16=Remove all keywords
|
4、再按F10=Rename
record,将记录格式名改为:DETAIL。
Rename Record Format
Number of keywords . . . . . . . . .
: 0
Type choice, press Enter.
Record format . . . . . . . . . . . DETAIL Name
F3=Exit F5=Refresh F12=Cancel
|
5、连续2次执行键后,记录格式名已经改为了DETAIL。
Columns . . .
: 1 71 Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- DETAIL
--------------------------- End of Report
-----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2.3 放置数据库字段:
1、在DETAIL键入VF(View
Field)插入字段观察命令:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- VF
--------------------------- End of Report -----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2、键入执行,可见左侧显示生成一个FLD1字段区准备放置F10所选择的数据库文件字段:
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
DETAIL
--------------------------- End of Report
-----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
3、将编辑屏幕下方的数据库文件字段序号按字段比例键入对应位置,c表示将字段表头放在上方。
注意:一定要放置与FLD1同一行上;同时要预先估算一下留出的每个字段长度与下个字段长度的间隔,防止字段相互覆盖。
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1 DETAIL
--------------------------- End of Report
-----------------------------
1:DPCODE 2:EYCODE 3:EYNAME 4:SUBTOTAL
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
4、键入执行,将数据库字段放置在设计报告上。
假设出现了字段间互相覆盖,可以使用F13消除字段区,F15移动字段区,F16字段删除,以调整各个字段间隔。
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<....>
<....>
<....>
<......>
RCD002 DPCODE EYCODE EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
5、在DETAIL命令行键入样本数据命令SD5(Sample Data),执行后参见下图,可见已经生成5行样本数据:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<....>
<....>
<....>
<......>
RCD002 DPCODE EYCODE
EYNAME
SUBTOTAL FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00003 00004 00005 00006 00007
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2.4 定义表头:
1、在左侧命令行键入I插入一行,并键入DR定义一个记录格式,执行:
Columns . . .
: 1
71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- DR
FLD1
<....>
<....>
<....>
<......>
RCD002 DPCODE EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00003 00004 00005 00006 00007
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys F24=More keys
|
2、然后在刚刚生成的记录格式上键入DF,并且在同一编辑行居中位置键入“hhhhhhhhhh”,定义一个常数字段:
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- DF
hhhhhhhhhh
FLD1
<....>
<....>
<....> <......>
RCD002 DPCODE EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX 999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
3、键入执行,生成新的记录格式名RCD004以及表头字段:
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
RCD004
hhhhhhhhhh
FLD1
<....>
<....>
<....>
<......>
RCD002 DPCODE EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX 999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys F24=More
keys
DF created 1 fields in record format RCD004.
|
4、使用F18然后再F10,跟上面同样方法改变RCD004记录格式名为:HEADER
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
HEADER
hhhhhhhhhh
FLD1
<....>
<....>
<....>
<......>
RCD002 DPCODE EYCODE
EYNAME
SUBTOTAL
FLD1
<...>
<.....>
<..........>
<.............>
DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field F22=Alternative keys
F24=More keys
|
5、将光标移至常数字段hhhhhhhhhh上,键入F23进行编辑字段:
Work with Field
Keywords
Field . . . . . . . . : FLD001
Record format . . . .
: HEADER
Type options, press Enter.
2=Specify 4=Remove
Opt Keyword
Opt
Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN
REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP IGCCDEFNT
TIME
More... F3=Exit F5=Refresh F9=Input keyword parameters F10=Specify information F12=Cancel F16=Remove all keywords
|
6、在DFT选项上键入2编辑常数项,执行,键入'
职工信息 ' ,此处定义的是本报表的表头,然后再键入2次执行:
Specify Default
Keyword . . . . . . . : DFT Field . . . . . . . . : FLD001
Record format . . . . : HEADER
Type text of constant, press
Enter.
' 职工信息 '
F3=Exit F5=Refresh F12=Cancel F16=Remove keyword
|
7、键入F10,然后再键入F11将其转换为常数项:
Specify Field Information
Edited length . . . . . . . . . . . .
: 10 Record format . . . . . . . . . . . .
: HEADER
Number of keywords . . . . . . . . . : 1
Number of indicators . . . . . . . . : 0
Constant keyword . . . . . . . . . . : ' 职工信息 '
Type choices, press Enter.
Option indicators . . . . . . .
. . . 01-99, N01-N99
More indicators . .
. . . . . . . .
N
Y=Yes, N=No
Starting line . . . . . . . . .
. . . 1-255
Starting position . . . . . . .
. . . 23
1-255, +nn
F3=Exit F5=Refresh F11=Convert to named field F12=Cancel
|
8、按2次执行键退出编辑。
用Work with Field Keywords同样的定义方法,可以对表头字体进行编辑,下图显示了定义字形CHRSIZ为2×2时的编辑状态。
注意:只有当打印以后才能看见实际字形,而在5250终端上显示仅仅是普通尺寸字体。
Specify Character Size
Keyword . . . . . . . . . . . . . . : CHRSIZ
Field . . . . . . . . . . . . . . . : FLD005
Record format . . . . . . . . . . . : HEADER
Type choices, press Enter.
Expand character size:
Width multiplier . . . . . . . . . 2 1.0-20.0
Height multiplier . . . .
. . . . . 2 1.0-20.0
F3=Exit F5=Refresh F12=Cancel F16=Remove keyword
|
9、同时定义表头跳页关键字SKIPB:
Work with Field Keywords
Field . . . . . . . . : FLD005
Record format . . . .
: HEADER
Type options, press Enter.
2=Specify 4=Remove
Opt Keyword Opt Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
> CHRSIZ
FLTPCN REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
2 SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP
IGCCDEFNT
TIME
More... F3=Exit F5=Refresh F9=Input keyword parameters F10=Specify information F12=Cancel F16=Remove all keywords
|
10、为什么要定义SKIPB呢?对于链式打印纸来说,每次换页时,应该跳过纸缝再打印表头,SKIPB就是完成这个功能的。
键入执行,完成对表头的关键字的设计。
在表头设计我们共定义了CHRSIZ、SKIPB、DFT这3个关键字。
Specify Skip Before
Keyword . . . . . . . . . . . . . . : SKIPB
Field . . . . . . . . . . . . . . . : FLD005
Record format . . . . . . . . . . . : HEADER
Number of indicators . . . . . . . .
: 0
Type choices, press Enter.
Line number to skip to
before
printing
. . . . . . . . . . . . .
1 1-255
Option indicators . . . . . . . . . 01-99, N01-N99
More indicators . . . . . . . . . N
Y=Yes, N=No
F3=Exit F5=Refresh F12=Cancel F16=Remove keyword
|
11、键入执行返回设计报告:
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
HEADER
职工信息
FLD1 <.......> <.......>
<.......>
<.....> RCD002 雇员码 部门码
雇员名
小计 FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
12、定义表头页号,使得每打印1页,表头页号自动加1。将光标移动至表头的右上侧,键入F11定义一个页号字段:
Define Field Information
Edited length . . . . . . . . . . . .
: 1
Record format . . . . . . . . . . . .
: HEADER
Number of keywords . . . . . . . . . : 0
Number of indicators . . . . . . . . : 0
Type choices, press Enter.
Field . . . . . . . . . . . . .
. . . FLD009
Name
Option indicators . . . . . . .
. . .
01-99, N01-N99
More indicators . .
. . . . . . . .
N
Y=Yes, N=No
Starting line . . . . . . . . .
. . .
1-255
Starting position . . . . . . .
. . . +31
1-255, +nn
Length of data . . . . . . . . . . . 1
1-378, +nn, -nn
More... F3=Exit F5=Refresh F10=Work with keywords F11=Convert to constant
field F12=Cancel
|
13、再键入F10,在关键字PAGNBR选项键入2:
Work with Field Keywords
Field . . . . . . . . : FLD009
Record format . . . .
: HEADER
Type options, press Enter.
2=Specify 4=Remove
Opt Keyword
Opt
Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
2 PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN
REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV TEXT
DATSEP
IGCCDEFNT
TIME
More... F3=Exit F5=Refresh F9=Input keyword parameters F12=Cancel F16=Remove all keywords
Field FLD009 created in record format
HEADER.
|
14、键入4次执行,定义页号关键字PAGNBR,在定义过程中按执行不必理睬在提示行出现的ERROR信息;返回到Specify Field Information界面:
Specify Field Information
Edited length . . . . . . . . . . . .
: 1
Record format . . . . . . . . . . . .
: HEADER
Number of keywords . . . . . . . . . : 1
Number of indicators . . . . . . . . : 0
Type choices, press Enter.
Field . . . . . . . . . . . . .
. . . FLD009
Name
Option indicators . . . . . . .
. . .
01-99, N01-N99
More indicators . .
. . . . . . . .
N
Y=Yes, N=No
Starting line . . . . . . . . .
. . . 1-255
Starting position . . . . . . .
. . . +31
1-255, +nn
Length of data . . . . . . . . . . . 1
1-378, +nn, -nn
More... F3=Exit F5=Refresh F10=Work with keywords F11=Convert to constant
field F12=Cancel
|
15、键入F11将其转换为常数字段。键入执行,可见PAGNBR字段定义在表头右侧:
Columns . . .
: 1 71
Design Report EDISYSTEM/QDDSSRC
RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<..> HEADER
职工信息
9999 FLD1
<.......>
<.......>
<.......>
<.....> RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........> <.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008 ---------------------------
End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
16、在左侧命令行上HEADER记录格式上键入DF(Define Field),同时在PAGNBR字段左侧相应位置键入Page:,执行后在页号字段左侧生成常数字段Page:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<..> DF
职工信息
Page:9999 FLD1
<.......>
<.......>
<.......>
<.....> RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
17、键入执行,现在报表设计完成如下:
Columns . . .
: 1 71
Design Report EDISYSTEM/QDDSSRC
RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001 ---------------------------
FLD1
<........>
<...><..> HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....> RCD002 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........> <.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008 ---------------------------
End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2.5 合并记录格式:
我们见到记录格式一共有三个:HEADER、DETAIL、RCD002,需要将HEADER与RCD002合并在一起。
1、在左侧命令行RCD002上键入CLC(Change
Line Format and Combine):
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<...><..> HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....> CLC 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........> <.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008 ---------------------------
End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2、键入执行,可见RCD002被合并到HEADER记录格式中,在其行最左侧显示+表示此行为HEADER的记录格式续行:
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<...><..> HEADER
职工信息
Page:9999
FLD1 <.......> <.......>
<.......>
<.....> 00002 + 雇员码 部门码
雇员名
小计
FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX XXXXXXXXXXXX
999999999999999 00004 00005 00006 00007 00008
--------------------------- End of Report -----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
3、进一步使用DR(定义一个记录格式)、DF(定义虚线字段)、CLC(合并记录格式至表头)生成按字段宽度分割虚线,即每一个字段与标题之间生成‘------’修饰报表。
Columns . . .
: 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<...><..> HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....> 00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........> <...........> <.............> 00003 + ---------- ----------- -------------
--------------- FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00005 00006 00007 00008 00009
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
2.6 建立变量型字段:
1、首先使用DR、DF以及重命名功能定义一个记录格式TOTALN。将光标移至小计字段SUBTOTAL下方,键入F11定义一个汇总字段。
字段名我们定义为TOTALX,字段长度17,数据类型为2。
Define Field Information
Edited length . . . . . . . . . . . .
: 1
Record format . . . . . . . . . . . .
: TOTALN
Number of keywords . . . . . . . . . : 0
Number of indicators . . . . . . . . : 0
Type choices, press Enter.
Field . . . . . . . . . . . . .
. . . TOTALX
Name
Option indicators . . . . . . .
. . .
01-99, N01-N99
More indicators . .
. . . . . . . .
N
Y=Yes, N=No
Starting line . . . . . . . . .
. . .
1-255
Starting position . . . . . . .
. . . 51
1-255, +nn
Length of data . . . . . . . . . . . 17
1-378, +nn, -nn
More... F3=Exit F5=Refresh F10=Work with keywords F11=Convert to constant
field F12=Cancel
|
2、PageDown下翻一页,定义小数点位置为2位,参照字段Y,使用参照值为N:
Define Field Information
Edited length . . . . . . . . . . . .
: 1
Record format . . . . . . . . . . . .
: TOTALN
Number of keywords . . . . . . . . . : 0
Number of indicators . . . . . . . . : 0
Type choices, press Enter.
Data type . . . . . . . . . . .
. . . 2 1=Character
2=Zoned
3=Floating point
4=Open
5=Graphic
6=Date
7=Time
8=Time stamp
Decimal positions . . . . . . .
. . . 2
0-31, +n, -n
Reference a field . . . . . . .
. . . Y Y=Yes,
N=No
Use referenced
values . . . . . . . N Y=Yes,
N=No
Bottom F3=Exit F5=Refresh F10=Work with keywords F11=Convert to constant field F12=Cancel
|
3、按2次F10进入Work
with Field Keywords,在REFFLD使用选项2定义参照数据库字段:
Work with Field Keywords
Field . . . . . . . . : TOTALX
Record format . . . .
: TOTALN
Type options, press Enter.
2=Specify 4=Remove
Opt Keyword
Opt
Keyword
Opt
Keyword
ALIAS
DFT
IGCCHRRTT
BARCODE
DLTEDT
INDTXT
BLKFOLD
EDTCDE
MSGCON
CDEFNT
EDTWRD
PAGNBR
CHRID
FLTFIXDEC
PRTQLTY
CHRSIZ
FLTPCN
2 REFFLD
COLOR
FNTCHRSET
SKIPA
CPI
FONT
SKIPB
CVTDTA
HIGHLIGHT
SPACEA
DATE
IGCALTTYP
SPACEB
DATFMT
IGCANKCNV
TEXT
DATSEP
IGCCDEFNT
TIME
More... F3=Exit F5=Refresh F9=Input keyword parameters F12=Cancel
F16=Remove all keywords
Field TOTALX created in record format
TOTALN.
|
4、键入执行,在Field使用F4,选择对应字段SUBTOTAL,然后再键入3次执行返回设计报告:
Specify Referenced Field
Keyword . . . . . . . . . . . . . .
: REFFLD
Field . . . . . . . . . . . . . . .
: TOTALX
Record format . . . . . . . . . . .
: TOTALN
Type choices, press Enter.
Field . . . . . . . . . . . . .
. . SUBTOTAL Name
F4 for list
Record format . . .
. . . . . . . EMPLOY Name
F4 for list
File . . . . . . . . . . . . . . . EMPLOYEES Name
*SRC
F4
for list
Library . . . . . .
. . . . . . . EDISYSTEM
Name
*LUPARLIB
*LIBL
F3=Exit F4=Prompt F5=Refresh F12=Cancel F16=Remove keyword
|
5、将光标放置在刚刚生成的字段TOTALX使用F23编辑字段显示格式:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<...><..> HEADER
职工信息
Page:9999
FLD1
<.......>
<.......>
<.......>
<.....> 00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........> <...........> <.............> 00003 + ---------- ----------- -------------
--------------- FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00005 00006 00007 00008 00009 FLD1
<...............> TOTALN
99999999999999999
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field
F22=Alternative keys
F24=More keys
|
6、键入2定义编辑码EDTCDE,键入执行,将编辑码定义为O,然后键入2次执行:
Specify Edit Code
Keyword . . . . . . . . . . . . . . : EDTCDE
Field . . . . . . . . . . . . . . . : TOTALX
Record format . . . . . . . . . . . : TOTALN
Type choices, press Enter.
Edit code . . . . . . . . . . . . . O
1-9, A-D, J-Q, W-Z
Fill character . . . . . . . . .
. .
*
Currency symbol
F3=Exit F5=Refresh F12=Cancel F16=Remove keyword
|
7、使用Insert插入/Delete删除键向左/右调整TOTALX字段位置。
最后完整的报表设计完成如下:
Columns . . . : 1 71
Design Report
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
------------------------- Start of Page 001
--------------------------- FLD1
<........>
<...><..> HEADER
职工信息
Page:9999 FLD1
<.......>
<.......>
<.......>
<.....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........> <...........>
<.............>
00003 + ---------- ----------- -------------
--------------- FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00005 00006 00007 00008 00009 FLD1
<.....................>
TOTALN
9
999,999,999,999,999.99
--------------------------- End of Report
-----------------------------
F3=Exit F11=Define field F16=Delete field F22=Alternative keys
F24=More keys
|
2.7 保存报表设计名生成打印文件PRTF:
1、按F3退出,选择生成打印文件Create
printer file,改变默认值Change defaults,可以选择生成原型报告Prototype report 。
Exit RLU
Type choices, press Enter.
Option . . . . . . . . . . . . . . 1
1=Save and exit
2=Exit without saving
3=Resume
Member . . . . . . . . . . . . . LPRTF01 Name
File . . . . . . . . . . . . . . QDDSSRC Name Library . . . . . .
. . . . . . .
EDISYSTEM Name
Text . . . . . . . . . . . . . . Demo for Design
Report
Create printer file . . . . . .
. . y
Y=Yes, N=No
Change defaults . .
. . . . . . . y
Y=Yes, N=No
Prototype report . . . . . . . . . y
Y=Yes, N=No
Change defaults . .
. . . . . . .
N
Y=Yes, N=No
Submit to batch . . . . . . . .
. . N
Y=Yes, N=No
Job description . .
. . . . . . .
*USRPRF
Name, *USRPRF, *RLU Library . . . . . .
. . . . . . .
Name, *LIBL, *LUPARLIB
F5=Refresh F12=Cancel
|
2、键入执行,转到生成打印文件界面Create Printer File (CRTPRTF),再使用F10修改附加值,横向压缩打印字符:在生成打印文件选项将每英寸10个字符改为15个字符,按A3尺寸的纸型设计时,纸宽为
Create Printer File (CRTPRTF)
Type choices, press Enter.
Additional Parameters
Page size:
Length--lines per page . . .
. 66
.001-255.000
Width--positions per line . . >
198
.001-378.000
Measurement method . . . . .
. *ROWCOL *ROWCOL,
*UOM
Lines per inch . . . . . . . . . 6
6, 3, 4, 7.5, 7,5, 8, 9, 12
Characters per inch . . . . . . 15 10,
5, 12, 13.3, 13,3, 15... Front margin:
Offset down . . . . . . . . . *DEVD
0-57.790, *DEVD
Offset across . . . . . . . .
0-57.790
Back margin:
Offset down . . . . . . . . . *FRONTMGN 0-57.790, *FRONTMGN,
*DEVD Offset across . . . . . . . .
0-57.790
Overflow line number . . . . . . 60
1-255
More...
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More
keys
|
3、系统提示已经成功生成了打印文件LPRTF01。
我们可以使用PDM选项19=Change using RLU 对其源文件进行修改。
当然,我们也可以通过2直接对源码进行修改;除非有特别需要,对于RLU,我们不提倡直接对源码进行修改。
Work with Members Using PDM
S
File . . . . . . QDDSSRC
Library . . . . EDISYSTEM
Position to . . . . .
Type options, press Enter.
16=Run procedure 17=Change using SDA
19=Change using RLU
25=Find string
54=Compare
55=Merge ...
Opt Member Type Text
19 LPRTF01 PRTF
Demo for Design Report
MASCDP PF
SYSTEM CODE DETAIL
MCITAP PF
<V1.3 >ITEM MASTER
MCITCL5 LF
<XLLC>
MCITCP PF PROCESS
SEQUENCE ITEM MASTER
MENUPGM PF
EDI System Pulldown Menu PF
MJR84TJ PRTF
ITEM RECEIPT PAGESIZE(51 132 *ROWCOL) OVRFLW(51)N REFILE PF
Data Dictionary Reference File (exercise)
More... Parameters or command
===>
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve F10=Command
entry F23=More
options
F24=More keys
|
4、我们可以通过SPLF检查编译出现的问题和表样输出,对于编译错误,我们可以通过SPLF编译列表检查错误并修正。
最终生成的报表样本如下:
列
. . . : 1 71
设计报告
EDISYSTEM/QDDSSRC RLU==>
LPRTF01 BASE ...+... 1 ...+... 2
...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
---------------------------
开始页码 001
---------------------------- FLD1
<........>
<...><..> HEADER
职工信息 Page:9999 FLD1
<.......>
<......>
<......>
<....>
00002 + 雇员码 部门码
雇员名
小计
FLD1
<........>
<.........> <...........>
<.............> 00003 + ---------- ----------- -------------
--------------- FLD1
<...>
<.....>
<..........>
<.............> DETAIL XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00005 S XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00006 S XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00007 S XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00008 S XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 00009 S XXXXX XXXXXXX
XXXXXXXXXXXX
999999999999999 FLD1
<.....................>
TOTALN
999,999,999,999,999.99
-----------------------------
报告结束
------------------------------
F3= 退出 F11= 定义字段 F16= 删除字段
F22= 备用键
F24= 其余键
|
附:LPRTF01这个PRTF的源码:
A*%%TS DD 20041214 190605 LIU
REL-V5.1
iSeries WDT
A*%%FI+1066660100000000000000000000000000000000000000000000000000 A*%%FI
0000000000000000000000000000000000000000000000000 A*%%PR 1066198I A*%%FD Demo for
Design Report A*%%EC A
R HEADER A*%%TS DD 20041214 190447 LIU
REL-V5.1
iSeries WDT A*%%RI 00000 A
FLD005 A
SKIPB(1) A
FLD010
A
+0PAGNBR A
FLD008
A
+3'部门码' A
+8'雇员名' A
+12'小计' A
FLD011 A
FLD012 A
FLD013 A
FLD014 A*%%GP REPORT1 01 A*%%SS A*%%SN FLD005 职工信息 A*%%SN FLD010 Page: A*%%SN FLD008 雇员码 A*%%SN FLD011 ---------- A*%%SN FLD012 ----------- A*%%SN FLD013 ------------- A*%%SN FLD014 --------------- A
R DETAIL A*%%TS DD 20041214 190447 LIU
REL-V5.1
iSeries WDT A*%%RI 00005 A
SPACEB(1) A
DPCODE R
O
4REFFLD(EMPLOY/DPCODE + A
EDISYSTEM/EMPLOYEES) A
EYCODE R
O
+6REFFLD(EMPLOY/EYCODE + A
EDISYSTEM/EMPLOYEES) A
EYNAME R
O
+10REFFLD(EMPLOY/EYNAME + A
EDISYSTEM/EMPLOYEES) A
SUBTOTAL R
O
+7REFFLD(EMPLOY/SUBTOTAL + A
EDISYSTEM/EMPLOYEES) A*%%GP REPORT1 02 A
R TOTALN A*%%TS DD 20041214 190447 LIU
REL-V5.1
iSeries WDT A*%%RI 00000 A
SPACEB(1) A
TOTALX R 17S 2O 48REFFLD(EMPLOY/SUBTOTAL + A
EDISYSTEM/EMPLOYEES) A
EDTCDE(O) A*%%GP REPORT1 03 A*%%SS A*%%SN TOTALX 99999999999999999 A*%%CS+99999CRTPRTF A*%%CS+ FILE(QTEMP/QPRDRPT ) A*%%CS+ DEVTYPE(*SCS) A*%%CS PAGESIZE(*N 198 *N ) |
Exit
point: QIBM_QTF_TRANSFER(程序1) QIBM_QZDA_NDB1(程序2)
程序1.
PGM PARM(&RC &STRU)
DCL VAR(&RC) TYPE(*CHAR) LEN(1)
DCL VAR(&STRU) TYPE(*CHAR) LEN(80)
DCL VAR(&USER) TYPE(*CHAR) LEN(10) /* user profile*/
DCL VAR(&APP1) TYPE(*CHAR) LEN(10) /* function */
DCL VAR(&APP2) TYPE(*CHAR) LEN(10) /* sub function*/
DCL VAR(&TFOBJ) TYPE(*CHAR) LEN(10)
/* file name */
DCL VAR(&TFLIB) TYPE(*CHAR) LEN(10)
/*library
*/
DCL VAR(&TFMBR) TYPE(*CHAR) LEN(10)
/* member
*/
DCL VAR(&TFFMT) TYPE(*CHAR) LEN(10)
/* format
*/
DCL VAR(&TYPE) TYPE(*CHAR) LEN(2) /* journaltype */
MONMSG MSGID(CPF0000)
EXEC(GOTO CMDLBL(EXIT))
CHGVAR &RC VALUE('1')
/* set return code to +
allow request unless rejected by program
*/
CHGVAR &USER VALUE(%SST(&STRU
1 10)) /*user */
CHGVAR &APP2 VALUE(%SST(&STRU
21 10)) /*funct*/
CHGVAR &TFOBJ VALUE(%SST(&STRU 31 10)) /*file */
CHGVAR &TFLIB VALUE(%SST(&STRU 41 10)) /*libr */
CHGVAR &TFMBR VALUE(%SST(&STRU 51 10)) /*mbr */
CHGVAR &TFFMT VALUE(%SST(&STRU 61 10)) /*fmt */
LOG: CHGVAR VAR(&TYPE)
VALUE('X' *CAT &RC)
SNDJRNE JRN(QAUDJRN) TYPE(&TYPE)
ENTDTA(&STRU)
EXIT:ENDPGM
程序2、
PGM PARM(&RC &REQUEST)
DCL VAR(&RC) TYPE(*CHAR) LEN(1) VALUE('1')
DCL VAR(&REQUEST) TYPE(*CHAR) LEN(700)
DCL VAR(&TYPE) TYPE(*CHAR) LEN(2)
DCL &X1800 *CHAR 4
VALUE(X'00001800') /*create database file*/
DCL &X1801 *CHAR 4
VALUE(X'00001801') /*create source
file*/
DCL &X1802 *CHAR 4
VALUE(X'00001802') /*add member */
DCL &X1803 *CHAR 4
VALUE(X'00001803') /*clear member */
DCL &X1804 *CHAR 4
VALUE(X'00001804') /*delete member */
DCL &X1805 *CHAR 4
VALUE(X'00001805') /*file override */
DCL &X1806 *CHAR 4
VALUE(X'00001806') /*delete file override*/
DCL &X1807 *CHAR 4
VALUE(X'00001807') /*create save file */
DCL &X1808 *CHAR 4
VALUE(X'00001808') /*clear save file */
DCL &X1809 *CHAR 4
VALUE(X'00001809') /*delete file
*/
/* OPTIMIZED DATABASE SERVER DECLARES
*/
DCL &DBFMT *CHAR 8 /* format name
*/
DCL &DBFID *CHAR 4 /* function identifier */
/* FOLLOWING PARAMETERS ADDITIONAL
FOR FORMAT ZDAD0100 */
DCL &DBFILE *CHAR 128 /* file name
*/
DCL &DBLIB *CHAR 10
/* library name
*/
DCL &DBMBR *CHAR 10
/* member name
*/
DCL &DBAUT *CHAR 10
/* authority to file */
DCL &DBBFIL *CHAR 128 /* based on
file name */
DCL
&DBBLIB *CHAR
10 /* based on
library name */
DCL &DBOFIL *CHAR 10 /* override file name */
DCL &DBOLIB *CHAR 10 /* override library name */
DCL &DBOMBR *CHAR 10 /* override member name */
MONMSG MSGID(CPF0000)
EXEC(GOTO CMDLBL(EXIT))
/* allow
request unless rejected by program */
CHGVAR VAR(&RC)
VALUE('1')
/* set variables from request
description */
CHGVAR VAR(&DBFMT) VALUE(%SST(&REQUEST 21 8))
CHGVAR VAR(&DBLIB) VALUE(%SST(&REQUEST 161 10))
CHGVAR VAR(&DBMBR) VALUE(%SST(&REQUEST 171 10))
CHGVAR VAR(&DBOFIL)
VALUE(%SST(&REQUEST 329 10))
CHGVAR VAR(&DBOLIB)
VALUE(%SST(&REQUEST 339 10))
CHGVAR VAR(&DBOMBR)
VALUE(%SST(&REQUEST 349 10))
LOG:
CHGVAR VAR(&TYPE)
VALUE('Z' *CAT &RC)
SNDJRNE JRN(QAUDJRN) TYPE(&TYPE)
ENTDTA(&REQUEST)
EXIT: ENDPGM
具体实施方法:
1、 将上述2个程序编译,Owner改为QSECOFR,并使用继承权限
2、 CHGNETA PCSACC(*REGFAC)
3、 使用ADDEXITPGM命令把程序添加到相应的Exit
point
4、可以给这2个程序设置一个权限列表,凡是在权限列表内有权限执行此程序的人才可以
利用ODBC下传数据
5、用DSPJRN
JRN(QAUDJRN)
ENTTYP(Z1) 就可以查看下传的数据情况了
6、可以用WRKREGINF查看Exit
program设置情况
注:需要有QAUDJRN,如没有需先WRKSYSVAL修改系统值QAUDCTL、QAUDLVL,然后CRTJRN创建QAUDJRN
创建QAUDJRN
也可以同时使用Exit program双重控制ODBC
限制FTP
另外补充一点:
上次说的性能检测部分,如果使用Accounting Journal必须的修改系统值QACGLVL才能让QACGJRN生效
内容
提要 当用户使用命令WRKACTJOB查看作业运行状态时,经常会发现一些系统作业,但是不清楚这些系统作业有什么用途,本文将对一些主要的系统作业的用途进行介绍。
正文 系统作业是由OS/400创建并控制的,用于控制系统资源并处理系统级的请求。在命令
WRKACTJOB中显示的作业中,系统作业是按照字母排序在所有用户子系统和作业之后的。
系统作业是在系统IPL时初始化的,但是,只要OS/400系统处于活动状态,作业
QWCBTCLNUP和QDCPOBJx也将与之同样保持活动。系统作业不能被用户启动,停止或改变(除了少数系统作业可以用命令CHGSYSJOB来改变,并且唯一可以由该命令改变的属性就是这些系统作业的运行优先级。)
以下就是介绍所有系统作业的详细信息:
-- QALERT - Alert Manager 报警管理
该系统作业使作业能够处理报警,包括处理从其他系统上接收到的报警,本机产生 的报警,并且维护系统的控制。QALERT的作业运行优先级可以用命令CHGSYSJOB改变。该作业在OS/400 R220时就被加入到操作系统中,用于支持报警信息的处理。
-- QCMNARBxx - Communications Arbiters
通讯仲裁器处理的仲裁不仅仅对通讯设备,还包括所有类型的其他设备。处理的工作包含通讯连接,断开,设备锁定,和错误恢复。所有设备相关的工作分散在系统作QCMNARBxx和QSYSARB中。
系统值QCMNARB决定有多少通讯仲裁作业启动。如果QCMNARB设置成*CALC,系统将为每一个处理器启动两个通讯仲裁作业,如果QCMNARB设置成0,该作业将在QSYSARB中运行。QCMNARBxx的作业运行优先级可以用命令CHGSYSJOB改变。在作业QCMNARBxx被加入OS/400
R420以前,这些工作是在QSYSARB中运行的。
-- QDBSRVXR - Database Cross-Reference 数据库交叉参照
该作业是用于维护QSYS中的文件级的系统交叉参照文件,这些文件中存放着数据库文件的交叉参照信息,并且这些文件是库QSYS中以QADB开头的。首要被维护的文件是文件交叉参照文件QADBXREF,它包含了数据库中每一个物理文件,逻辑文件,DDM文件,ALIAS文件的记录。当一个文件被创建,改变,删除,恢复,更名,或者改变所有权时,作业QDBSRVXR就会被激活。该作业在OS/400
R310被加入操作系统。
-- QDBSRVXR2 - Database Cross-Reference 数据库交叉参照
该作业是用于维护两个字段级的系统交叉参照文件,库QSYS中的QADBIFLD是字段交叉参照文件,库QSYS中的QADBKFLD是键字交叉参照文件。当一个文件被创建,改变,或删除,运行键字相关的工作时,作业QDBSRVXR2就会被激活。QDBSRVXR2由PTF在OS/400 R310时被加入操作系统中。QDBSRVXR2的作业运行优先级可以用命令CHGSYSJOB改变。
-- QDBSRV01 - Database Server 数据库服务器
该作业可以被视为数据库维护任务的分配器。通常地,当恢复一个包含数据库文件的库时,QDBSRV01将立刻被激活。它的功能包括:
* 发信号给SMAPP(系统管理的访问路径保护机制),告知新的访问路径被恢复,并且由AMAPP来决定是否需要被保护。
* 由于访问路径没有被恢复时,该作业准备需要被重新创建的访问路径的列表。该列表可以用命令EDTRBDAP浏览。
数据库服务器作业的数量是(1+2*CPU数)与(1+2*ASP数)两者中较大的那一个。最少启动的数量是5。QDBSRV01是主要的系统作业,用于分配其他作业工作,剩下的作业,一半是用来处理高优先级的请求,另一半是用来处理低优先级的请求。例如:在一个有4路CPU的系统上,应该有9个QDBSRVxx作业,由QDBSRV01来分配工作,QDBSRV02-05用来处理高优先级的作业,QDBSRV06-09用来处理低优先级的作业。该作业是在OS/400
R210被加入操作系统的。
-- QDBSRVxx - Database Server (high priority)
这些作业维护系统的日志和提交控制。
-- QDBSRVxx - Database Server (low priority)
这些作业用于维护用户的数据库文件的访问路径。这些作业通常不活动,但是,在特定的条件下,它们被激活用于访问路径的重建。这些被重建的访问路径可以用命令EDTRBDAP浏览。这些作业被激活的原因包括:
* 恢复那些没有保存访问路径的数据库文件;
* 恢复那些没有物理文件的逻辑文件;
* 取消正在运行的命令RGZPFM;
* 由于被破坏而成为无效的索引;
* 加速OS/400安装来完成交叉参照,或者其他DB
* 验证约束。用命令EDTCPCST可以显示那些正在等待验证的约束。
-- QDCPOBJx - Decompress System Object 系统对象解压缩
这些作业是用于对新安装的操作系统对象进行解压缩的,它们的运行是需要一定的空间的。当剩余您的系统空间低到一定程度,这些作业就会结束。系统对象解压缩作业的数量=CPU数+1。该作业是在OS/400 R210被加入操作系统的。
-- QFILESYS1 - File System 文件系统
该作业用于支持文件系统作业的后台运行,它保证对文件的改动都写入存储介质中,并执行常规的文件系统清除活动。该作业是在OS/400 R210被加入操作系统的。
-- QJOBSCD - Job Schedule 作业调度
该作业控制作业调度功能,并由系统监控作业调度项的计时器和调度的作业。
该作业是在OS/400 R220被加入操作系统的。
-- QLUR - LU 6.2 Resynchronization(LU 6.2 重新同步)
该作业处理两段式提交的重新同步。该作业是在OS/400 R310被加入操作系统的,并作为LU
6.2通讯协议的一部分。
-- QLUS - Logical Unit Services 逻辑单元服务
该作业处理为逻辑单元设备(通讯设备)处理的事件,它还负责将设备定位到正确的通讯子系统中去。QLUS是AS/400上原始的系统作业之一。
-- QPFRADJ - Performance Adjustment 性能调整
性能调整系统作业管理存储池大小和活动级别的变化。所有要求改变存储池大小的请求都有该作业处理。此外,如果系统值QPFRADJ设为2或3,该作业将动态地改变存储池大小和活动级别,由此提高系统的性能。在OS/400 R430,IPL性能调整(系统值QPFRADJ设为1或2)是由QPFRADJ来处理的,在OS/400
R430前,IPL性能调整由SCPF处理。QPFRADJ是在OS/400 R210被加入操作系统的。
-- QQQTEMP1 and QQQTEMP2 - Database Parallelism 数据库并行
该作业用于实现多个DB2系统的数据库同步功能。如果用户对分布式文件进行查询,该作业可以通过执行并行处理从而达到加快处理速度的目的。是在OS/400
R370作为DB2多系统支持功能被加入操作系统的。
-- QSPLMAINT - System Spool Maintenance 假脱机管理
该作业实现维护系统假脱机的功能。
-- QSYSARB - System Arbiter 系统仲裁
系统仲裁提供运行高优先权功能的环境,它处理系统资源并保持对系统状态的追踪。QSYSARB是操作系统核心作业。系统仲裁负责系统一级的,需要立即处理和能更有效地被一个作业处理的任务,系统仲裁还负责处理通讯请求,设备锁定,线/控制器/设备的配置。系统仲裁是OS/400最原始的作业之一。
-- QSYSCOMM1 - System Communications 系统通讯
该作业处理系统通讯和I/O。QSYSCOMM1的作业优先权可以用命令CHGSYSJOB改变,它是在OS/400
R320中被加入操作系统的。
-- QWCBTCLNUP - Job Table Cleanup 作业表清空
QWCBTCLNUP是用于在IPL过程中确保作业结构可以被使用。通常在IPL结束时,该作业也结束处理了,但是,如果有许多作业结构需要清除,它可以在IPL结束后继续运行。该系统作业在处理完成后就结束了。QWCBTCLNUP是在OS/400
R210中当作业表的清除从SCPF中被移走后加入系统的。
-- Q400FILSVR - Remote File System
Communications 远程文件系统通讯
该作业处理远程文件系统APPN/APPC的通用编程接口通讯。Q400FILSVR是在OS/400
R360中作为远程文件支持被加入操作系统的。
-- SCPF - Start Control Program Function 启动控制程序功能
该作业是操作系统IPL是的中心处理任务,提供启动OS/400的环境和所直接需要的功能。SCPF启动所有其他系统作业(除了QLUS),并将系统带入可用状态。SCPF是OS/400最原始的作业之一。
________________________________________________________________________
| Table A-2.
Coded Character Set Identifiers (CCSID)
|
|_________ _________ ___________ __________
_____________________________|
|
| Code |
Character |
|
|
| CCSID | Page | Set | Encoding
| Description
|
|_________|_________|___________|__________|_____________________________|
| 00037 | 00037 | 00697 | 1100 | US,
|
|
|
|
|
|
|
|
|
|
|_________|_________|___________|__________|_____________________________|
| 00256 | 00256 | 00337 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00273 | 00273 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00277 | 00277 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00278 | 00278 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00280 | 00280 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00284 | 00284 | 00697 | 1100 | Spanish,
|_________|_________|___________|__________|_____________________________|
| 00285 | 00285 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00290 | 00290 | 01172 | 1100 | Japan Katakana
(extended |
|
|
|
|
| range)
|
|_________|_________|___________|__________|_____________________________|
| 00297 | 00297 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00300 | 00300 | 01001 | 1200 |
|_________|_________|___________|__________|_____________________________|
| 00301 | 00301 | 00370 | 2200 | Japanese PC
Data
|
|_________|_________|___________|__________|_____________________________|
| 00367 | 00367 | 00103 | 5100 | ANSI X3.4 ASCII
standard; |
|
|
|
| |
|_________|_________|___________|__________|_____________________________|
| 00420 | 00420 | 00235 | 1100 | Arabic-speaking
countries |
|_________|_________|___________|__________|_____________________________|
| 00423 | 00423 | 00218 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00424 | 00424 | 00941 | 1100 | Hebrew
|
|_________|_________|___________|__________|_____________________________|
| 00437 | 00437 | 01212 | 2100 | PC Data; PC Base;
|_________|_________|___________|__________|_____________________________|
| 00500 | 00500 | 00697 | 1100 |
|
|
|
|
|
|
|
|
|
| Latin-1
|
|_________|_________|___________|__________|_____________________________|
| |
00720 | 00720 | 00814 | 2100 | MS-DOS Arabic
|
|_________|_________|___________|__________|_____________________________|
| 00737 | 00737 | 00812 | 2100 | MS-DOS** Greek
PC-Data |
|_________|_________|___________|__________|_____________________________|
| 00775 | 00775 | 00813 | 2100 | MS-DOS Baltic
PC-Data
|
|_________|_________|___________|__________|_____________________________|
| 00813 | 00813 | 00925 | 4100 | ISO 8859-7;
Greek/Latin |
|_________|_________|___________|__________|_____________________________|
| 00819 | 00819 | 00697 | 4100 | ISO 8859-1; Latin Alphabet |
|
| |
|
| No. 1
|
|_________|_________|___________|__________|_____________________________|
| 00833 | 00833 | 01173 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00834 | 00834 | 00934 | 1200 |
|
|
|
|
| (including 1880 UDC)
|
|_________|_________|___________|__________|_____________________________|
| 00835 | 00835 | 00935 | 1200 | Traditional Chinese
host |
|
|
|
|
| double byte (including 6204 |
|
|
|
|
| UDC)
|
|_________|_________|___________|__________|_____________________________|
| 00836 | 00836 | 01174 | 1100 | Simplified
Chinese
|
|
|
|
|
| (extended range)
|
|_________|_________|___________|__________|_____________________________|
| 00837 | 00837 | 00937 | 1200 | Simplified
Chinese
|
|_________|_________|___________|__________|_____________________________|
| 00838 | 00838 | 01176 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00850 | 00850 | 01106 | 2100 | PC Data; MLP 222
Latin |
|
|
|
|
| Alphabet 1
|
|_________|_________|___________|__________|_____________________________|
| 00851 | 00851 | 01231 | 2100 | PC Data; Greek
|
|_________|_________|___________|__________|_____________________________|
| 00852 | 00852 | 01232 | 2100 | PC Data;
Latin-2
|
|
|
|
|
| Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 00855 | 00855 | 01235 | 2100 | PC Data; ROECE
Cyrillic |
|_________|_________|___________|__________|_____________________________|
| 00857 | 00857 | 01237 | 2100 | PC Data;
|_________|_________|___________|__________|_____________________________|
| 00860 | 00860 | 01213 | 2100 | PC Data;
|_________|_________|___________|__________|_____________________________|
| 00861 | 00861 | 01214 | 2100 | PC Data;
|_________|_________|___________|__________|_____________________________|
| 00862 | 00862 | 01217 | 2100 | PC Data; Hebrew
|
|_________|_________|___________|__________|_____________________________|
| 00863 | 00863 | 01215 | 2100 | PC Data;
|_________|_________|___________|__________|_____________________________|
| 00864 | 00864 | 01244 | 2100 | PC Data; Arabic
|
|_________|_________|___________|__________|_____________________________|
| 00865 | 00865 | 01216 | 2100 | PC Data;
|_________|_________|___________|__________|_____________________________|
| 00866 | 00866 | 01190 | 2100 | PC Data; Cyrillic #2
- |
|
|
|
|
| Personal Computer
|
|_________|_________|___________|__________|_____________________________|
| 00868 | 00868 | 01248 | 2100 | PC Data; Urdu
|
|_________|_________|___________|__________|_____________________________|
| 00869 | 00869 | 01249 | 2100 | PC Data; Greek
|
|_________|_________|___________|__________|_____________________________|
| 00870 | 00870 | 00959 | 1100 | Latin-2
Multilingual |
|_________|_________|___________|__________|_____________________________|
| 00871 | 00871 | 00697 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00874 | 00874 | 01176 | 2100 | Thai PC Data
|
|_________|_________|___________|__________|_____________________________|
| 00875 | 00875 | 00925 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00880 | 00880 | 00960 | 1100 | Cyrillic
Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 00891 | 00891 | 01224 | 2100 | Korean PC Data
|
|
|
|
|
| (non-extended)
|
|_________|_________|___________|__________|_____________________________|
| 00896 | 00896 | 01121 | 5100 | Japan 7-bit
Katakana |
|_________|_________|___________|__________|_____________________________|
| 00897 | 00897 | 01122 | 2100 | Japanese PC
Data
|
|
|
|
|
| (non-extended)
|
|_________|_________|___________|__________|_____________________________|
| 00903 | 00903 | 01185 | 2100 | Simplified Chinese
PC Data |
|
| |
|
| (non-extended)
|
|_________|_________|___________|__________|_____________________________|
| 00904 | 00904 | 00103 | 2100 | Traditional Chinese
PC Data |
|_________|_________|___________|__________|_____________________________|
| 00905 | 00905 | 00965 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 00912 | 00912 | 00959 | 4100 | ISO 8859-2; ROECE
Latin-2 |
|
|
|
|
| Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 00915 | 00915 | 01150 | 4100 | ISO 8859-5;
Cyrillic; 8-bit |
|
|
|
|
| ISO
|
|_________|_________|___________|__________|_____________________________|
| 00916 | 00916 | 00941 | 4100 | ISO 8859-8;
Hebrew
|
|_________|_________|___________|__________|_____________________________|
| 00920 | 00920 | 01152 | 4100 | ISO 8859-9; Latin
5
|
|_________|_________|___________|__________|_____________________________|
| |
00921 | 00921 | 01305 | 4100 | Baltic, 8-bit
|
|_________|_________|___________|__________|_____________________________|
| |
00922 | 00922 | 01307 | 4100 |
|_________|_________|___________|__________|_____________________________|
| 00926 | 00926 | 00934 | 2200 | Korean PC Data DBCS,
UDC |
|
|
|
|
| 1880
|
|_________|_________|___________|__________|_____________________________|
| 00927 | 00927 | 00935 | 2200 | Traditional Chinese
PC Data |
|
|
|
|
| DBCS, UDC 6204
|
|_________|_________|___________|__________|_____________________________|
| 00928 | 00928 | 00937 | 2200 | Simplified Chinese
PC Data |
|
|
|
|
| DBCS, UDC 1880
|
|_________|_________|___________|__________|_____________________________|
| 00930 | 00290 | 01172 | 1301 | Japan Katakana
(extended |
|
| 00300 | 01001 |
| range) 4370 UDC (User |
|
|
|
|
| Defined Characters)
|
|_________|_________|___________|__________|_____________________________|
| 00932 | 00897 | 01122 | 2300 |
|
| 00301 | 00370 |
|
|
|_________|_________|___________|__________|_____________________________|
| 00933 | 00833 | 01173 | 1301 |
|
| 00834 | 00934 |
| 1880 UDC
|
|_________|_________|___________|__________|_____________________________|
| 00934 | 00891 | 01224 | 2300 | Korean PC Data
|
|
| 00926 | 00934 |
|
|
|_________|_________|___________|__________|_____________________________|
| 00935 | 00836 | 01174 | 1301 | Simplified
Chinese
|
|
| 00837 | 00937 |
| (extended range)
|
|_________|_________|___________|__________|_____________________________|
| 00936 | 00903 | 01185 | 2300 | Simplified
Chinese
|
|
| 00928 | 00937 |
| (non-extended)
|
|_________|_________|___________|__________|_____________________________|
| 00937 | 00037 | 01175 | 1301 | Traditional Chinese
|
|
| 00835 | 00935 |
| (extended range)
|
|_________|_________|___________|__________|_____________________________|
| 00938 | 00904 | 00103 | 2300 | Traditional
Chinese
|
| |
00927 | 00935 |
| (non-extended)
|
|_________|_________|___________|__________|_____________________________|
| 00939 | 01027 | 01172 | 1301 | Japan English
(extended |
|
| 00300 | 01001 |
| range) 4370 UDC
|
|_________|_________|___________|__________|_____________________________|
| 00942 | 01041 | 01172 | 2300 | Japanese PC Data
Mixed |
|
| 00301 | 00370 |
|
|
|_________|_________|___________|__________|_____________________________|
| |
00943 | 00897 | 65535 | 2300 | Japanese PC Data
Mixed for |
|
|
| 00941 | 65535 |
| Open environment
|
|_________|_________|___________|__________|_____________________________|
| 00944 | 01040 | 01173 | 2300 | Korean PC Data
Mixed
|
|
| 00926 | 00934 |
|
|
|_________|_________|___________|__________|_____________________________|
| 00946 | 01042 | 01239 | 2300 | Simplified Chinese
PC Data |
|
| 00928 | 00937 |
| Mixed
|
|_________|_________|___________|__________|_____________________________|
| 00947 | 00947 | 00935 | 2200 | ASCII
Double-byte
|
|_________|_________|___________|__________|_____________________________|
| 00948 | 01043 | 01175 | 2300 | Traditional Chinese
PC Data |
|
| 00927 | 00935 |
| Mixed 6204 UDC (User |
|
|
|
|
| Defined Characters)
|
|_________|_________|___________|__________|_____________________________|
| 00949 | 01088 | 01278 | 2300 |
|
| 00951 | 01050 |
| Standard Graphic Character |
|
|
|
|
| Set (KS) PC Data mixed-byte |
|
|
|
|
| including 1800 UDC
|
|_________|_________|___________|__________|_____________________________|
| 00950 | 01114 | 00103 | 2300 | Traditional Chinese
PC Data |
|
| 00947 | 00935 |
| Mixed for Big5
|
|_________|_________|___________|__________|_____________________________|
| 00951 | 01050 | 00951 | 2200 |
|
|
|
| |
Standard Graphic Character |
|
|
|
|
| Set (KS) PC Data
|
|
|
|
|
| double-byte including 1800 |
|
|
|
|
| UDC
|
|_________|_________|___________|__________|_____________________________|
| 00956 | 00895 | 01120 | 5404 | JIS X201 Roman for
CP |
|
| 00952 | 01064 |
| 00895; JIS X208-1983 for CP |
|
|
|
|
| 00952
|
|_________|_________|___________|__________|_____________________________|
| 00957 | 00895 | 01120 | 5404 | JIS X201 Roman for
CP |
|
| 00955 | 01063 |
| 00895; JIS X208-1978 for CP |
|
|
|
|
| 00955
|
|_________|_________|___________|__________|_____________________________|
| 00958 | 00367 | 00103 | 5404 | ASCII for CP 00367;
JIS |
|
| 00952 | 01064 |
| X208-1983 for CP 00952 |
|_________|_________|___________|__________|_____________________________|
| 00959 | 00367 | 00103 | 5404 | ASCII for CP 00367;
JIS |
|
| 00955 | 01063 |
| X208-1978 for CP 00955 |
|_________|_________|___________|__________|_____________________________|
| 00964 | 00367 | 00103 | 4403 | G0 - ASCII for CP
00367; |
|
| 00960 | 01070 |
| G1- CNS 11643 plane 1 for
|
|
|
|
|
| CP 960
|
|_________|_________|___________|__________|_____________________________|
| 00965 | 00367 | 00103 | 5404 | ASCII for CP 00367;
CNS |
|
| 00960 | 01070 |
| 11643 plane 1 for CP 960 |
|_________|_________|___________|__________|_____________________________|
| 00970 | 00367 | 00103 | 4403 | G0 ASCII for CP
00367; G1 |
|
| 00971 | 01056 |
| KSC X5601-1989 (including
|
|
|
|
|
| 188 UDCs) for CP 971
|
|_________|_________|___________|__________|_____________________________|
| 01008 | 01008 | 01162 | 4100 | Arabic 8-bit
ISO/ASCII |
|_________|_________|___________|__________|_____________________________|
| 01009 | 01009 | 01169 | 5100 | IS0-7: IRV
|
|_________|_________|___________|__________|_____________________________|
| 01010 | 01010 | 00288 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01011 | 01011 | 00265 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01012 | 01012 | 00293 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01013 | 01013 | 01118 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01014 | 01014 | 01119 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01015 | 01015 | 01116 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01016 | 01016 | 01117 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01017 | 01017 | 01135 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01018 | 01018 | 01136 | 5100 | ISO-7;
|_________|_________|___________|__________|_____________________________|
| 01019 | 01019 | 01137 | 5100 | ISO-7;
|
|
|
|
|
|_________|_________|___________|__________|_____________________________|
| 01025 | 01025 | 01150 | 1100 | Cyrillic
Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 01026 | 01026 | 01152 | 1100 |
|_________|_________|___________|__________|_____________________________|
| 01027 | 01027 | 01172 | 1100 | Japan English
(extended |
|
|
|
|
| range)
|
|_________|_________|___________|__________|_____________________________|
| 01040 | 01040 | 01173 | 2100 | Korean Latin PC
Data
|
|
|
|
|
| extended
|
|_________|_________|___________|__________|_____________________________|
| 01041 | 01041 | 01172 | 2100 | Japanese PC Data
extended |
|_________|_________|___________|__________|_____________________________|
| 01042 | 01042 | 01239 | 2100 | Simplified Chinese
PC Data |
|
|
|
|
| extended
|
|_________|_________|___________|__________|_____________________________|
| 01043 | 01043 | 01175 | 2100 | Traditional Chinese
PC Data |
|
|
|
|
| extended
|
|_________|_________|___________|__________|_____________________________|
| 01046 | 01046 | 01177 | 2100 | PC Data - Arabic
Extended |
|_________|_________|___________|__________|_____________________________|
| |
01051 | 01051 | 01201 | 4100 | HP Emulation (for
use with |
|
|
|
|
|
| Latin 1)
|
|_________|_________|___________|__________|_____________________________|
| 01088 | 01088 | 01278 | 2100 | Korean PC Data
single-byte |
|_________|_________|___________|__________|_____________________________|
| |
01089 | 01089 | 01271 | 4100 | ISO 8859-6:
Arabic
|
|_________|_________|___________|__________|_____________________________|
| 01097 | 01097 | 01219 | 1100 | Farsi
|
|_________|_________|___________|__________|_____________________________|
| 01098 | 01098 | 01288 | 2100 | Farsi (IBM-PC)
|
|_________|_________|___________|__________|_____________________________|
| 01112 | 01112 | 01305 | 1100 | Baltic,
Multilingual |
|_________|_________|___________|__________|_____________________________|
| 01114 | 01114 | 00103 | 2100 | Traditional Chinese,
|
|
|
|
| Industry Graphic Character |
|
|
|
|
| Set (Big5)
|
|_________|_________|___________|__________|_____________________________|
| 01115 | 01115 | 00103 | 2100 | Simplified
Chinese,
|
|
|
|
|
| People's Republic of
|
|
|
| |
National Standard (GB),
|
|
|
|
|
| personal computer SBCS
|
|_________|_________|___________|__________|_____________________________|
| 01122 | 01122 | 01307 | 1100 |
|_________|_________|___________|__________|_____________________________|
| |
01129 | 01129 | 01336 | 4100 | ISO-8
Vietnamese
|
|_________|_________|___________|__________|_____________________________|
| |
01130 | 01130 | 01336 | 1100 | EBCDIC
Vietnamese
|
|_________|_________|___________|__________|_____________________________|
| |
01132 | 01132 | 01341 | 1100 | EBCDIC Lao
|
|_________|_________|___________|__________|_____________________________|
| |
01133 | 01133 | 01341 | 4100 | ISO-8 Lao
|
|_________|_________|___________|__________|_____________________________|
| 01250 | 01250 | 1400 | 4105 | Windows**, Latin
2
|
|_________|_________|___________|__________|_____________________________|
| 01251 | 01251 | 1401 | 4105 | Windows,
Cyrillic
|
|_________|_________|___________|__________|_____________________________|
| 01252 | 01252 | 1402 | 4105 | Windows,Latin 1
|
|_________|_________|___________|__________|_____________________________|
| 01253 | 01253 | 1403 | 4105 | Windows, Greek
|
|_________|_________|___________|__________|_____________________________|
| 01254 | 01254 | 1404 | 4105 | Windows,
Turkish
|
|_________|_________|___________|__________|_____________________________|
| 01255 | 01255 | 1405 | 4105 | Windows, Hebrew
|
|_________|_________|___________|__________|_____________________________|
| 01256 | 01256 | 1406 | 4105 | Windows, Arabic
|
|_________|_________|___________|__________|_____________________________|
| 01257 | 01257 | 1407 | 4105 | Windows, Baltic
Rim
|
|_________|_________|___________|__________|_____________________________|
| |
01258 | 01258 | 01408 | 4105 | Windows,
Vietnamese
|
|_________|_________|___________|__________|_____________________________|
| |
01275 | 01275 | 01425 | 4105 | Apple, Latin-1
|
|_________|_________|___________|__________|_____________________________|
| |
01280 | 01280 | 01430 | 4105 | Apple, Greek
|
|_________|_________|___________|__________|_____________________________|
| |
01281 | 01281 | 01431 | 4105 |
|_________|_________|___________|__________|_____________________________|
| |
01282 | 01282 | 01432 | 4105 | Apple, Central
European |
|
|
|
|
|
| (Latin-2)
|
|_________|_________|___________|__________|_____________________________|
| |
01283 | 01283 | 01433 | 4105 | Apple, Cyrillic
|
|_________|_________|___________|__________|_____________________________|
| |
01380 | 01380 | 00937 | 2200 | Simplified Chinese
DBCS PC |
|_________|_________|___________|__________|_____________________________|
| 01381 | 01115 | 00103 | 2300 | Simplified Chinese
PC Data |
|
| 01380 | 00937 |
| Mixed
|
|_________|_________|___________|__________|_____________________________|
| 01383 | 00367 | 00103 | 4403 | Simplified Chinese,
EUC |
|
| 01382 | 01081 |
|
|
| |
|
|
| G0 set;
ASCII
|
|
|
|
|
|
|
|
|
|
|
| G1 set;
GB 2312-80 set |
|
|
| |
|
(1382)
|
|_________|_________|___________|__________|_____________________________|
| |
01386 | 01114 | 65535 | 2300 | Simplified Chinese
PC Data |
|
|
| 01385 | 65535 | | GBK mixed
|
|_________|_________|___________|__________|_____________________________|
| |
01388 | 00836 | 65535 | 1301 | Simplified
Chinese
|
|
|
| 00837 | 65535 |
| DBCS-Host Data GBK mixed |
|_________|_________|___________|__________|_____________________________|
| 04396 | 00300 | 00370 | 1200 | Japanese Host DB including |
|
|
|
|
| 1880
|
|_________|_________|___________|__________|_____________________________|
| 04948 | 00852 | 00959 | 2100 | Latin 2 PC Data
|
|
|
|
|
| Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 04951 | 00855 | 01150 | 2100 | Cyrillic PC
Data
|
|
|
|
|
| Multilingual
|
|_________|_________|___________|__________|_____________________________|
| 04952 | 00856 | 00941 | 2100 | Hebrew PC Data
|
|_________|_________|___________|__________|_____________________________|
| 04953 | 00857 | 01152 | 2100 |
|_________|_________|___________|__________|_____________________________|
| 04960 | 00864 | 00235 | 2100 | Arabic PC Data
|
|_________|_________|___________|__________|_____________________________|
| 04965 | 00869 | 00925 | 2100 | Greek PC Data
|
|_________|_________|___________|__________|_____________________________|
| 05026 | 00290 | 01172 | 1301 | Japan Katakana
(extended |
|
| 00300 | 00370 |
| range) 1880 UDC
|
|_________|_________|___________|__________|_____________________________|
| 05035 | 01027 | 01172 | 1301 | Japan English
(extended |
|
| 00300 | 00370 | |
range) 1880 UDC
|
|_________|_________|___________|__________|_____________________________|
| 05050 | 00895 | 01120 | 4403 | G0 - JIS X201 Roman
for CP |
|
| 00952 | 01058 |
| 895; G1 JIS X208-1990 for
|
|
|
|
|
| CP 952
|
|_________|_________|___________|__________|_____________________________|
| 05052 | 00895 | 01120 | 5404 | JIS X201 Roman for
CP 895; |
|
| 00952 | 01064 |
| JIS X208-1983 for CP 952 |
|_________|_________|___________|__________|_____________________________|
| 05053 | 00895 | 01120 | 5404 | JIS X201 Roman for
CP 895; |
|
| 00955 | 01063 |
| JIS X208-1978 for CP 955 |
|_________|_________|___________|__________|_____________________________|
| 05054 | 00367 | 00103 | 5404 | ASCII for CP 367;
JIS |
|
| 00952 | 01064 |
| X208-1983 for CP 952 |
|_________|_________|___________|__________|_____________________________|
| 05055 | 00367 | 00103 | 5404 | ASCII for CP 367;
JIS |
|
| 00955 | 01063 |
| X208-1978 for CP 955 |
|_________|_________|___________|__________|_____________________________|
| 08612 | 00420 | 01142 | 01100 | Arabic (base shapes
only) |
|_________|_________|___________|__________|_____________________________|
| 09030 | 00838 | 01279 | 1100 | Thai Host Extended
SBCS |
|_________|_________|___________|__________|_____________________________|
| 09056 | 00864 | 01101 | 2100 | PC Data: Arabic
PC
|
|
|
|
|
| Storage/Interchange
|
|_________|_________|___________|__________|_____________________________|
| 09066 | 00874 | 01279 | 2100 | Thai PC Data
Extended SBCS |
|_________|_________|___________|__________|_____________________________|
| 13488 | 01200 | 01200 | 7200 | ISO/IEC 10646
Universal |
|
|
|
|
| Coded Character Set Level 2 |
|
|
|
|
| (UCS-2)
|
|_________|_________|___________|__________|_____________________________|
| 17354 | 00367 | 00103 | 5404 | G0 - ASCII for CP
00367; G1 |
|
| 00971 | 01056 |
| - KSC X5601-1989 (including |
|
|
|
|
| 188 UDCs) for CP 00971
|
|_________|_________|___________|__________|_____________________________|
| |
25546 | 00367 | 00103 | 5409 | Korean 2022-KR TCP
ASCII |
|
| | 00971 | 01056 |
|
|
|_________|_________|___________|__________|_____________________________|
| 28709 | 00037 | 01175 | 1100 | Traditional
Chinese
|
|
|
| |
| (extended range)
|
|_________|_________|___________|__________|_____________________________|
| 33722 | 00895 | 01120 | 4403 | Japanese EUC
|
|
| 00952 | 01058 |
| |
|
| 00896 | 01284 |
| G0; JIS
X201 Roman set |
|
| 00953 | 01060 |
|
(00895)
|
|
|
|
|
|
|
|
|
|
|
| G1; JIS
X208-1990 set |
|
|
|
|
|
(00952)
|
|
|
|
|
|
|
| |
|
|
| G2; JIS
X201 Katakana |
|
|
|
|
| set
(04992)
|
|
|
|
|
|
|
|
|
| |
| G3; JIS
X212 set |
|
|
|
|
|
(09145)
|
|_________|_________|___________|__________|_____________________________|
| 57345 |
|
| 5404 |
All Japanese 2022
|
|
|
|
|
| characters
|
|_________|_________|___________|__________|_____________________________|
| 61952 | 65024 | 65024 | 7200 | AS/400 specific UCS
level |
|
|
|
|
| 2.
|
|_________|_________|___________|__________|_____________________________|
| 65534 |
|
|
| Look at lower level CCSID
|
|_________|_________|___________|__________|_____________________________|
| 65535 |
|
|
| Special value indicating |
|
|
|
|
| data is hex and should not |
|
|
|
|
| be converted. This is the
|
|
|
|
|
| default for the QCCSID
|
|
|
|
|
| system value.
|
|_________|_________|___________|__________|_____________________________|