Write your own CPYF command that excludes the TOFILE() parameter then restrict access to the IBM-supplied command.
Compile your CPYF command's CPP to be owned by a profile authorized to use IBM'S CPYF command.  This CPP will execute IBM's CPP.
You can web search for the RTVCMDSRC command to reverse engineer IBM's CPYF command.
HTH.
Gary 
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of fbocch2595@xxxxxxx
Sent: Tuesday, August 28, 2012 1:37 PM
To: midrange-l@xxxxxxxxxxxx
Subject: CPYF coding question
Hi Folks, as part of a command we allow programmers to use that copies files from one i to another I'd like to change it up so that the library on the TOFILE can not be changed but the file can be changed.  I'm not sure how that's done since TOFILE includes the file along with the library.  So, if midrange nation can tell me how it's done and/or gimme some code, I'd appreciate it. 
Thanks, Frank  
 From file  . . . . . . . . . . . FROMFILE                                      
   Library  . . . . . . . . . . .                  *LIBL                        
 To file  . . . . . . . . . . . . TOFILE                                        
   Library  . . . . . . . . . . .                  *LIBL                        
 From member  . . . . . . . . . . FROMMBR        *FIRST                         
 To member or label . . . . . . . TOMBR          *FIRST                         
 Replace or add records . . . . . MBROPT         *NONE                          
 Create file  . . . . . . . . . . CRTFILE        *NO                            
 Print format . . . . . . . . . . OUTFMT         *CHAR                          
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: 
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at 
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.