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



QShell and PASE, IIRC, make different assumptions about CCSIDs - QShell is a shell in the IBM i context, hence, I think it assumes EBCDIC - PASE assumes ASCII

I think there might be an environment variable for CCSID in QShell - there is - export QIBM_CCSID=1208 works for me as the first command in a series of commands in a QShell command string - followed by && which says whether to continue or stop in event of error.

That environment variable had something to do with the CCSID used when working with a stream file and sed.

HTH
Vern

On 7/20/2016 2:58 PM, Buck Calabro wrote:
On 7/20/2016 1:40 PM, Fuchs, James M wrote:
Below is the contents of the file I am trying to process.
The Field separator is an asterisk....

Do I have to convert the incoming file from ASCII to EBIDIC or is there some what to force it to use ASCII encoding within the Qshell processing?

ISA*00* *00* *ZZ*10301 *ZZ*TN001988 *151204*1217*^*00501*000000001*0*P*:~
GS*FA*10301*TN001988*20151204*121752*1*X*005010X231A1~
ST*999*0001*005010X231A1~
AK1*HC*11723001*005010X223A2~
AK2*837*011723001*005010X223A2~
IK5*A~
AK9*A*1*1*1~
SE*6*0001~
GE*1*1~
IEA*1*000000001~
Thank you for this. I did some testing in PASE (call qp2term). I don't
know what vintage my AWK is. I had to do 2 things to this to get it to
run, and I don't really understand why.

1) In the AWK script, change the line endings to LF instead of CRLF
2) In the incoming file, remove the line endings entirely

call qp2term
$
awk -f awktest.awk awktest.txt awkout.txt
$
cat awkout.txt
Sender: . . . . . . . . . . 10301 Cahaba GBA
Receiver: . . . . . . . . . TN001988
Interchange Number: . . . . 000000001
Payer: . . . . . . . . . . . 10301
Process Date: . . . . . . . 12/04/2015
Process Time: . . . . . . . 12:17:52
Acknowledgement
Group Control Number: . . 1
----------------------------------------------
Acknowledging Functional Group
Control Number: . . . . . 11723001
Document Type: . . . . . 837

----------------------------------------------

Acknowledging Transaction
Set Control Number: . . . 011723001
Transaction Set Status: . . Accepted

Functional Group Status: . . Accepted
Number of Sets: . . . . . . Included 1 Received 1 Accepted 1

You may be able to use TR to fix up the line endings, and thus automate
the process without having to worry about the far side changing things.

tr < awktest.txt > awknoeol.txt -d '\r\n'



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.