sort

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
yuvav
Member
Posts: 8
Joined: Wed Jun 23, 2010 10:46 am

sort

Post by yuvav » Thu Jul 22, 2010 1:18 pm

hi ,

i want to extract a specific portion in my input file, it has only one rec, the particular field which i want is in 100 th position, i want those 10 char alone in another file not other field. what sort card i can use???

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Jul 22, 2010 3:12 pm

Probably you can do it with a SORT applcation but you should give many more details:

1. What is LRECL of input/output?
2. What is RECFM of input/output?
3. Please show some sample input and the expected output from that.
Regards,
Anuj

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Jul 22, 2010 10:00 pm

yuvav,

Assuming the input file has RECFM=FB and you want to extract positions 100-109, you could use a DFSORT job like this:

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION COPY
  INREC BUILD=(100,10)
/*
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
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

yuvav
Member
Posts: 8
Joined: Wed Jun 23, 2010 10:46 am

Post by yuvav » Fri Jul 23, 2010 2:47 pm

Hi,
Thank you, i got it....

Post Reply

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



Other References
Mainframe Tools and others