120 pts.
 Subfile
Hi i have started learning Subfile and i've written a Load All Subfile code to display all the records in a PF. it is working fine.But I want to know what else should i include in this code to make it accoring to coding standard. Also i need help in writing the single page Subfile program.So what things should i include in this code to make it work as Single Page Subfile. Here is the code >> FVb001sflpfIF E k Disk FVb001sfl CF E Workstn SFILE(VB1SFL:@RRN) D@Rrn S 3 0 ***----------------------------------------------------->> C Exsr SflCLr C Exsr SflDsplay C Eval *inlr = '1' ***-----------------For Sfl Clear ---------------------->> C SflCLr BegSr C Eval *in50= '0' C EndSr ***-----------------For Sfl Display--------------------->> C SflDsplay BegSr C ' ' SETLL Vb001sflpf C WRITE VB1CTL C WRITE VB1BTM C Eval *in50 = '1' C EVAL @RRN = 0 C Read Vb001sflpf C DOW Not%EOF(Vb001sflpf) C MOVE PFITEMID SFLITEMID C MOVE PFAMT SFLAMT C MOVE PFDESC SFLDESC C EVAL @RRN = @RRN + 1 C Write VB1SFL C Read Vb001sflpf C ENDDO C DOW *IN03 = '0' C Exfmt VB1CTL C ENDDO C EndSr Thanks :)

Software/Hardware used:
AS400,RPGLE
ASKED: July 27, 2012  12:19 PM
UPDATED: July 27, 2012  12:19 PM

Answer Wiki:
Ok..here this code is not standard according to me because if you are reading a file then it may be possible that it can contain records greater than 9999, which is the highest maximum records which we can load in subfile. so i think that logic is missing from this code and also some looping concepts, just you have to check that. You can also do better programming with *Inzsr subroutine. If you are going to do single page subfile programming then you can follow this logic that...first you have read then load....then display....then clear then again read and so on..until you want whether till end of file or something till at increment level.
Last Wiki Answer Submitted:  July 30, 2012  11:17 am  by  ITKBHARAT   120 pts.
All Answer Wiki Contributors:  ITKBHARAT   120 pts. , mapfld   5 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Coding standards vary from company to company.  Without knowing what those standards are it is not possible for anyone here to judge whether your code meets those standards or no.  For a ‘Single Page Subfile’ you will need to develop code that handles the loading of the specific subset of data you wish to present.  There are numerous examples accessible through a quick search of the internet.To borrow a phrase from TomLiotta, what is the specific technical problem you’re having? 

 5,670 pts.

 

Apparently this editor has an odd and inconsistent view of paragraphs.

 5,670 pts.

 

For the load all, I would have a seperate subroutine for loadSFL and dspsfl.
 
I would say the for about $4.00 used plus $50 handling and Shipping you should get the book Essentials of Subfile Programming and Advanced Topics in RPGIV. 
 
If you think you have questions now..wait till you try to read the book!

 44,070 pts.