> 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/iebgener/copying-between-sequential-datasets-and-pds-members-using-iebgener.md).

# Copying Between Sequential Datasets and PDS Members Using IEBGENER

**EXAMPLE 1:**

Copying a PDS Member to a Sequential Dataset using IEBGENER

```
//IEBGENER JOB (12345),CLASS=A, MSGCLASS=X,NOTIFY=&SYSUID 
//STEP1 EXEC PGM=IEBGENER 
//SYSUT1 DD DSN=T12345.FILE1.PDS(MEMBER1), DISP=SHR 
//SYSUT2 DD DSN=T12345.FILE2.PS, DISP=SHR 
//SYSPRINT DD SYSOUT=* 
//SYSOUT DD SYSOUT=* 
//SYSIN DD DUMMY
```

**Explanation:**

* **EXEC Statement:**
  * Executes the IEBGENER utility to copy data.
* **DD Statements:**

  * SYSUT1 DD:
    * DSN=T12345.FILE1.PDS(MEMBER1): Specifies the input file as a PDS member (MEMBER1) from the PDS dataset (T12345.FILE1.PDS).
  * SYSUT2 DD:
    * DSN=T12345.FILE2.PS: Specifies the output dataset as a sequential (PS) dataset (T12345.FILE2.PS).
  * SYSPRINT DD:
    * Directs messages and logs to the system output (SYSOUT=\*).
  * SYSOUT DD:

    * Directs general system output to standard system output (SYSOUT=\*).

  This program uses IEBGENER to copy a specific member (MEMBER1) from a partitioned dataset (T12345.FILE1.PDS) to a sequential dataset (T12345.FILE2.PS). It reads the content of the PDS member from SYSUT1 and writes it to the sequential dataset specified in SYSUT2

**EXAMPLE 2:**

Copying a Sequential Dataset to a PDS Member

```
//IEBGENER JOB (12345),CLASS=A, MSGCLASS=X,NOTIFY=&SYSUID 
//STEP1 EXEC PGM=IEBGENER 
//SYSUT1 DD DSN=T12345.FILE1.PS, DISP=SHR
//SYSUT2 DD DSN=T12345.FILE2.PDS(MEMBER1), DISP=SHR
//SYSPRINT DD SYSOUT=* 
//SYSOUT DD SYSOUT=* 
//SYSIN DD DUMMY
```

**Explanation:**

* **EXEC Statement:**
  * Executes the IEBGENER utility to copy data.
* **DD Statements:**

  * SYSUT1 DD:
    * DSN=T12345.FILE1.PS: Specifies the name of the input dataset (T12345.FILE1.PS), which is a sequential dataset (PS).
  * SYSUT2 DD:
    * DSN=T12345.FILE2.PDS(MEMBER1): Specifies the output location as a PDS member (MEMBER1) in the partitioned dataset (T12345.FILE2.PDS).
  * SYSPRINT DD:
    * Directs informational messages and logs to system output (SYSOUT=\*).
  * SYSOUT DD:

    * Handles general system output, also directed to the default system output (SYSOUT=\*)

  This program uses the IEBGENER utility to copy data from a sequential dataset (T12345.FILE1.PS) to a member (MEMBER1) of a partitioned dataset (T12345.FILE2.PDS). It reads the content from the sequential dataset specified in SYSUT1 and writes it into the specified PDS member in SYSUT2


---

# 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 current page URL with the `ask` query parameter:

```
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/iebgener/copying-between-sequential-datasets-and-pds-members-using-iebgener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
