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
 

 

selecting two records on one's condition

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

New User


Joined: 12 Mar 2007
Posts: 13
Location: india

PostPosted: Mon Jan 14, 2008 2:47 pm    Post subject: selecting two records on one's condition
Reply with quote

Hi guys,

I need to select all records under the following manner

if the condition matches then select the respective record and the next record.

eg.

001200300500
aaabbbcccddd
004500900700
pppoootttmmm
001200300400
eeefffggghhh

like if first three digits of any row is 001 then select it as well the record follwing it

so in this case we'll select

001200300500
aaabbbcccddd
001200300400
eeefffggghhh

please help
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: Mon Jan 14, 2008 10:32 pm    Post subject:
Reply with quote

xiinus,

Here's a DFSORT/ICETOOL job that will do what you want:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
001200300500
aaabbbcccddd
004500900700
pppoootttmmm
001200300400
eeefffggghhh
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(81,8,ZD) ALLDUPS USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(1,3,CH,EQ,C'001'),
      OVERLAY=(81:81,8,ZD,ADD,+1,TO=ZD,LENGTH=8))
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
Back to top
View user's profile Send private message
xiinus

New User


Joined: 12 Mar 2007
Posts: 13
Location: india

PostPosted: Tue Jan 15, 2008 11:13 am    Post subject:
Reply with quote

Thanks Frank icon_smile.gif
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