Hey all!!!!
Thanks for ur help previously here is my code recorected
As mentioned before My objective is to enter the sales person number and then to show me in sub file all the customer related to this sales person
The compile is now without errors but in the execution the loaded file never get load wutever value I enter any idea whyâ?¦..
thanks in advance!
PHYSICAL AND LOGICAL FILE
CUSTSF (PF)
CUSTSFL(LF)
DISPLAY FILE : TSTSF
RPG PROGRAM
Thanks for ur help previously here is my code recorected
As mentioned before My objective is to enter the sales person number and then to show me in sub file all the customer related to this sales person
The compile is now without errors but in the execution the loaded file never get load wutever value I enter any idea whyâ?¦..
thanks in advance!
PHYSICAL AND LOGICAL FILE
CUSTSF (PF)
Code:
0001.00 A R CUSTPFR 0002.00 A CUSTID 7A 0003.00 A CUSTNAME 16A 0004.00 A CUSTADDR 10A 0005.00 A CUSSLS 4A 0006.00 A K CUSTID
Code:
0001.00 A R CUSTPFR PFILE(CUSTSF) 0002.00 A K CUSSLS
DISPLAY FILE : TSTSF
Code:
0001.00 A REF(NAKH/CUSTSF CUSTPFR) 0002.00 A******************************************************** 0003.00 A R ENTSLS 0004.00 A CF03(03) 0005.00 A O 2 20'LIST CUSTOMERS' 0006.00 A CUSSLS R B 2 46 0007.00 A********************************************************* 0008.00 A R SFDATA SFL 0009.00 A CUSTID R O 4 7 0010.00 A CUSTNAME R O 4 16 0011.00 A CUSTADDR R O 4 32 0012.00 A********************************************************** 0013.00 A R SFCTL SFLCTL(SFDATA) 0014.00 A SFLPAG(0015) 0015.00 A SFLSIZ(0045) 0016.00 A OVERLAY 0017.00 A 50 SFLCLR 0018.00 A 50 SFLDSP 0019.00 A 50 SFLDSPCTL 0020.00 A 50 SFLEND(*MORE) 0021.00 A 2 4'SALESPERSON#' 0022.00 A CUSSLS R O 2 17 0023.00 A 3 4'CUSTOMER#' 0024.00 A 3 15'NAME' 0025.00 A 3 50'ADDRESS' 0026.00 A R CMDKEYS 0027.00 A 24 40'F3=EXIT'
RPG PROGRAM
Code:
0001.00 FTSTSF CF E WORKSTN 0002.00 F SFILE(SFDATA:REC#) 0003.00 FCUSTSFL IF E K DISK 0004.00 DREC# S 5 0 INZ(1) 0005.00 D****************************************************************** 0006.00 C DOW *IN03=*OFF 0007.00 C EXFMT ENTSLS 0008.00 C IF *IN03=*OFF 0009.00 C EXSR CLRSF 0010.00 C EXSR LODSF 0011.00 C WRITE CMDKEYS 0012.00 C EXFMT SFCTL 0013.00 C ENDIF 0014.00 C ENDDO 0015.00 C EVAL *INLR = *ON 0016.00 C RETURN 0017.00 C CLRSF BEGSR 0018.00 C EVAL *IN50 = *OFF 0019.00 C WRITE SFCTL 0020.00 C EVAL *IN50 = *ON 0022.00 C EVAL REC# = *ZERO 0023.00 C ENDSR 0024.00 C LODSF BEGSR 0026.00 C CUSSLS CHAIN CUSTSFL 0027.00 C IF NOT%FOUND(CUSTSFL) 0030.00 C CUSSLS READE CUSTSFL 0031.00 C DOW NOT%EOF(CUSTSFL) 0033.00 C ADD 1 REC# 0034.00 C WRITE SFDATA 0035.00 C CUSSLS READE CUSTSFL 0036.00 C ENDDO 0037.00 C ENDIF 0038.00 C REC# IFEQ *ZERO 0039.00 C ADD 1 REC# 0040.00 C CLEAR SFDATA 0041.00 C MOVEL '*NO RECORDS*'CUSTNAME 0042.00 C WRITE SFDATA 0043.00 C ENDIF 0044.00 C ENDSR




Comment