ps
using
name 0
the file will be in
\qsys.lib\qgpl.lib\myfile.
Dave
Main Topics
Browse All TopicsHow do you download, Keeping the EBCDIC file format residing on the AS400, to a PC to be mailed to a client. The file needs to retain the EBCDIC format when downloading to place as an attachement to an email for a client. I tried using CPYTOPCD, but soon learned that this command relates to ASCII format only. Is there another way? My file resides in QGPL/OUTPUT in an AS400 environment. Please advise, Alex
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Alex:
Two common ways...
First, put the file into a savefile. The savefile is then downloaded as a binary file and uploaded the same way. A binary transfer is one where bit-pattern translations are not allowed by the file transfer protocols.
Second, use CPYTOIMPF...
==> cpytoimpf fromfile( mylib/myfile ) tostmf( /mydir/myfile.txt ) rcddlm( *CRLF ) dtafmt( *FIXED )
The CPYTOIMPF command has a parameter STMFCODPAG() that generally defaults to STMFCODPAG(*STMF). That is, it converts to the code page of the target streamfile. But if the streamfile doesn't exist, it ought to be created in the code page of the file you're copying and that will (probably) be an EBCDIC code page. If the streamfile does already exist, it should have been created in your EBCDIC code page by you at that time.
You might have better luck with CPYTOSTMF instead of CPYTOIMPF depending on your OS/400 version and other items.
Note that the data in the streamfile might not be easily readable on a PC and possibly not on another AS/400. It _might_ take some tweaking to get PC viewing to work and it might take other tweaking to get the data loaded properly into another EBCDIC system. This can be especially true after doing something like attempting to transfer such a file through e-mail rather than through a file transfer protocol. E-mail is generally assumed to be SMTP which _requires_ ASCII printable characters -- this can be overcome by proper use of MIME attachments, etc., which technically convert attachment bit-patterns into ASCII printable text when sending and back to original patterns when receiving.
Tom
Hi Alexhomar,
There is a third option, use filetransfer (easy to include in some pc .bat file) and click on the detail button
choose filetype 'No Conversion' and save/run it.
you can start this transfer on your PC, program name is cwbtf.exe
once the transfer script is created and saved (as a .DTF file)
you can run it in batch with program rtopsb.exe
Both programs can be found in the ClientAccess directory.
Regards,
Murph
Thanks Murrphey2, I have seen and used an older version of Client Access used with a batch file, but I didn't create it. I'll also try this method as well. I've been pulled into other projects at the moment but should return to give all these suggestions a try. I will get back to everyone hopefully in the next few days.
Thanks,
Alex
Thank you all for your suggestions. Tliotta's suggestions was the one I chosed to go with for the details and clarity given. But I must admit that my eyes were opened with the advent of using FTP and Client Access via DOS Batch. These will come in handy with future projects being discussed in future meetings.
Thanks again for sharing me.
Alex
Business Accounts
Answer for Membership
by: daveslaterPosted on 2005-08-09 at 14:52:41ID: 14637304
Hi
you can use FTP using the BIN option. This create a binary image so will be in EBCDIC
Dave