IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selecting certain specific records from a mainframe dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed May 25, 2005 2:15 pm
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 Developer


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

PostPosted: Wed May 25, 2005 9:23 pm
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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top