MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Include the records only till specific point

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Mon Feb 05, 2007 5:42 am    Post subject: Include the records only till specific point Reply with quote

Hi,

My input is something like this:

Code:
ABCD
EFGH
HIJK
LMOP
XXXX
QRST
VWXY


What I want is using Icetool / DFSort, I want all the records which are coming before a fixed string in the file which here is 'XXXX'. Can you please let me know how to do it.

so, output would be:

Code:
ABCD
EFGH
HIJK
LMOP


thanks.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 05, 2007 6:51 am    Post subject: Reply with quote

Amit4u79,

try this untested DFSORT/ICETOOL job which will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD *                                 
ABCD                                             
EFGH                                             
HIJK                                             
LMOP                                             
XXXX                                             
QRST                                             
VWXY                                             
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                 
  COPY FROM(IN) USING(CTL1)                     
  COPY FROM(IN) TO(OUT) USING(CTL2)             
//CTL1CNTL DD *                                         
  OUTREC FIELDS=(1,5,SEQNUM,8,ZD,START=0,INCR=1)         
  OUTFIL FNAMES=CTL2CNTL,                               
  INCLUDE=(1,4,CH,EQ,C'XXXX'),                           
  OUTREC=(C' OPTION STOPAFT=',6,8,80:X)                 
//CTL2CNTL DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
/*                                                       


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Feb 05, 2007 11:29 am    Post subject: Reply with quote

Amit,

Kolusu's DFSORT/ICETOOL job will work. However, here's an easier, one pass way to do it with DFSORT:

Code:

//S1 EXEC PGM=ICEMAN                                             
//SYSOUT  DD SYSOUT=*                                           
//SORTIN       DD *                                             
ABCD                                                             
EFGH                                                             
HIJK                                                             
LMOP                                                             
XXXX                                                             
QRST                                                             
VWXY
/*                                                             
//SORTOUT      DD SYSOUT=*                                       
//SYSIN   DD *                                                   
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),             
        IFTHEN=(WHEN=(1,4,CH,EQ,C'XXXX'),                       
                OVERLAY=(81:SEQNUM,8,ZD)),                       
        IFTHEN=(WHEN=NONE,                                       
                OVERLAY=(89:SEQNUM,8,ZD,                         
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))   
  OUTFIL INCLUDE=(81,8,ZD,EQ,+0),BUILD=(1,80)                   
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Mon Feb 05, 2007 8:03 pm    Post subject: Reply with quote

Great sir. thanks a lot Frank and Kolusu.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 05, 2007 10:30 pm    Post subject: Reply with quote

Good One Frank.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Tue Feb 06, 2007 4:20 pm    Post subject: Reply with quote

Frank,

That's a great application. In building on your job, I may have found simpler control cards...

Code:

//SYSIN   DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,NE,C'XXXX'),
                OVERLAY=(89:SEQNUM,8,ZD))
  OUTFIL INCLUDE=(81,8,ZD,EQ,89,8,ZD),BUILD=(1,80)
/* 


I think this will produce the same desired output.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Feb 06, 2007 5:47 pm    Post subject: Reply with quote

Yes, that variation will work in this particular case as well.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group