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
 

 

OMITING RECORDS BY SOM CONDITION

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

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Wed Feb 11, 2009 1:26 pm    Post subject: OMITING RECORDS BY SOM CONDITION
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 Moderator


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

PostPosted: Wed Feb 11, 2009 9:57 pm    Post subject:
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    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
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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