Posts

AS400: Batch Debug

Service Job for Debug: Batch Debug: Hold the job STRSRVJOB on that job strdbg on the program put some break points comeout relase the job   Once the job calls the program in debug will open in debug mode For interactive job Debug: STRSRVJOB on the interactive job STRDBG on the program and put some break points Comeout Then have the users use the screen or something that call the program in debug mode The debug screen will come to your screen for their job.

AS400: Starting AS400 Emailing IBM job

Use command to start the QMSF job (2 jobs may run). This is an essential job for SNDDST to send email. If not running, SNDDST will complete successfully but email wont be sent. Check QMSF jobs in Active job list,  if not running Run below command to start them. If already running, you can kill them and start using below command if needed. STRMSF

RPGLE CL Command to call aprogram with numeric parameter

PGM : TESTHEX H DftActGrp(*NO) Option(*SRCSTMT)    D charval         S             26a   inz('123.00')            DRunCommand       PR                  ExtPgm('QCMDEXC')                DpCommand                     2560    const                            DPCmdLen                        15  5 const                            DpCommand         S           2560                          ...

RPGLE date format example

H DftName(TESTRPG) DftActGrp(*No) ActGrp(*New)      H Option(*srcstmt:*NoDebugIo)                        D*                                                  D*                                                  D vDate           S               d    datfmt(*ISO)  d wrk_date        DS                                D wrk_Cent                       2                  d wrk_year...

Data area RPGLE Example

H Option(*SrcStmt:*noDebugIo)                                       *                                                                   * Test Program for Data area                                       *                                                                  D                                                      ...

AS400: RPGLE - Get the job attribute and Trap Error using Monitor

This program will check if a job is active, If active it will give the status of the job. D eFlag             S              1        DQusrJobi         PR                  EXTPGM('QUSRJOBI')    DRcvVar                      32766A   options(*varsize)      DRcvVarLen                      10I 0 const                  DFormat                             8A   const                  DQualJob                          26A   const   ...

AS400 RPG: override a file that is defined in Fspec

If the need is to just override the file to a single file then in the F Spec we can define the EXTFILE() EXTMBR() to override the file  FDDMF      UF A E           K DISK    EXTFILE(LIB/FILENAME) EXTMBR(MBRA) If the need is to override the file to different file then we need to execute the override command based on the logic. We can use QCMDEXEC to run the CL command so that we dont need another CL program to do Overrides. To override a file that is defined in the F Spec we need to override the file before it is open.. So we need to control the file opening using USROPN option on that file. Run the command to override using   QCMDEXEC. The scope of the override has to at job level due to ILE concept and activation group the default scope (Activation Group level) wont work. Then open the file and perform the program logic. At end close the file and delete the override (LVL(*JOB)) F Spec: FDDMF  ...