Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To have OMITTED records in file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
atik

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Fri Jul 29, 2005 2:43 pm    Post subject: To have OMITTED records in file
Reply with quote

I want to use SORT utility and OMIT some records depending on the condition and have those omitted records in one sequential file for usage in the future. Normally if we omit records, is there any method to have those records in a file. In what way we can do this?
Back to top
View user's profile Send private message

raghavendraun

New User


Joined: 29 Apr 2005
Posts: 9

PostPosted: Fri Jul 29, 2005 3:41 pm    Post subject: Re: To have OMITTED records in file
Reply with quote

Hi atik,

I think u can achive ur objective in two steps. In First step get only omitted records in one file, In Second step output file with some records omitted.

//STEP10 EXEC PGM=SORT
//SORTIN DD DSN=YOUR INPUT FILE,DISP=SHR
//SORTOUT DD DSN=OUTPUT FILE CONTAINING ONLY OMITTED RECs
//SYSIN DD *
INCLUDE COND=()
/*
//STEP20 EXEC PGM=SORT
//SORTIN DD DSN=YOUR INPUT FILE,DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE WITH SOME RECs OMITTED
//SYSIN DD *
OMIT COND=()
/*

Is there any other methods, options or any errors in the above JCL guys please suggest.

Thanks,
Raghavendra U N
Back to top
View user's profile Send private message
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Fri Jul 29, 2005 3:47 pm    Post subject: Re: To have OMITTED records in file
Reply with quote

Add one more sort step with INCLUDE cond....for those OMITed fields..as U cant in same SORT step...

INCLUDE & OMIT are mutually exclusive
Back to top
View user's profile Send private message
raghavendraun

New User


Joined: 29 Apr 2005
Posts: 9

PostPosted: Fri Jul 29, 2005 5:45 pm    Post subject: Re: To have OMITTED records in file
Reply with quote

Hi shivashunmugam,

As you mentioned is correct, we can get the OMITed records by mentioning INCLUDE in both steps but, if for example u r giving
Condition as 'EQ' in first step just replace 'EQ' as 'NE' in second.
Here is another example Which will give me the same result using only single Step.
If u r using INCLUDE for file 2 as well use reverse logic, which is used for file 1.

Code:

//STEP10 EXEC PGM=SORT
//SORTIN DD DSN=YOUR INPUT FILE,DISP=SHR
//SORTOF1 DD DSN=OUTPUT FILE CONTAINING ONLY OMITTED RECs
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=WORK,SPACE=(TRK,(100,10),RLSE),
//           DCB=*.STEP10.SORTIN
//SORTOF2 DD DSN=OUTPUT FILE CONTAINING ONLY OMITTED RECs
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=WORK,SPACE=(TRK,(100,10),RLSE),
//           DCB=*.STEP10.SORTIN
//SYSIN DD *
  SORT FIELDS=COPY
  OUTFIL FILES=1,INCLUDE=(...)
  OUTFIL FILES=2,OMIT=(...)
/*


Guys correct me if I am wrong.

Thanks,
Raghavendra U N
Back to top
View user's profile Send private message
Prandip

New User


Joined: 04 Mar 2005
Posts: 85
Location: In my tiny cubicle ...

PostPosted: Fri Jul 29, 2005 6:01 pm    Post subject: Re: To have OMITTED records in file
Reply with quote

I think it would be easier to just use the SAVE option to keep all of the omitted records:
Code:

//STEP0001 EXEC PGM=SORT                                               
//SORTIN   DD   DISP=SHR,DSN=INPUT                                     
//SORTOF1  DD   DSN=NON.OMITTED.RECORDS,DISP=(,CATLG,DELETE),...       
//SORTOF2  DD   DSN=OMITTED.RECORDS,DISP=(,CATLG,DELETE),...           
//SYSOUT   DD   SYSOUT=*                                               
//SYSIN    DD   *                                                       
  OPTION COPY                                                           
  OUTFIL FILES=1,OMIT=(1,8,CH,EQ,C'XXXXXXXX')                           
  OUTFIL FILES=2,SAVE                                                   
/*                                                                     
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: Fri Jul 29, 2005 9:25 pm    Post subject:
Reply with quote

For some more information on the INCLUDE, OMIT and SAVE operands of DFSORT's OUTFIL statement, see:

http://www.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/online/srtmboft.html#osb

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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us