Example RPG program to populate the Infor System21 *LDA

Ever had to populate the *LDA in correct layout for JBA ERP Modules (aka GEAC aka Infor System21?

Here is a simple RPGLE program knocked up to setup the *LDA priot to running a few little INFOR SYSTEM21 extraction routines:

WEBSETLDA

// -------------------------------------------------------------------
// Service Name - WEBSETLDA
// Function - Populate *LDA with Dummy values
// Version - *see Hcopyright
// Author - Nick Litten (www.nicklitten.com)
// -------------------------------------------------------------------
// Modification History:
// 2014-03-17 V1 Created
// 2014-06-26 V1.1 Set L#RTCD to blanks.
// -------------------------------------------------------------------

H DEBUG
H OPTION(*SRCSTMT: *NODEBUGIO)
H DFTACTGRP(*NO) ACTGRP('SOAP')
H COPYRIGHT('Setup dummy *LDA - Version 1.1')

// -------------------------------------------------------------------
D psds sds
D psdsProcName 1 10

D psdsLibName 81 90
D psdsJobName 244 253
D psdsUserName 254 263
D psdsJobNbr 264 269

D LDA DS dtaara(*lda)
D L#CONO 1 2 INZ('AA')
D L#CONM 3 37 INZ('Test Company from WEBSETLDA' )
D L#PRQU 38 47 INZ('PGMOUTQ')
D L#PLIB 48 57 INZ('*LIBL')
D L#JOBQ 58 67 INZ('QPGMR')
D L#JOBL 68 77 INZ('*LIBL')
D L#DFNM 78 87
D L#FMTN 88 97
D L#PGID 98 107 INZ('NONE')
D L#JOBN 108 117 INZ('JOBNAME')
D L#RTCD 118 119 INZ(' ')
D L#USER 120 129 INZ(*USER)
D L#APPN 130 131 INZ('SL')
D L#FUNC 132 135 INZ('1234')
D L#HOLD 136 136 INZ('N')

D L#LIBL 137 140 INZ('IN01')
D L#CUSC 141 143 INZ('TST')
D L#JBNO 144 152 INZ('123456789')
D L#SOFF 153 153 INZ('N')
D L#MNCO 154 154 INZ('N')
D L#RSTA 155 155 INZ('N')
D L#EXCL 156 156 INZ('N')
D L#TERM 157 166
D L#RLSL 167 168 INZ('03')
D L#APSR 169 169 INZ('O')
D L#GLCO 170 171 INZ('AH')
D L#PRCO 172 173
D L#XXCO 174 175
D L#CPFN 176 181
D L#HPCD 182 183 INZ('AL')
D L#NAPS 184 184
D L#SBMX 185 185 INZ('N')
D L#DTFM 186 186 INZ('M')
D L#LANG 187 188 INZ('US')
D L#AACD 189 197
D L#IDAT 198 204 INZ('CYYMMDD')

D L#EDAT 205 210 INZ('MMDDYY')
D L#LGLB 211 220
D L#MENU 221 230
D L#INAM 231 240
D L#CROW 241 241
D L#CCOL 242 242
D L#MCUR 243 243
D L#USAF 244 244
D L#VATF 245 245
D L#WHCD 246 247
D L#RSVD 248 256
D L#PARMDATA 257 1024
// ------------------------------------------------------------- *
// define *entry plist parms
// will return a status of *on if lda is updated
D EntryPList PR Extpgm('WEBSETLDA')
D EntryPlist Pi

// ------------------------------------------------------------- *
// mainline processing
// ------------------------------------------------------------- *

/free

In LDA;
reset LDA;
L#USER = psdsUsername;
L#TERM = psdsJobName;
L#JOBN = psdsJobName;
L#JBNO = '000' + psdsJobNbr;
L#IDAT = %char(%DATE:*CYMD0);
L#EDAT = %char(%DATE:*MDY0);
L#RTCD = *blanks;
Clear l#ParmData;
Out LDA;

*inlr = *on;

/end-free

NOTE: This has some hard coded values in the ‘d’ specs. Set them as you wish… call the program and the LDA will be ready to call any System21 program that uses the company code defined in L#CONO

Modernized **FREE RPGLE code can be seen here

 

(0 votes) 0/10