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



PGM
DCL VAR(&X0D) TYPE(*CHAR) LEN(1) VALUE(X'0D')
DCL VAR(&X25) TYPE(*CHAR) LEN(1) VALUE(X'25')
DCL VAR(&SEDCMD) TYPE(*CHAR) LEN(100)
CHGVAR VAR(&SEDCMD) VALUE('sed +
"s%[\][.]br[\]%\'||&x0D||'\'||&X25||'%g" +
/joe/temp/in.hl7 > /joe/temp/out.hl7')

QSH CMD(&SEDCMD)
ENDPGM

This replaces \.br\ with a crlf.

This essentially would have been my solution, except that I would not have
defined &X0A and &X0D. Instead, I'd define &CRLF as len(2) with value
X'0A0D'.

However, when I use this against a live file I have a problem. The
live
file contains stand alone cr (x'0d') as line delimiters. For some
reason,
the existing x'0d' characters get removed.

Line separator of X'0D'... where have I seen that before? MAC, maybe? How
to you get this file? If via FTP and if BIN mode has been selected, is it
possible to change to ASCII mode instead, to solve this? If the file comes
another way, who controls its format?

So are you saying that sed sees this all as one line now? That could be an
issue. I'll be more able to play with this when I arrive home. First thing
I will try is the GNU binaries for sed et al. If you want to shortcut this
(I have about 90 minute commute) you can find those for installation into
PASE at

http://www-1.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilit
ies.html

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
The best way to save face is to keep the lower part full




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.