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
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