Q

Working with the CPYTOIMPF command

In the CPYTOIMPF command, can the TOSTMF file name be &varible file name. I want the "to" file name to be the same...

as my "from" file name. But when I enter the command I provide the "from" file as &OUT from library &LSPDTA (actual name on iSeries is TAX1099M/MYLIB). The to file written as &OUT.

My guess is that you are putting quotes around your variable name. Here is an example CL program that may help.

 PGM                                                      
                                                         
DCL        VAR(&FNM) TYPE(*CHAR) LEN(10) VALUE('MYFILE') 
DCL        VAR(&TOSTMF) TYPE(*CHAR) LEN(30)                 
                                                         
CHGVAR     VAR(&TOSTMF) VALUE('MYDIR' *TCAT &FNM)               
                                                         
CPYTOIMPF  FROMFILE(&FNM) TOSTMF(&TOSTMF) +               
             STMFCODPAG(*PCASCII) RCDDLM(*CR)            
                                                         
ENDPGM  

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400.com Featured Topic: Managing your iSeries.


This was last published in October 2002

Dig Deeper on Performance

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close