Question

  Asked: Jun 10 2008   5:39 PM GMT
  Asked by: AS400 - Ask the Expert


Automated file transfer from AS400 to Word?


AS/400, Spool files, Microsoft Excel, RPG IV, Microsoft Word, Word

A search400.com reader wrote in with this question:

I need to take a spool file (say a Collection Letter) generated from RPGIV. I can copy this spool file to a physical file if needed.
I want to automatically import or send this file to Microsoft Word for editing purposes.
I have used the 'ADD-INs' for Excel to bring data from the AS400 into Excel. Is there something like that for Word? Also, I cannot remember the command for accessing a PC program from the 400.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



Hi,

you may do another way.
Create a model file in word (.DOT file) with the fixed text.

Export the variable part of your data into a file that will be available for Excel PC importation using Excel ADD-in of better, integrated SQL.

Now modify your .DOT file for mail merge using the created Excel file from I5 data.

And you'll get probably what you want. (I hope).

To my knowledge, there is no add-in in Word to include data from AS400. This is probably due to the fact that Word is not a tool to handle data.

To initiate a pc command from I5 platform, just use STRPCCMD command.

Bye.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400 and Microsoft Windows.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Bigmac46  |   Jun 12 2008  2:28PM GMT

Don’t know for sure if this is exactly what you are looking for but it works,
The file is created through another job stream and user is notified it is ready. User then runs this to download file and open it with word as soon as it it done. the transfer need to be set to run transfer request automatically to prevent having to run and close it .Then it just works but it must be done interactive.
It is possible this could be improved on but it is working so we leave it alone.

PGM
DCL VAR(&STRCMD) TYPE(*CHAR) LEN(55) +
VALUE('C:\DOWNLOAD\TESTWORD.DTF')
DCL VAR(&PCCMD) TYPE(*CHAR) LEN(55)
STRPCO PCTA(*NO)
MONMSG MSGID(IWS4010)
STRPCCMD PCCMD(&STRCMD) PAUSE(*NO)
CRTDTAARA DTAARA(QTEMP/STRPCO) TYPE(*CHAR) LEN(1) +
TEXT('START PCO DATA ARE')
MONMSG CPF0000
STRPCO PCTA(*NO)
MONMSG MSGID(IWS4010)
STRPCCMD PCCMD('START C:/DOWNLOAD/TESTWORD.DOC') +
PAUSE(*NO)
ENDIT: ENDPGM