---
title: "Delimiters in COBOL, UNIX, JCL: How to Handle them"
description: "How to deal with delimiters in any record using COBOL, JCL and UNIX explained."
url: https://srinimf.com/2014/05/14/pipe-delimited-file/
date: 2014-05-14
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2014/05/delimiters-files.jpg?fit=1200%2C700&ssl=1
categories: ["JCL", "UNIX"]
tags: ["PIPE COBOL", "PIPE JCL", "PIPE symbol", "PIPE system", "PIPE UNIX"]
type: post
lang: en
---

# Delimiters in COBOL, UNIX, JCL: How to Handle them

PART-1: [How to](https://srinimf.com/2015/09/27/how-to-use-unix-files-in-mainframe-batch-job/) Work With Delimiter in COBOL

PIPE delimited file we can achieve through MVS record structure, See, the example below

```
01 INPUT_REC1
05 FIRST-ONE         PIC X(2)
05 SECOND-ONE        PIC X(2) VALUE "||"
.
.
.
```

The above way, we can construct a record. Similarly we can use UNSTRING in COBOL to delimit the PIPE symbol, and we will get sequential data set.

PART-2: How to Work With Delimiter in JCL

The second best example is we frequently use PIPE concept with SPLIT in DFSORT

```
//EXAMP JOB A400,PROGRAMMER
//RUNSORT EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=H
//SORTIN DD DSN=INPUT.PIPE,SUBSYS=PIPE,
//          DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760)
//OUT1   DD DSN=OUTPUT.PIPE1,SUBSYS=PIPE,
//          DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760)
//OUT2   DD DSN=OUTPUT.PIPE2,SUBSYS=PIPE,
//          DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760)
//SYSIN  DD *
  OPTION DYNALLOC,FILSZ=U1000000
  SORT FIELDS=(1,20,CH,A,25,4,BI,A)
  OUTFIL FNAMES=(OUT1,OUT2),SPLIT
/*
```

Here, SUBSYS=PIPE, will allocates input file into PIPE system.
OUTFIL FNAMES=(OUT1,OUT2),**SPLIT** ==> This command writes input file into two output files.

**PART-3:** How to Work With Delimiter in UNIX

** **The PIPE symbol will be used in UNIX, to separate each command in UNIX. Let us execute the batch job using BPXBTACH utility.

```
//STEPN  EXEC  PGM=BPXBTACH,PARM = ‘SH ls –a | tail +3 | nl'
//SYSOUT DD SYSOUT=*
```

Here, in the list of records, it filters the top three records and shows line numbers.

Related Posts

- [COBOL: All About Null-terminated Strings](https://srinimf.com/2016/01/29/apply-these-technics-to-handle-null-terminated-strings-in-cobol/)DateJanuary 29, 2016
- [Differences Between SYSOUT and SYSUDUMP in JCL](https://srinimf.com/2016/04/04/difference-between-sysout-and-sysudump-in-jcl/)DateApril 4, 2016
- [Internal Reader – COBOL and JCL](https://srinimf.com/2014/06/16/internal-reader-cobol-and-jcl/)DateJune 16, 2014

### 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%2F2014%2F05%2F14%2Fpipe-delimited-file%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2014%2F05%2Fdelimiters-files.jpg%3Ffit%3D1200%252C700%26ssl%3D1&description=Delimiters%20in%20COBOL%2C%20UNIX%2C%20JCL%3A%20How%20to%20Handle%20them)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2014/05/14/pipe-delimited-file/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2014/05/14/pipe-delimited-file/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2014/05/14/pipe-delimited-file/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2014/05/14/pipe-delimited-file/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Delimiters%20in%20COBOL%2C%20UNIX%2C%20JCL%3A%20How%20to%20Handle%20them&body=https%3A%2F%2Fsrinimf.com%2F2014%2F05%2F14%2Fpipe-delimited-file%2F&share=email)
-

### Like this:

Like Loading…
