× 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.



David

What I do is this,

I read 1024 bytes (note parameter 1 = fp which is the current position in
the file meaning, I read 1024 bytes from where I am).

I walk thru those 1024 bytes  in a loop like this;

C         EVAL IX        = IX + 1
C         EVAL CURCHAR   = %SUBST(Input: IX: 1)


Looking at each CURCHAR looking for a Carriage return, if it is, I write
out to my DB2 file a PF record (fixed record length, one field, character
data type.


C                   SELECT
C                   WHEN      CURCHAR    =  CR
C                   EVAL      DBField    =  LogicalRec
C                   WRITE     DBFormat
C                   EVAL      IX         =  *ZERO
C                   EVAL      LogicalRec =  *BLANKS

If not, I just add the CURCHAR to the DB2 field I am building.

C              EVAL      IX         =  IX  +  1
C                 EVAL      %Subst(LogicalRec: IX: 1) = CurChar

John Carr




-------------------------------------------
Would you have this in a Do-Loop, to read each 1024 blocks of data?
Say something like...

C                DOU          Whatever
C                EVAL      CHARSREAD     = read(fp: %addr(input): 1024)
C                   IF        CHARSREAD    <=  0
C                   LEAVE
C                   ENDIF
C                ENDDO

Would this be accurate?  Will the read() know to pull the next 1024 each
time?



David L. Mosley, Jr.



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.