PIPE – Delimited File, SPLIT Using DFSORT, UNIX PIPE

PART-1:PIPE

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:

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:

 The PIPE symbol will be used in UNIX, to separate each commands in UNIX. Let us execute 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 top three records, and shows line numbers.


		
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.