Beruflich Dokumente
Kultur Dokumente
0019.00 C
eval
res=fld1/fld2
0020.00 C
exfmt
dsp2fmt
0021.00 C
clear
dsp2fmt
0022.00 C
other
0023.00 C
'invalid opt' dsply
0024.00 C
exfmt
dsp2fmt
0025.00 C
endsl
0026.00 C
enddo
0027.00 C
return
****************** End of data ***************************************
OUTPUT SCREENS WILL BE AS FOLLOWS:
40
40
0007.00 c
if
*in03=*on
0008.00 C
leave
0009.00 C
endif
0010.00 C
enddo
0011.00 C
eval
*inlr=*on
****************** End of data *************************
OUTPUT SCREENS:
Like above screens all the records in pf will be displays in display screens
data ************************************
REF(SURIPAD1/PF1)
CF03(03)
4 30'EMPLOYEE DETAILS'
6 25'EMPLOYEENUMBER:'
8 25'EMPLOYEENAME:'
10 25'EMPLOYEESALARY'
15 25'F3=EXIT'
B 6 45
B 8 40
0029.00
A
ESAL
R
B 10 45
****************** End of data *************************************
Rpg Program For Writing Files Through Display File
*************** Beginning of data **************************************
0001.00 Fpf1
uf a e
disk
0002.00 Fdsp1
cf e
workstn
0003.00 C
exfmt
dspfmt
0004.00 C
dow
*in03=*off
0005.00 C
write
recfmt
0006.00 c
clear
dspfmt
0007.00 c
exfmt
dspfmt
0008.00 C
if
*in03=*on
0009.00 C
leave
0010.00 C
endif
0011.00 C
enddo
0012.00 C
return
****************** End of data *****************************************
By ABOVE code some records are to be inserted in to physical files.
OUTPUT SCREEN:
30
OUTSCREENS:
Enter the employee number, which you want to update the details, after
entering the number the following screen will be displayed,
The shown details can be modifying in the above screen, the modified details
are to be stored in the actual physical file.
DELETING FILES IN PHYSICAL FILE THROUGH DISPLAY SCREEN
Create a display file with name dsp1 in DDS. Following is source.
*************** Beginning of data **********************************
0001.00
A
REF(SURIPAD1/PF1)
0002.00
A
CF03(03)
0004.00
A
R DSPFMT1
0005.00
A
4 30'EMPLOYEE DETAILS'
0006.00
A
6 25'EMPLOYEE NUMBER:'
0007.00
A
15 25'F3=EXIT'
0008.00
A
ENO
R
B 6 45
0009.00
A
R DSPFMT2
0010.00
A
4 30'EMPLOYEE DETAILS'
0011.00
A
6 25'EMPLOYEENUMBER:'
0012.00
A
8 25'EMPLOYEENAME:'
0013.00
A
10 25'EMPLOYEESALARY'
0014.00
A
15 25'DELETE:'
0015.00
A
20 25'F3=EXIT'
0017.00
A
ENO
R
B 6 45
0018.00
A
ENAME
R
B 8 40
0019.00
A
ESAL
R
B 10 45
0020.00
A
DFLD
4A B 15 40
****************** End of data ****************************************
SUBFILES:
1. LOAD ALL SUBFILE:
STEP 1:
Physical File (Exmds) Which Is Using In Subfile
*************** Beginning of data ********************
001.00
A
R RECFMT
002.00
A
ENO
5S 0
003.00
A
ENAME
20A
004.00
A
EDEPT
15A
005.00
A
K ENO
****************** End of data **********************
Output for above file is:
ENO
000001
000002
000003
ENAME
EDEPT
1 PADALASURYANARAYANA SSQUAREEE
2 SUNILKUMARDANDE
SSQUARE
3 ARJUNYADAVB
SSQUAREE
000004
4 VEERA PRATAP
000005
5 SAI
000006
6 GOPI
000007
7 LUCKY
****** ******** End of report
REDDY SSQUARE
SSQUARE
SSQUARE
SSQUARE
********
STEP2:
Create a display file for Subfile(sfl):
0003.00
A
DSPSIZ(24 80 *DS3)
0004.00
A
R SFLFMT
SFL
0006.00
A
ENO
R
B 5 7REFFLD(RECFMT/ENO
SURIPAD1/EXMDS)
0007.00
A
ENAME
R
B 5 20REFFLD(RECFMT/ENAME
SURIPAD1/EXMDS)
0008.00
A
EDEPT
R
B 5 46REFFLD(RECFMT/EDEPT
SURIPAD1/EXMDS)
0009.00
A
R CTLFMT
SFLCTL(SFLFMT)
0011.00
A
CF03(03 'exit')
0012.00
A
CF05(05 'refresh')
0013.00
A 20
SFLDSP
0014.00
A 21
SFLDSPCTL
0015.00
A 22
SFLCLR
0016.00
A
SFLSIZ(0050)
0017.00
A
SFLPAG(0010)
0018.00
A
4 8'ENO'
0019.00
A
4 23'ENAME'
0020.00
A
4 51'EDEPT'
****************** End of data
**************************************************
Step 3:
Create RPG program for Load all subfile:
*************** Beginning of data
******************************************
0001.00 FEXMDS
IF E
DISK
0002.00 FSFL
CF e
workstn SFILE(SFLFMT:RRN)
0003.00 DRRN
S
3S 0 INZ(0)
0004.00 C
EXSR
CLRSR
0005.00 C
EXSR
LOADSR
0006.00 C
DOW
*IN03=*OFF
0007.00 C
EXSR
DSPSR
0008.00 C
ENDDO
0009.00 C
EVAL
*INLR=*ON
0010.00 C
CLRSR
BEGSR
0011.00 C
EVAL
*IN22=*ON
0012.00 C
WRITE
CTLFMT
0013.00 C
EVAL
*IN22=*OFF
0014.00 C
ENDSR
0015.00 C
LOADSR
BEGSR
0016.00 C
READ
RECFMT
0017.00 C
DOW
*IN40=*OFF
0018.00 C
EVAL
RRN=RRN+1
0019.00 C
WRITE
SFLFMT
0020.00 C
READ
RECFMT
0021.00 C
ENDDO
0022.00 C
ENDSR
0023.00 C
DSPSR
BEGSR
0024.00 C
EVAL
*IN20=*ON
0025.00 C
EVAL
*IN21=*ON
0026.00 C
EXFMT
CTLFMT
0027.00 C
EVAL
*IN20=*OFF
0028.00 C
EVAL
*IN21=*OFF
0029.00 C
ENDSR
****************** End of data
**********************************************
Output screen for load all subfile:
40
40
0017.00
A
OVERLAY
0018.00
A
R FOOTER
0019.00
A
23 15'F3=EXIT'
0020.00
A
23 25'F5=REFRESH'
****************** End of data ************************************
Step 3:
Create RPG program for Load Expandable subfile:
*************** Beginning of data
********************************************
0001.00 FPF1A
IF E
DISK
0002.00 FSFL1sda CF e
workstn SFILE(SFtrec:RRN)
0003.00 DRRN
S
3S 0 INZ(0)
0004.00 C
EXSR
CLRSR
0005.00 C
EXSR
LOADSR
0005.01 C
EXSR
DSPSR
0006.00 C
DOW
*IN03=*OFF
0007.00 C
EXSR
usrSR
0008.00 C
ENDDO
0009.00 C
EVAL
*INLR=*ON
0010.00 C
CLRSR
BEGSR
0011.00 C
EVAL
*IN12=*ON
0012.00 C
WRITE
CTLrec
0013.00 C
EVAL
*IN12=*OFF
0014.00 C
ENDSR
0015.00 C
LOADSR
BEGSR
0016.00 C
READ
REFMT
40
0017.00 C
DOW
*IN40=*OFF
0018.00 C
EVAL
RRN=RRN+1
0019.00 C
WRITE
SFtrec
0020.00 C
READ
REFMT
40
0021.00 C
ENDDO
0022.00 C
ENDSR
0023.00 C
DSPSR
BEGSR
0024.00 C
EVAL
*IN10=*ON
0025.00 C
EVAL
*IN11=*ON
0026.00 C
EXFMT
CTLrec
0027.00 C
EVAL
*IN10=*OFF
0028.00 C
EVAL
*IN11=*OFF
0029.00 C
ENDSR
0030.00 C
USRSR
BEGSR
0031.00 C
DOW
*IN13=*ON
0032.00 C
EVAL
RRN=RRN+1
0033.00 C
EXSR
LOADSR
0034.00 C
EXSR
DSPSR
0035.00 C
EVAL
*IN13=*OFF
0036.00 C
ENDDO
0037.00 C
ENDSR
STEP2:
Create a display file for Subfile(SFL1):
0012.00
0013.00
0014.00
0015.00
0016.00
0017.00
0018.00
0019.00
0020.00
0021.00
0022.00
0023.00
0024.00
0025.00
0026.00
0027.00
0028.00
0029.00
0030.00
0031.00
0032.00
0033.00
0034.00
0035.00
0036.00
0037.00
0038.00
0039.00
0040.00
0041.00
0042.00
0043.00
0044.00
0045.00
0046.00
0047.00
0048.00
0049.00
0050.00
0051.00
0052.00
0053.00
0054.00
0055.00
0056.00
0057.00
0058.00
0059.00
0060.00
0061.00
C
return
c**********************************************************
C
clrsr
begsr
C
eval
*in22=*on
C
write
ctlrec
C
eval
*in22=*off
C
endsr
c***********************************************************
C
loadsr
begsr
C
EVAL
rrn=1
c
do
5
C
read
formate
C
if
not %eof(lf)
C
write
sflrec
C
eval
rrn=rrn+1
c
endif
c
enddo
C
endsr
c***********************************************************
C
dspsr
begsr
C
eval
*in20=*on
C
eval
*in21=*on
C
exfmt
ctlrec
C
eval
*in20=*off
C
eval
*in21=*off
C
endsr
c***********************************************************
C
usrsr
begsr
* if pressed pageup
C
If
*in06=*on
c
do
10
c
readp
lf
c
if
%eof(lf)
c
leave
c
endif
c
enddo
c
empno
setll
formate
C
exsr
clrsr
c
exsr
loadsr
c
exsr
dspsr
c
endif
* if pressed pagedowm
C
If
*in07=*on
c
empno
setll
formate
C
exsr
clrsr
c
exsr
loadsr
c
exsr
dspsr
c
eval
*in07=*off
c
endif
c
endsr
After the screen appears.. give PAGEDOWN following screen will appears
After the screen appears.. give PAGEUP following screen will appears
PRINTER FILES:
Printer file using RLU:
-------------------------------------------------- Start of Page 001 -------------------FLD1
<..........>
RCD001
'EMPDETAILS'
FLD1
<...>
<.....>
<...>
RCD003
STUID
STUNAME
STUNO
FLD1
<..>
<...>
<.>
RCD002
9999
XXXXX
999
00004 S
9999
XXXXX
999
00005 S
9999
XXXXX
999
00006 S
9999
XXXXX
999
00007 S
9999
XXXXX
999
00008 S
9999
XXXXX
999
FLD1
<......>
RCD004
'FOOTER'
---------------------------------------------------- End of Report ---------------------RPG Program for above Printer file:
20
20
OUTPUT:
For output compile the rpg program with 14 and call it, then check spooled
files, run the spooled file with option 5, then the following screen will
appears
20
20
OUTPUT:
For output compile the rpg program with 14 and call it, then check spooled
files, run the spooled file with option 5, then the following screen will
appears