Sort card to filter one record
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 10
- Joined: Thu Jul 30, 2009 8:11 pm
- Location: Bangalore
Sort card to filter one record
Hi i need to split one file into two. first record in one file and the rest in second file. there is no key. i know how to do this in two steps but i want to make it in one step. please help me.
-
- Member
- Posts: 10
- Joined: Thu Jul 30, 2009 8:11 pm
- Location: Bangalore
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use a DFSORT job like the following to do what you asked for:
Alternatively, you can use a DFSORT/ICETOOL job like this:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file with record 1
//OUT2 DD DSN=... output file with records 2-n
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,ENDREC=1
OUTFIL FNAMES=OUT2,STARTREC=2
/*
Code: Select all
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT1 DD DSN=... output file with record 1
//OUT2 DD DSN=... output file with records 2-n
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT1) DISCARD(OUT2) INPUT FIRST KEEP
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page