|
christopher sagayam wrote:
> in rpg programming
>
> 2.how are indicators U0-U9,MR used.
I have had only one occasion to use external indicators (U1, U2..) my need
was for my RPGIV program to decide which of two files to process, based on
job description.
First set the job switch in the CL (or retrieve it from the job
description.) Example.
IF (&COND1 *EQ 'Y') DO
CHGJOB SWS(01000000) /* INU1 = *OFF and
*INU2 = *ON */
ENDDO
ELSE DO
CHGJOB SWS(10000000) /*INU1 = *ON and *INU2
= *OFF */
ENDDO
Then condition an F spec in your RPG on the external indicator
FFILE1 UP E K DISK EXTIND(*INU1)
FFILE2 US E K DISK EXTIND(*INU2)
In the above example, if the value of the job switch were (10000000) the
File1 would be processed primary, and file2 not processed at all.
In the above example, if the value of the job switch were (01000000) File1
would not be processed and File2 would be processed "primary".
etc....
As for matching record indicators (M1, M2, ...) I have only used them once as
well. My requirements were to process a program described flat file in which
there were several detail records to a single master record. Note, I am
using EXCEPTs here when it would probably be more appropriate in keeping with
the "dinosaur theme of matching records", to rely on the fixed logic cycle
for output.
FMASTER IP F 80 DISK
FDETAIL IS F 80 DISK
FQPRINT O F 132 PRINTER OFLIND(*INOF)
IMASTER NS 01
I 1 3
KEY1 M1
I 4 80 TEXT1
IDETAIL NS 02
I 1 3
KEY2 M1
I 4 80 TEXT2
*
C IF *INOF = *ON
C EXCEPT PAGEBRK
C EVAL *INOF = *OFF
C ENDIF
C EXCEPT RPTLINE
*
OQPRINT E PAGEBRK 1
O 50 ' '
O E RPTLINE 1
O 01 TEXT1 100
O 02 TEXT2 125
The above would bring in the master record, print the record and then process
all of the detail records whose key matched the master, then get the next
master etc.......
>
>
> 3.is there any way i can try out RPG programs using internet ie
> downloading or etc.
>
The sponsor of this list is certainly a good source.
> 4.can a subfile be used to access data from different physical files if
> so how can an update pgm work on different physical files.
I have never tried to use external indicators on subfiles, but seems
plausible to me.
Doug Griffin
Artco
Rexburg, Idaho
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List! To submit a new *
* message, send your mail to "RPG400-L@midrange.com". To unsubscribe *
* from this list send email to MAJORDOMO@midrange.com and specify *
* 'unsubscribe RPG400-L' in the body of your message. Questions should *
* be directed to the list owner / operator: david@midrange.com *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.