---
title: "Mainframe tip to cut first 10 lines, last 10 lines from 10000 lines dataset"
description: "Command to cut first 10 lines and last 10 lines in Mainframe"
url: https://srinimf.com/2015/08/23/mainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset/
date: 2015-08-23
modified: 2026-10-10
author: "Srini"
categories: ["ISPF"]
tags: ["Cut first 10 and last 10 lines mainframe", "Mainframe tips"]
type: post
lang: en
---

# Mainframe tip to cut first 10 lines, last 10 lines from 10000 lines dataset

I have a dataset with 10,000 lines. I want to cut the first 10 lines and last 10 lines and paste into another dataset.

Related[Linux egrep Vs. fgrep: Top Differences](https://srinimf.com/2023/01/14/linux-egrep-vs-fgrep-top-differences/)

Related[Mainframe Vs Unix Top Differences](https://srinimf.com/2015/11/11/unix-and-mainframe-basic-differences/)

Related[ISPF Find Commands](https://srinimf.com/2012/04/21/ispf-find-commands/)

Related[How to Convert SQL Error into Text](https://srinimf.com/2016/03/07/how-to-convert-sql-error-code-into-text-message-dsntiar/)

Related[QMF: EXPORT Report to Dataset](https://srinimf.com/2010/09/04/qmf-export-report-to-dataset/)

When I cut the first 10 lines and then again the last 10 lines, only the last 10 lines are pasted into the new dataset.

Related[What is Multitasking in Python and How it Supports](https://srinimf.com/2022/10/03/what-is-multitasking-in-python-and-how-it-supports/)

Is there any way out other than doing a cut & paste twice?

The answer for the above question is YES:

1. First cut 10 lines, and then issue CUT APPEND
2. Then cut last 10 lines, and then issue CUT APPEND
3. When you PASTE it, you get both

Related Posts

- [Mainframe ISPF Commands(2 Of 5)](https://srinimf.com/2015/05/14/ispf-commands-for-senior-software-developers-2-of-5/)DateMay 14, 2015
- [Mainframe Vs Unix Top Differences](https://srinimf.com/2015/11/11/unix-and-mainframe-basic-differences/)DateNovember 11, 2015
- [ISPF Daily Use Commands a Quick Guide](https://srinimf.com/2017/07/18/ispf-daily-use-commands-a-quick-guide/)DateJuly 18, 2017

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F08%2F23%2Fmainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2026%2F02%2Fcropped-logo.png%3Ffit%3D96%252C96%26ssl%3D1&description=Mainframe%20tip%20to%20cut%20first%2010%20lines%2C%20last%2010%20lines%20from%2010000%20lines%20dataset)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/08/23/mainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/08/23/mainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/08/23/mainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/08/23/mainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Mainframe%20tip%20to%20cut%20first%2010%20lines%2C%20last%2010%20lines%20from%2010000%20lines%20dataset&body=https%3A%2F%2Fsrinimf.com%2F2015%2F08%2F23%2Fmainframe-tip-to-cut-first-10-lines-last-10-lines-from-10000-lines-dataset%2F&share=email)
-

### Like this:

Like Loading…
