16 How can you search an entire source file for a particular field name? In wrkmbrpdm screen enter option=25, then shift + F1. Enter the test that you want to search. Results will be shown. If the search string needs to be searched in particular source hit F16. FNDSTRPDM.
How can you find the differences between two versions of the source for the same program? one can use CMPPFM command or option 54.
What is a hidden field as it relates to a sub file? Hidden field is just like any other field in subfile. Only difference you will not be able to specifiy position location for the field. That is why it is called hidden field.
How do you display a sub file that has no records in the sub file? Use SFLINZ keyword. Before doing the EXFMT to control record set on the SFLINZ controlling indicator.
How to monitor error messages in RPG?
Method 1: To moniter Error in RPG make use of MONITIOR ..... ON-ERROR ENDMON u can place a subroutine , procedure etc under this to handle the error for the following
Method 2: Use E Extender
Method3: Use of *pssr
What is the RPG cycle?It is RPG400 Logic means it is a compiler logic through which system reads the primary file starting from begining to end of file. No File operations like read/chain can be used.System has the control of the program.
Use of SFLRCDNBR? This keyword allows us to specify what page we have to display when the program issues the write or EXFMT screen. For example subfile size is 35 & subfile page is 10 and at anypont we have to dispaly 33th record directly. For it we have to add one line in display file. A var-name size dec.position use Function A var 4 0 H SFLRCDNBR
Use of *MAP and *DROP? When we copy data from FILE A to FILE B and if FILE A has 20 fields and FILE B has 30 fields (say there are 10 fields which is not common among both the files). Using *MAP and *DROP option we can copy the data from FILE A to FILE B.All the fields would be mapped between both the files and the unmatched fields would be dropped.
why we use option(*nodebugio)in H- Spec? *NODEBUGIO is used to avoids debugging I/O operation while using STRDBG command to debug the program. When *NODEBUGIO is not used, and if a file level opcode is being debugged, the control would move to the F-Spec and it will keep executing the steps until the file operation gets completed and then the control would move to next step. When *NODEBUGIO is used, and the above mentioned detail is ignored. The file level opcode would get executed at a single point execution and the program would move to next step.
what is the procedure of debugging the service program?service program will always be binded and it can't be called directly.Now, to create a wrapper:create one RPG Program in which service progrem is binded Now, to debug, Strdbg SRVPGM(ABC) add break point now call the Wrapper program. ------or ----------------------- Strdbg Wrapper program name than F14 to work with module list and add your service program(*SRVPGM) and add the break. Call wrapper.
You have a *USE authority on a Library and *All authority on a file in that Library.Can you change the data in that file? Yes we can change data on file.
HOw to Debug a job that has *MSGW status? dspjoblog dspjob ,check, if there has any lock waiting statue. strsrvjob and debug.
Use of MDT? If you perform read on the subfile, the internal indicator MDT (modified data tag) is automatically set off by the system. If you again perform read on the same records, records won't be read. Because internal indicator MDT would be off. Hence you should be explicitly set on the MDT by SFLNXTCHG keyword.
Can we have a Physical file without any member ? Yes we can have a PF without a member. while comiling the file we can give member option - None . which will not create a member. But in order to store data and access it member is required.
What is the name of default out queue when user logs inn to syatem with valid profile?default out queue name is same as userid and located in QGPL lib. by using WRKUSRPRF command you can checked it.
How to find d key field of a pf that doesn’t have source physical file? DSPFD FILE(FILE1) TYPE(*ACCPTH)
steps for debugging two rpg programs? (PGMA>>>Calling>>PGMB)both are rpg pgms. Compile PGMA with source type(*SRCDBG) and PGMB with (*Source) 1)STRDBG PGMA 2)In debuging view press F14 and selct option 1 ,specify pgm name ,library. 3)press enter ,select module source from list,add break point in PGMB 4) Press F14, add brk point sin PGMA. 5) Call PGMA It will start the debugging for 2 pgms
How to set on/off a group of indicators in a single statement?C MOVE '00000' *IN(21).
Can an indexed file be accessed in arrival sequence in RPG? By not specifying K in Record Address type.
When will DUMP & DEBUG be ignored? When you specify DEBUG (*NO) on H specification.
How can i keyed a flat file in RPGLE
FMASTER IF F 96 96 DISK A F KRECNO RRN
Should we /copy or /Include our copybooks? There's no difference between /COPY or /INCLUDE. The whole Idea is that you can not use nested /COPY directive in SQLRPGLE programs. That's you define a copybook which again defines some copybook. In that case you may get the following errors • The SQL preprocessor does not allow nested /COPY commands.
Is it necessary to preserve a copybook after we have compiled the main source file successfully? No, As soon as you compile the main source file, the copybook is no longer required. In fact you may delete the copybook.
Can we create copybook objects? Can we compile a copybook? Compiling a copybook is not the purpose of a copybook. Copybooks are just common portions of scripts in separate member. They are not meant to be compiled.
Reading Flat file?
FFlatfile IF A E Disk ** Rename the record format name
F Rename(Flatfile: FLATFILE01)
D W@FlatFile DS DFirstName 1 10
DLastName 11 20
DSex 21 26
DAge 27 28
0 ** IFLATFILE01 ** Associate the database field with data structure.
I FLATFILE W@FlatFile ** Everything set now. Use the flat flat as a physical file with four ** columns namely FirstName, LastName, Sex and Age! ** Read data from this flat file as you would do with any other PF.
C Read FLATFILE01
C DoW Not %EoF(FLATFILE)
C FirstName Dsply
C LastName Dsply
C Sex Dsply
C Age Dsply
C Read FLATFILE01
C EndDo
Write to the flat file using RPG IV.
FFlatfile IF A E Disk ** Rename the record format name
F Rename(Flatfile: FLATFILE01)
D @FirstName S 10
D @LastName S 10
D @Sex S 6
D @Age S 2 0
D W@FlatFile DS Inz
DFirstName 1 10
DLastName 11 20
DSex 21 26
DAge 27 28
0 ** IFLATFILE01 ** Associate the database field with data structure.
I FLATFILE W@FlatFile ** Everything set now. Use the flat flat as a physical file with four ** columns namely FirstName, LastName, Sex and Age! ** Write data to this flat file as you would do with any other PF.
C *Entry PList
C Parm @FirstName
C Parm @LastName
C Parm @Sex
C Parm @Age ** Populate file fields
C Eval FirstName = @FirstName
C Eval LastName = @LastName
C Eval Sex = @Sex
C Eval Age = @Age ** Write to the flat file
C Write FLATFILE01
C Eval *InLr = *On
C Return
How can we make use of SETLL operation in CL? OVRDBF FILE(File name) TOFILE(new file name) MBR(*first) POSITION(*RRN 55) 55 = record number OR OVRDBF FILE(File name) TOFILE(new file name) MBR(*first) POSITION(*KEY 1 RCD1 SYAM) 1 = no of key field RCD1= Record format name
Changing spool name or userdata?
Ovrprtf spoolname userdata
Runqry……
Dltovr spool
For printig text from Cl ?
CRTMSGF MSGF(QTEMP/MYMSGF)
ADDMSGD MSGID(A123456) MSGF(QTEMP/MYMSGF) MSG(TEST)
DSPMSGD MSGF(QTEMP/MYMSGF) DETAIL(*BASIC) OUTPUT(*PRINT)
How to know the number of records in a pf through clp program? runqry with output form as *SUMMARY parameter
What is the purpose of level checking? To ensure that the version of a file used by a program has not changed since the program was compiled
What is the difference between CA and CF command keys? CA means that screen validity checking is bypassed and no screen .data is passed to the program. CF means that screen validity Is it necessary to give PGM in CL program?No,It is only required if Parameters are to pass in the program.
No comments:
Post a Comment