How to convert an AS400 physical file to EXCEL using STRPCCMD

Posted on 2003-12-11
Last Modified: 2007-12-19
Is there a way to transfer a PF from the AS400 to an existing or new EXCEL spread sheet on my PC using CLIENT ACCESS and the STRPCCMD command...?

At the time I am using the STRPCCMD in a CLP to open an existing EXCEL spread sheet but I need it to be refreshed from the PF before every user access...  Thanks in advance...
Question by:gcasavantes
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1

Accepted Solution

dedy_djajapermana earned 84 total points
ID: 9926106
LVL 14

Assisted Solution

daveslater earned 83 total points
ID: 9927066
If you want it to run as part of the CLP you can
create a file transfer, using the properties tag to
Close when finished, Run automatically, omit display transfer completion mesasge
the transfer request extracts the as400 file and puts it on to the c drive. then launch excel to read the file

/* strta PC organiser */
/* download to user pc using previous request */
STRPCCMD PCCMD('Progra~1\IBM\Client~1\cwbtf.exe C:\tfr.TFR') PAUSE(*NO)  
/* Launch excel with downloaded file */
STRPCCMD PCCMD('C:\Progra~1\Micros~2\Office\excel.exe C:\file.XLS')


LVL 14

Expert Comment

ID: 9927118
instead of using the full path name I find it easier to create a short cut on to c:\
STRPCCMD PCCMD('C:\excel.lnk C:\TEMP\DB1.XLS') pause(*no)
and do the same with the transfer request
STRPCCMD PCCMD('C:\cwbtf.lnk C:\d1.tfr') pause(*no)

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 83 total points
ID: 9940842
If you have installed the total Client Access application, you can directly retrieve AS/400 files from your as/400 to excel with the excel "transfer data from AS/400 option"

This option you can find in excel by menu option "data" (you also see here the "to AS/400 transfer")
If it is not in the datamenu, you can look if the add-in is available by selecting in excel:
     => Tools => Add-ins => (select Client Access Data transfer and click OK)

If you choose now "data" and the transfer option, you can not only download the data, but also select the required fields and records by some SQL windows.


LVL 16

Expert Comment

by:theo kouwenhoven
ID: 10062977
Hi gcasavantes

The AS/400 has an standard command to create import files CPYTOIMPF, this will make a importfile the way you like Fixed or CSV quoted or non quoted etc.

Or download a free tool

Click this link
This is a free tool that will:
Extract the physical file data into an IFS directory as ".xls" file instead of ".csv". This is faster than CPYTOIMPF, plus the generated Excel file takes up lesser space in the IFS directory. This tool handles the new advance data type like Floating, Real, Double, VarChar, Integer, Small Integer and Big Integer. Use this tool in conjunction with Send Mail (SNDMAIL) utility and you can automate the data extraction and send the Excel attachment by email. If you desire to send the Excel file into your network drive, try using FTP File (FTPFILE) utility.

Have Fun

Expert Comment

ID: 10494095
CPYTOSTMF would get the data to a network drive and STRPCCMD could then be used to start up Excel on your PC and immediately access this file. This approach will give you the greatest control and takes advantage of the 32 bit drive support in OS/400. You will need to insert .csv formatting characters yourself.
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 10494332
Great thinking SuperCCA,

Thats tha same as the other 3 experts already have written

Expert Comment

ID: 10494424
Err, no it's not.
In some ways it is poorer solution for this specific problem as you must work harder yourself but it does give you greater possibiloities for a more generalised solution..

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ODBC Issues with Microsoft Access 2010 6 403
Free Form Definition specs 3 140
Iseries Object Security 5 97
iSeries Memory Utilization 2 104
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question