Dfsort - Omitting 10 Records At A Time


Main Menu        Computer Tips        Software Downloads Menu

  Main Question - Posted From Guest:
I have a file that contains multiple sets metadata records that I need to remove before passing the file on. My first thought was to use the OMIT command but, so far, I haven't found anything that matches how these metadata records look. They are interspersed throughout the file and look like this... 1DISDOCHD ENVADDR1 xxxxxxxxxxxxxxxxx ENVADDR2 xxxxxxxxxxxxxxxxx ENVADDR3 xxxxxxxxxxxxxxxxx ENVADDR4 xxxxxxxxxxxxxxxxx ENVADDR5 xxxxxxxxxxxxxxxxx ENVADDR6 xxxxxxxxxxxxxxxxx ENVADDR7 xxxxxxxxxxxxxxxxx INSERTER 1 DOCDATE TRUEDOC Y I would like to say something like "start omitting when DISDOCHD is found in col 2 and omit for 9 more records".

Frank Yaeger Says:
You can use a DFSORT job like the following to do what you asked for.  I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
   OPTION COPY
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,8,CH,EQ,C'DISDOCHD'),
      RECORDS=10,PUSH=(81:ID=1))
   OUTFIL OMIT=(81,1,CH,NE,C' '),BUILD=(1,80)
/*

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    


Add your reply below ...



This site allows you to ask questions and get answers from various posters, you may also answer any posts if you feel like you have input to give. Feel free to ask for help with any new question you wish, but most of the questions here are tech related. You will find many questions and answers related to your Ipod or Ipod Nano, Itunes, audio and video converting, spyware or adware cleanup, pc or other computer questions, and even mainframe questions. Although these are the tech questions most often asked, you will find help on almost any computer or software related subject. Feel free to go to the main menu and review the posts already present, or feel free to ask your own question. (Some questions will be closed once the moderator feels they are sufficiently answered and that no other input is needed).

Your Name:

Your Reply:

Type in verification code:


Main Menu

Shareware and Freeware Database

Tasks and Spyware Database

Various Computer Help Topics