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



Jorge,

You mentioned cpyfrmstmf.
What is the CCSID of the file in the IFS - (wrklnk and opt 8 to display attributes - 819 might be a normal value.)
Have you looked at the records in IFS in hex - the wrklnk display option?
In ascii, if viewing in IFS, CR LF it's 0D and 0A (US).

Hopefully you have a reliable end of record character(s)? If not 0D0A - give us what you got.
If not same in each record, that's a data problem.

In rpgle - a prev post mentioned Scott Klement's great tutorial and samples,
when you read the data in, it will be in ebcdic so carriage return (CR) is
x'0D' and line feed(LF) is x'25' ( or together crlf = x'0D25'), so you can scan for the end of line character(s) to know where your data stops.
Variable length csv (comma separated variable or some other separator character like pipe symbol) files are pretty common.

Jim Franz

----- Original Message ----- From: <jmoreno@xxxxxxxxxxxxxxxx>
To: <Midrange-l@xxxxxxxxxxxx>
Sent: Monday, November 07, 2011 5:09 PM
Subject: Read/Write records from/to IFS of variable length nature in a reliablemanner


Hello everyone

I have this question and I have been struggling with this most of the day.


Is there a way to Read IFS files containing variable record length
records?

The CPYFRMSTMF is not behaving well against a flat file that has a
variable length min (2000) and max (6736)
Using the CPYFRMSTMF interface and everyone of the EndOfLine formats has
not allowed me to map the file correctly

I have used a simple RPGLE program to read the IFS file, but the data
BUFFER length that I used to get to the data was 10,000
and I could not get a reliable control character for the break ( *CR, *LF,
*CRLF, *LFCR, *ALL ...)

It should not have to be hard at all. You get an IFS file with or without
variable length records and we should be able to map that to a flat
database file.
If the file does not exist, ... why not create it! ... (whishing for
much!)

Any recommendations?.

Regards


Jorge Moreno
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.