iSeries Bath SFTP CL Program Problem

I'm trying to help my co-worker resolve the following issue: We have a CL Program that generates a batch input file containing SFTP commands. The process works fine for our HQ iSeries; however, we have 21 independently operated iSeries where the SFTP commands appear as EBCDIC encoded characters: Ã @  ¢`  £¢¢` ¥`â     Æ     aÄæaãÖmÄÄâ%`

IBM suggests that the input file must be created using an ACSII text editor, but that's not possible in this case because the CL Program creates the input file on-the-fly. See IBM Reference: https://www-304.ibm.com/support/docview.wss?uid=nas8N1014104

Is there setting that we can check on the iSeires or a command line parameter that can be added to the CL program?

Our CL Program basically runs a shell script that echos out the commands that creates the SFTP batch input file. See sample:
echo Cd abc-dir-$1-SharedFolder/DIR/PATH > /QOpenSys/download/sftpbatch.txt
echo -rm $2.mbr >>  /QOpenSys/download/dwbatch.txt
echo put /qsys.lib/somelib.lib/$2.file/$2.mbr >>  /QOpenSys/download/sftpbatch.txt
echo quit >>  /QOpenSys/download/sftpbatch.txt

Open in new window

LVL 8
LajuanTaylorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
This is almost certainly a CCSID issue.  It often happens when the CCSID of the stream file doesn't match the encoding.  For example if you create a stream file with the CCSID attibute of 37 (EBCDIC), but put CCSID 815 (ASCII) data in the file.

QSH is very friendly - it tries to dynamically convert CCSIDs for you.  If you mislead it about the CCSID of a file, it will do ugly things like this.

Look at the attributes of the file that you are creating.  What is the CCSID that shows?

Then look at the data in the file using EDTF, for example.  IF you have a bad CCSID on the file, EDTF will typically throw a message when you open the file.  

Also, what is the QCCSID system value on the HQ box vs one of the remote systems?
0
LajuanTaylorAuthor Commented:
Thank You Gary.

Please see the attached screen shot. Could this be our issue?
2015-08-05-1240-Settings.png
0
Gary PattersonVP Technology / Senior Consultant Commented:
Likely.  

If you're using qshell, you can use "touch" command to create an IFS file with a specific CCSID:

touch -C 1252 /QOpenSys/download/dwbatch.txt

PASE touch command (AIX version) doesn't support the -C option.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Gary PattersonVP Technology / Senior Consultant Commented:
In general, when PASE creates a stream file, it defaults to ASCII (CCSID 819 on a US localized machine).  Most PASE utilities assume everything is ASCII and do not perform automatic CCSID conversion.

Qshell defaults to the CCSID associated with the job.  Unlike PASE, Qshell is CCSID-aware and Qshell utilities typically perform automatic CCSID conversion.

In general, use qshell when calling back and forth from CL - that way you get the benefit of automatic CCSID conversion.
1
LajuanTaylorAuthor Commented:
Thank You Gary.

We solved the problem by using the touch command in our CL Program that we use to create the input file. We confirmed that the CCSID was 1252 and that the SFTP commands were written to input file correctly.

Regards,

LaJuan
0
Gary PattersonVP Technology / Senior Consultant Commented:
Happy to help.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.