Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Selecting certain specific records from a mainframe dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
am

New User


Joined: 25 May 2005
Posts: 1

PostPosted: Wed May 25, 2005 9:06 am    Post subject: Selecting certain specific records from a mainframe dataset
Reply with quote

I have to select certain records from a dataset with a certain field #= 'X'. Would it be better to write an Easytrieve or a JCL to do this? I would need help on the code to get started. Thank you in advance.
Back to top
View user's profile Send private message

Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed May 25, 2005 2:15 pm    Post subject:
Reply with quote

JCL can do this easily using sort utility

OUTFIL FNAMES=FILE1,INCLUDE=(6,1,CH,EQ,C'X')

all the records with charater 'X' in position 6 will be copied to File1.

likewise u can specify many conditions.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 25, 2005 9:23 pm    Post subject:
Reply with quote

am,

You don't need to use OUTFIL INCLUDE to do this. You can just use an INCLUDE statement. An INCLUDE statement is generally more efficient than an OUTFIL INCLUDE statement. Here's the DFSORT job:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
   INCLUDE COND=(p,1,CH,EQ,C'X')
/*


where p is the position of the field you want to check.

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Where to get sample for processing RM... vice_versa PL/I & Assembler 2 Tue Jan 16, 2018 2:03 pm
No new posts VSAM dataset not found abdulrafi JCL & VSAM 5 Fri Jan 12, 2018 11:19 am
No new posts Copy Specific Groups V S Amarendra Reddy SYNCSORT 10 Thu Jan 11, 2018 1:16 am
No new posts How to change the logon screen info o... sakthikumarT TSO/ISPF 4 Fri Dec 29, 2017 6:44 pm
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us