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 

Can you do multiple FINDREPs?

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


Joined: 15 Nov 2007
Posts: 26
Topics: 7

PostPosted: Fri May 01, 2009 3:58 pm    Post subject: Can you do multiple FINDREPs? Reply with quote

Say I have

input:

Code:

----*----+----*----+
A          1
B          2
A          3


and I want

output:

Code:

----*----+----*----+
Apple      1 One
Banana     2 Two
Apple      3 Three


Can I do multiple FINDREP INOUTs, specifying different STARTPOS & ENDPOS for each column?

TIA Very Happy
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri May 01, 2009 6:31 pm    Post subject: Reply with quote

Quote:
Can I do multiple FINDREP INOUTs, specifying different STARTPOS & ENDPOS for each column?


mickeygoo,

If I understand what you want to do, you can use a DFSORT job like the following:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
A          1
B          2
A          3
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=1,ENDPOS=1,SHIFT=NO,
    INOUT=(C'A',C'APPLE',C'B',C'BANANA'))),
   IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=12,ENDPOS=12,
    INOUT=(C'1',C'1 ONE',C'2',C'2 TWO',C'3',C'3 THREE')))
/*

_________________
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
mickeygoo
Beginner


Joined: 15 Nov 2007
Posts: 26
Topics: 7

PostPosted: Mon May 04, 2009 1:27 pm    Post subject: Reply with quote

Bingo!!! Did not know you can use WHEN=INIT more than once. Thanks!!!
_________________
Not an expert, but I did stay at a Holiday Inn... though it has been a while...
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon May 04, 2009 2:15 pm    Post subject: Reply with quote

Yes, you can use WHEN=INIT clauses more than once, but WHEN=INIT and WHEN=GROUP clauses must be the first clauses used (they can be intermixed). WHEN=NONE clauses can also be used more than once, but must be the last clauses used.
_________________
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