How to copy dataset between users

Posted on 2011-05-05
Medium Priority
Last Modified: 2012-05-11
I would like to copy a mainframe partitioned dataset from one user to another.  I know how to do this on unix, but IBM mainframes don't run unix, at least not for parititioned data sets.  
Question by:MainFrameDBA
  • 4
  • 2
LVL 57

Accepted Solution

giltjr earned 2000 total points
ID: 35706194
From batch JCL you can run a job using IEBCOPY.  If you have access to TSO/ISPF, there is a utility menu that will allow you to do this.

Do you want to copy the whole PDS or just selected members?

Is the target dataset brand new, or an exsisting one?

If existing, do you want to repalce any members that are have the same name?


Author Comment

ID: 35706546
I would like to copy the entire PDS to a new PDS and I have access to TSO/ISPF.  I tried using the clone command (which I learned about 5 minutes ago) but that came back with a permission error.  Yesterday I read about the xmit command but I don't know what to use for the node name:

xmit   node.userid dsn (dataSetName)          transmit a data set to a different user
receive                                                          receive the data set someone sent
LVL 57

Assisted Solution

giltjr earned 2000 total points
ID: 35707399
Well if you got permission denied then either you don't have read authority to the source PDS or you don't have authority to create the destination file.

Typically the node is your JES2 subsystem name.

Bewlow is sample IEBCOPY JCL that should do it.

1) You need to create and put a valid job card for your enviroment where I have "put valid jobcard here"
2) You need to put the real datatset name for the source pds where I have source.pds.name (please note it is in the job TWICE).
3) You need to put the real datatset name for the targe pds where I have target.pds.name

This does assume you have read authority to the source file and create authority (called ALTER in RACF) for the target.

// put valid jobcard  here                                        
//COPYPDS  EXEC PGM=IEBCOPY                                            
//SYSPRINT DD SYSOUT=*                                                
//SYSUT3   DD UNIT=SYSDA,SPACE=(CYL,(10,100))                          
//SYSUT4   DD UNIT=SYSDA,SPACE=(CYL,(10,100))                          
//INDD1    DD DISP=SHR,DSN=source.pds.name                            
//OUTDD1   DD DISP=(,CATLG),DSN=target.pds.name,                      
//            UNIT=SYSDA,LIKE=source.pds.name                        
//SYSIN  DD *                                                          
  COPY  INDD=INDD1,OUTDD=OUTDD1                                        
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.


Author Comment

ID: 35707701
Most likely I don't have read permission to access my colleague's files, I did get that permission error.

How can I determine the JES2 subsystem name?  I'm new to IBM.  
LVL 57

Assisted Solution

giltjr earned 2000 total points
ID: 35707882
Actually if you are sending the file to somebody within your own JES2 system you should not need to specify a node name.

However, somebody who has permission to read the file must issue the XMIT command.
LVL 57

Expert Comment

ID: 35723040
Thanks and welcome to the world of z/OS.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question