Posts

PRINTER FILE PRTF - How to print with a externally described printer file

Image

IBMi (AS400) fans only : How to add an HELP panel (Minimalist example) to a DSPF - HELP - ALTHELP - HLPARA - HLPPNLGRP

Image
  #IBMiSample This is the PANEL source. Compile with  CRTPNLGRP PNLGRP(MyLib/PNLGR1) SRCFILE(MyLib/MySrcFile) SRCMBR(PNLGR1)   Member      Type   PNLGR1      PNLGRP .*********************************************************** .*    THIS IS HELP PANEL GROUP FOR HOTELIBMi               * .*********************************************************** :PNLGRP.                                                      .***********************************************************  .*    THIS IS HELP PANEL OTO500                            *  .***********************************************************  :HELP NAME=OTO500.Print arrivals Help panel       ...

IBMi (AS400) fans only * How to add/subtract days to a date from CL (CONTROL LANGUAGE)

Image
#IBMiSample This is a CLLE! Compile with: CRTBNDCL PGM(DATEDISPLC) SRCFILE(QCLSRC) SRCMBR(DATEDISPLC) DATEDISPLC.CLLE /**************************************************************/ /* add/subtract days to a date                                */ /* Try with: CALL DATEDISPLC PARM('270219' X'0000005F')       */ /**************************************************************/              PGM        PARM(&DATE &DISPLACEM)                                   DCL        VAR(&DATE) TYPE(*CHAR) LEN(6)                            DCL        VAR(&DISPLACEM) TYPE(*DEC) LEN(6 0)             ...

IBMi (AS400) fans only * HOW TO GET CURRENT TIME FROM CL (CONTROL LANGUAGE)

Image
#IBMiSample This example gets current time in format HHMMSS.              PGM                                                   DCL        VAR(&TIME) TYPE(*CHAR) LEN(6)              RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&TIME)                SNDPGMMSG MSG(&TIME)                                  ENDPGM                                  

IBMi (AS400) fans only : How to get today's date from CL (Control Language)

Image

IBMi (AS400) fans only : RPG Free Format: Procedure with a parameter and return value

Image
#IBMiSample AS5502.RPGLE - Procedure with a parameter and return value       **FREE          Ctl-Opt DFTACTGRP(*No);          Dcl-S gMyVar Char(13) Inz('<---Hello--->');          Dcl-S pValue2 Char(3);          Dcl-S pValue3 Char(3);          Dsply gMyVar;          pValue2='!__';          pValue3='__!';          gMyVar = MyProc('Goodbye':pValue2:pValue3);          Dsply gMyVar;          *InLR = *On;        ...

IBMi (AS400) fans only : QSQGNDDL API: How to get SQL SOURCE specification from a database object

Image
#IBMiSample QSQGNDDL API generates the SQL data definition language statements from a database object. Here's how to use it. How to get SQL CREATE TABLE specification from DDS

IBMi (AS400) fans only : Reverse date 6 0 in one instruction

Image
#IBMiSample In this example, the  OTDTP0  field is numeric 6 with 0 decimal places. It should contain a number rapresenting a DATE in yymmdd (i.e 210208 - February 8, 2021) or ddmmyy format  (i.e 080221 - February 8, 2021). The following instructions turns yymmdd to ddmmyy or viceversa (the other way around). OTDTP0 zoned(6); OTDTP0 = %dec(%char(%date(OTDTP0:*ymd):*dmy0):6:0); // yymmdd to ddmmyy OTDTP0 = %dec(%date(OTDTP0:*ymd):*dmy);  // yymmdd to ddmmyy I appreciate all the comments made on this blog.

IBMi (AS400) fans only : RPG Free Format get Today's date with a single instruction

Image

IBMi (AS400) fans only : RPG Free Format: Example to get day of week

Image