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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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