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

To have OMITTED records in file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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: 84
Location: In my tiny cubicle ...

PostPosted: Fri Jul 29, 2005 6:01 pm
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 Developer


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

PostPosted: Fri Jul 29, 2005 9:25 pm
Reply with quote

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

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:

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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top