Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us