Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Transfering files form AS400 to PC in batch mode. (cwbcfg?)

297 views
Skip to first unread message

chad.t...@gmail.com

unread,
Apr 1, 2005, 11:52:26 AM4/1/05
to
I am running a series of VBA/VB scripts using excel to convert AS400
spool files to pretty looking PDF stuff when I am not here at work.
The Visual Basic Script was written to loggin to the AS400 by using
cwbcfg and then calling an intance of Client access file transfer from
AS400 to PC. This would run on my PC at night via the task scheduler.


I works like this:

1. Windows task scheduler invokes my VB script.
2. VB script launches a .bat file that sets permissions using the
CWBCFG command
3. VB script opens presaved file transfer from AS400 to the PC via
client access.
4. VB script opens excel
5. Excel has Vb scipt in it to manipulate the data and make it "pretty"
6. Excel prints the file in pdf.
7. VB scipt moves the pdf file to our intranet.
8. program is complete.

Now for what ever reason the data file transfer is not happening. I
have tried like mad to use different combinations of the cwbcfg command
and settings to get this to work only to come up empty handed.

Anybody have any idea on how to make this work again?

Thanks!

Chad

Drew Dekreon

unread,
Apr 1, 2005, 2:27:24 PM4/1/05
to
use rfrompcb to retrieve the files, not cwbcfg.
You could also put an ftp server on the pc (cerberus is free and very
good) and have the as400 put the files down onto the pc

chad.t...@gmail.com

unread,
Apr 1, 2005, 2:53:56 PM4/1/05
to
I think I got you mixed up. I am trying to tranfer a data file from
the 400 to the PC not the other way around. The PC does all the work
but gets its initial data from the 400.

Thanks!

Chad

chad.t...@gmail.com

unread,
Apr 1, 2005, 3:17:11 PM4/1/05
to
I found a much better way to do it. I am using the cpytopc command to
stick the file to a shared IFS folder. I will write a short CL program
and put the program in my as400 scheduler to make it happen
automically. Then my script can grab that file and use it.

Drew Dekreon

unread,
Apr 4, 2005, 1:37:22 PM4/4/05
to
then use RTOPCB

Charles Wilt

unread,
Apr 15, 2005, 2:30:57 PM4/15/05
to
In article <1112386631....@g14g2000cwa.googlegroups.com>,
chad.t...@gmail.com says...

That's a very bad way to do it.

CPYTOPCD copies to the /QDLS file system which was originally designed
for Office Vision and DOS connectivity. It's use is not recommend no-a-
days due to pore performance and limitations.

Instead, use the CPYTOSTMF command to copy to one of the more modern
file systems, root or QOpenSys. You could even use the /QNTC file
system to place the file directly on a PC's network share.

If you use root or QOpenSys, use iSeries Netserver to create a Windows
compatible share the PC will be able to access.

HTH,
Charles

Angus

unread,
Apr 16, 2005, 4:51:37 AM4/16/05
to

I suggest you also look at CPYTOIMPF as an alternative to CPYTOSTMF
using the other suggestions made by Charles.

Angus

chad.t...@gmail.com

unread,
Apr 26, 2005, 10:25:48 AM4/26/05
to
The data file I am trying to tranfer is a file produced from AS400
Query.

I tried CPYTOPCD and it worked sort of, but it fubared some of my
fileds. In other words it took the data file produced by the query and
put a bunch of goobly gook into the last three fields when viewing the
query file AS a text file on the PC.

So I tried the CPYTOSTMF and I get the following error:

Message . . . . : Object is not a file or is a file with attributes
not
supported by this command.

Cause . . . . . : Object
/qsys.lib/scott.lib/prbktest.file/prbktest.mbr must
be either a source physical file that has three fields or a program

described file. Externally described files and source physical files

containing fewer or more than three fields are not permitted by this

command.

Recovery . . . : Specify the name of an existing source physical
file with
correct attributes, or specify a program described file, then try
the
command again.

So I tried the CPYTOIMPF:

Why do I want to copy frome one data base to another database file and
then to a streaming file? I left out the second database file name and
it won't work either. Then I tried putting in a name as I assume this
is just a "temp" file and got the error:

STMFCODPAG not valid when output file is a database file. This was
becasuse I put PCASCII or STDASCII in that field. If I leave the
default it work but it copies a bunch of crap to the pc text file which
I assume is the PCs attempt to read an ebcidic file.

Can you all please provide me a bit more help. I never realized that
copying a file from AS400 to PC would be such a pain in the butt. Is
there any resources I can use to better educate myself about stuff of
this nature? I know the basics of the AS400 but am more of a Microsoft
person. I just hate feeling like a moran and when ever thing get rough
with the 400 I feel like moran.

Any help you all can provide would much appreciated.


0 new messages