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 first 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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close