RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Blog - Content Section Layout
Retrives the IP Address of the logged in Device
User Rating: / 3
Written by Chamara Withanachchi   
 *==========================================================
 * Function: Retrieve IP address of PC 
 * 
 *==========================================================
 H DFTACTGRP(*NO) BNDDIR('QC2LE') 
 D RtvIpAdr        PR            20a 
 D  Device                       10a   CONST 
 * 
 D I_Net_Adr       S             16a 
 * 
 D                SDS 
 D  Device               244    253 
 *--------------------------------------------------------- 
 * Retrieve IP Addresss 
 C                   Eval      I_Net_Adr   = RtvIpAdr(Device)
 C                   Eval      I_Net_Adr   = %trim(I_Net_Adr)
 
 C     I_Net_Adr     Dsply 
 C                   Eval      *Inlr = *On 
 
 *--------------------------------------------------------- 
 *    RtvIpAdr - Subprocedure To Retrieve PC's IP Address 
 *--------------------------------------------------------- 
 P RtvIpAdr        B                   Export 
 D RtvIpAdr        PI            20A                              
D Inp_Device 10A Const
D Apierr DS
D Bytprv 1 4B 0 Inz(216)
D Bytavl 5 8B 0 Inz
D Errid 9 15A Inz
D Rsvd 16 16A Inz
D Errdta 17 216A Inz
D Net_Address S 20A INZ
D Format S 8A Inz('DEVD0600')
D Rcvar S 5000A Inz
D Varlen S 4B 0 Inz(5000)
C Eval Device = Inp_Device
C Call 'QDCRDEVD'
C Parm Rcvar
C Parm Varlen
C Parm Format
C Parm Device
C Parm Apierr
C If BytAvl = 0
C Eval Net_Address = %Subst(Rcvar:877:16)
C Endif
C Return Net_Address P RtvIpAdr E
Write Comment (0 comments)
Generate Sequence of numbers by using Alpha characters
User Rating: / 0
Written by Chamara Withanachchi   
Generate Sequence of numbers by using Alpha charactors

Ex:

1,2,3,4,......A,B,.....11,12,13......1A,1B up to ZZZZ


  ****************************************************************   
* Description.. Generate Number Sequence *
* Program Name. BRNNBR *
* Author....... Chamara Withanachchi *
****************************************************************

D #DigArr S 1A DIM(36) CTDATA
D #DidX S 2 0

D #BrnArr S 1A DIM(4)
D #BidX S 1 0

D #FnlBrCde S 4A

D #BrCode S 4A

D #nbrI S 1 0
D #chr S 1A
D #curDigLoc S 2 0

D #Inc S like(*IN40)
C *entry plist
C parm i@BrnNbr 4

/Free

eval #DidX = 1;
eval #BidX = 1;

for #nbrI = 1 to 4;
eval #chr = %subst(i@BrnNbr:#nbrI:1);
eval #BrnArr(#BidX) = #chr;
eval #BidX = #BidX + 1;
endfor;

exsr SB_Increment;
dsply #FnlBrCde;

eval *INLR = *ON;

//-----------------------------------------------------------------------
// Increment the Number
//----------------------------------------------------------------------- begsr SB_Increment;

eval #curDigLoc = *zeros;
eval #BidX = 4;

dow #BidX <= 4 and #BidX <> *zeros;

eval #curDigLoc = %lookup(#BrnArr(#BidX):#DigArr:1);
eval #curDigLoc = #curDigLoc + 1;
if #curDigLoc > 36;
eval #BrnArr(#BidX) = '0';
eval #BidX = #BidX - 1;
eval #Inc = *ON;
eval #curDigLoc = %lookup(#BrnArr(#BidX):#DigArr:1);
else;
eval #DidX = #curDigLoc;
eval #BrnArr(#BidX) = #DigArr(#DidX);
leave;
endif;
if #Inc <> *ON;
eval #BidX = #BidX - 1;
endif;
eval #Inc = *OFF; eval #Inc = *OFF;

enddo;

eval #FnlBrCde = #BrnArr(1) + #BrnArr(2) +
#BrnArr(3) + #BrnArr(4);

endsr;

/End-Free

** #DigArr 0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
G
H
I
J
K
L
M N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Write Comment (0 comments)
About RPG
User Rating: / 8
Written by Chamara Withanachchi   

RPG is a programming language for business applications. Originally an initialism for Report Program Generator, it officially no longer stands for anything. Note that while the primary vendor of RPG has been and remains IBM, the language was available from other mainframe and microcomputer manufacturers, including Unisys. The latest incarnation of RPG is RPG IV (ILE RPG) on IBM's System i servers; it inherits the System i Integrated Language Environment’s features such as prototyped functions and procedures, static and dynamic binding, access to C routine libraries, dynamic link libraries, and fully recursive and re-entrant modular code.


Read more...
Do I have to keep this sample content?
User Rating: / 0
Written by Chamara Withanachchi   
No. This sample content appears because it was selected as an option during the installation process. The information contained in the site is intended to assist new users in learning the system and to help them get started using Mambo immediately. We have inserted the content using a variety of formats and options to help users get some idea of the choices available to them. You may delete any of this content without causing any problems to the site installation.
What is Static Content?
User Rating: / 0
Written by Chamara Withanachchi   
Static Content is simply a content item which is not part of a Section or a Category. Static Content cannot be added to a Blog, a Section or a Category. Static Content is, in other words, an independent, stand alone page. Static Content pages can be created, edited and deleted in the Static Content Manager. In the sample content you have installed with Mambo, the Main Menu choice "The Mambo License" shows an example of a Static Content page.
<< Start < Previous 61 62 63 Next > End >>

Results 621 - 626 of 626