× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We do not use LIKEFILE, we use a combination of an Externally described
data structure, LIKEDS and LIKEREC. I have used this instead of prefix
to read into a data structure.
// Time Batch record layouts
D UNTMB4410T DS LIKEREC(PR14410T:*INPUT)
D TMB E DS EXTNAME(PRP4410T) QUALIFIED INZ
D TMBREC LIKEDS(UNTMB4410T) OVERLAY(TMB)
// Read time batch file
READ(N) PRP4410T TMB;


We also create methods for file access and pass the record through a
data structure. Here is an example.

Prototype
UIC4700PR
// Define field reference file
/IF NOT DEFINED(ICP0000)
/DEFINE ICP0000
D E DS EXTNAME(ICP0000) PREFIX(IC_)
D BASED(pICFLDREF)
/ENDIF
// Pull Request Master record layout
/IF NOT DEFINED(PRQREC)
/DEFINE PRQREC
D PRQREC E DS EXTNAME(ICP4700) QUALIFIED
/ENDIF
// Pull Request Master record layout
/IF NOT DEFINED(PRQ)
/DEFINE PRQ
D PRQ DS LIKEDS(PRQREC) INZ
/ENDIF
// Setll to Pull Request - Pull Line ID
D IC4700SL PR
D POSITIONERR LIKE(IC_ERROR)
D EQUALERR LIKE(IC_ERROR)
D PLLNIDX LIKE(IC_PLLNID) CONST
D OPTIONS(*NOPASS)
// Read(e) Pull Request - Pull Line ID
D IC4700RD PR
D PRQ LIKEDS(PRQREC)
D EOFERR LIKE(IC_ERROR)
D PLLNIDX LIKE(IC_PLLNID) CONST
D OPTIONS(*NOPASS)

RPG
FICL4700 IF E K DISK RENAME(ICP4700:ICL4700L)
/COPY ICPSRC,UIC4700PR
D UNPRQ4700 DS LIKEREC(ICL4700L:*INPUT)
// Read(e) Pull Request - Pull Line ID
P IC4700RD B EXPORT
D IC4700RD PI
D PRQ LIKEDS(PRQREC)
D EOFERR LIKE(IC_ERROR)
D PLLNIDX LIKE(IC_PLLNID) CONST
D OPTIONS(*NOPASS)
/FREE
// Set end of file error off
EOFERR = *OFF;
// Select based on number of parameters
SELECT;
// When no key was provided - 2 parameters
WHEN %PARMS = 2;
// Read next Pull Request record
READ(N) ICL4700 UNPRQ4700;
// When Pull Line ID was provided - 3 parms
WHEN %PARMS = 3;
// Reade next Pull Request record - Pull Line ID
READE(N) (PLLNIDX) ICL4700 UNPRQ4700;
// Other - unexpected number of parameters
OTHER;
// Set end of file error on
EOFERR = *ON;
// End Select
ENDSL;
// If end of file error is off
IF EOFERR = *OFF;
// If record was found
IF NOT %EOF(ICL4700);
// Initialize parameter with Pull Request record
PRQ = UNPRQ4700;
// Else
ELSE;
// Set EOF error indicator on
EOFERR = *ON;
// Endif
ENDIF;
// Return
RETURN;
/END-FREE
P IC4700RD E


Scott Feddersen
Buckle, Inc.
PO Box 1480
Kearney, NE 68848

(308) 236-4456
scott.feddersen@xxxxxxxxxx

CONFIDENTIAL COMMUNICATION: This e-mail message and any attachments are
for the sole use of the intended recipient(s) and may contain
confidential and/or privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message and any attachments. Thank
you.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.