> For the complete documentation index, see [llms.txt](https://open-mainframe-project.gitbook.io/mainframe-open-education-project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://open-mainframe-project.gitbook.io/mainframe-open-education-project/chapter-2-mainframe-101-foundational-technology/job-control-language-and-system-display-and-search-facility/utilities/iebcopy.md).

# IEBCOPY

* IEBCOPY is used to copy, merge, and compress Partitioned Datasets (PDS) or Partitioned Dataset Extended (PDSE).
* It is primarily used for copying members between PDS/PDSE datasets and for creating backups of partitioned datasets.
* IEBCOPY can copy an entire PDS/PDSE, selected members, or compress a PDS by removing unused space
* Lists the number of unused directory blocks for efficient dataset utilization.

**EXAMPLE:**

Copy from one PDS to another PDS

```
//IEBCOPY  JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1    EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*                         
//SYSUT1   DD DSN=T12345.SOURCE.PDS,DISP=SHR     
//SYSUT2   DD DSN=T12345.TARGET.PDS,DISP=SHR     
//SYSIN    DD *                                  
 COPY INDD=SYSUT1,
 OUTDD=SYSUT2                  
/*

```

#### Explanation:

**EXEC Statement**:\
Executes the IEBCOPY utility to copy members.

**DD Statement**:

* SYSUT1 DD:\
  Specifies the input PDS (T12345.SOURCE.PDS) that contains the members to be copied.
* SYSUT2 DD:\
  Specifies the output PDS (T12345.TARGET.PDS) where the members will be copied to.
* SYSPRINT DD:\
  Sends the copy operation log and messages to SYSOUT.
* SYSIN DD:\
  Contains control statements.\
  COPY INDD=SYSUT1,OUTDD=SYSUT2, tells IEBCOPY to copy all members from the input PDS to the output PDS

This **IEBCOPY** JCL program copies all members from one **Partitioned Dataset (PDS)** (T12345.SOURCE.PDS) to another **PDS** (T12345.TARGET.PDS).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://open-mainframe-project.gitbook.io/mainframe-open-education-project/chapter-2-mainframe-101-foundational-technology/job-control-language-and-system-display-and-search-facility/utilities/iebcopy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
