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

OMITING RECORDS BY SOM CONDITION


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
siva102

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Wed Feb 11, 2009 1:26 pm
Reply with quote

Hi all,

just need a help from u guys.

I am having an input file whose LRECL = 80

Code:

----+----1----+----2----+----3----+----4----+----5----+----6
111
120:25354754:48225
123:568545:556566665
1222:sadsdasda
12121212:45544445
000:RECORD NO"12345"?
1222:sasdaioo
4444"RECORD NO"12345"?


My output file should be like below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6
120:25354754:48225
123:568545:556566665
12121212:45544445
000:RECORD NO?
4444:RECORD NO?


So here
1) The lines where the first 3 characters are "111" that need to be deleted
2) The first 4 character are "1222" it need to be deleted and
3) IF the value from position 5 to 13 = RECORD NO then it will omit the rest of the stuff after that value by replacing a ? mark.

Please help me in solving this problem.
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 Feb 11, 2009 9:57 pm
Reply with quote

Quote:
3) IF the value from position 5 to 13 = RECORD NO then it will omit the rest of the stuff after that value by replacing a ? mark


From your example, it appears that you also want to do this if the value from position 6-14 = RECORD NO.

You can use a DFSORT job like the following to do what you asked for. Modify as needed.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,3,CH,EQ,C'111',OR,1,4,CH,EQ,C'1222')
  INREC IFTHEN=(WHEN=(5,9,CH,EQ,C'RECORD NO'),
    OVERLAY=(14:C'?',20X)),
   IFTHEN=(WHEN=(6,9,CH,EQ,C'RECORD NO'),
    OVERLAY=(15:C'?',20X))
/*
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top