Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PF to Excel

Status
Not open for further replies.

Pekka

Technical User
Mar 19, 2002
107
FI
Hi there,
i'm trying to make a rpg program which should produce an excel file in iSeries ifs folder. I'm quite sure i have to use the CPYTOSTMF command, but does anybody know where I could fine information how to create the excel spreadsheet body information?
 
CPYTOIMPF also does this and allows field separators and delimiters. If you specify commas as field delimiters and double quotes for text, you can dump it all into a comma-separated flat file which can be opened automatically as an Excel spreadsheet from Windows Explorer just by double clicking it. This just dumps the raw data so if you want to be smart and add titles and columns you need to call an RPG program first which can write records to the flat file with the text which is needed. When you use CPYTOIMPF you then specify MBROPT(*ADD) to add the data after the headings.

If you use a search engine and just look for CPYTOIMPF you get an amazing number of hits with good examples.

PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
Hey, thank you. Sounds good. That's a good hint. More and more people avoid papersheet and prefer spreadsheet. This could be a good method to distribute quite complex rpg report's output to PC-format and if you can be sure that user doesn't have to convert in excel-session anything, that's excellent!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top