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



Alan -

My guess (since I recently encountered a similar issue) is that the IFS file data you are processing originated on a Unix system and has only <LF> ( ASCII/UT8 X'0A' ) as a record delimiter, instead of having <CR><LF> ( ASCII/ UTF8 X'0D0A').

-sjl

"Alan Shore" wrote in message news:AF3AC0390F0EAE4EA2A8581127894EF0012333949D@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.Global...

Hi everyone
Before I forget - we are on V5r4
Hopefully I can explain my predicament

We have a file on the AS/400, that has been created from a file on the ifs using the following command
CPYFRMSTMF FROMSTMF('/ifsdirectory/filename.xxx') +
TOMBR('/QSYS.LIB/LIBRARY.LIB/DATAFILE.FILE/+
filembr.MBR') MBROPT(*REPLACE) +
ENDLINFMT(*CRLF)

However - sometimes the data in the file contains line feed (X'25') in numerous places and creates havoc further down the suite of programs

I have found the following sql script that works

update library/datafile
set field = translate(field, X'40', X'25')
WHERE field like '%' || X'25' || '%'

This is good - but I want to go further
We have a file called BADHEXCHR that contains 2 fields
BHCCHAR (Bad Hex Character)
BHCREPL (Replacement Character)

This contains numerous records like
Record# BHCCHAR BHCREPL
90 Å A
91 Ç C
92 Ñ N
164 ¦
93 ø o
94 É E
95 Ê E
96 Ë E
97 È E
98 Í I
99 Î I
100 Ï I
101 Ì I
102 Ø O
103 « <
Including X'25' to X'40'
Its used in a procedure that is called in numerous RPG programs
The question I have is
Is there anyway to change the SQL from
update library/datafile
set field = translate(field, X'40', X'25')
WHERE field like '%' || X'25' || '%'

To use this file so that any character in the string that is equal to BHCCHAR is replaced with BHCREPL

I am getting nowhere fast (actually not so fast) and any help/pointers would be MUCH appreciated


Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


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.