IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Picking Specific values for group of records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Guest







PostPosted: Mon May 14, 2012 4:36 pm
Reply with quote

Hi,

I've have the following scenarios for my input and output. It would of great help if someone could give some pointers for a DFSORT solution.

Input File - FB/9bytes
YA1111111
YC1111111
YB1111111
YA2222222
YB2222222
YA3333333
YA3333333
3333333 (2byte spaces at the beginning of record)
YA4444444
YA4444444
YB4444444
YC4444444


Output - FB/13bytes
1111111YAYBYC
2222222YAYB
3333333YA
4444444YAYBYC

Please let me know, if you would need further information.
Back to top
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon May 14, 2012 4:54 pm
Reply with quote

Yes, can you explain, in words, how it should go. I see you have unsorted, and you want the characters on the output in order. Also duplicates dropped?
Do you have a maximum of three pairs of non-duplicate characters?
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Mon May 14, 2012 6:42 pm
Reply with quote

Considering there are no duplicates and that there are three non-duplicate characters (as Bill Woodger already asked), here is my try and it worked.

Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD *
YA1111111
YC1111111
YB1111111
YA2222222
YB2222222
YA3333333
  3333333
YA4444444
YB4444444
YC4444444
//OUT      DD SYSOUT=*
//TOOLIN   DD *
  SPLICE FROM(IN) TO(OUT) ON(1,7,CH) WITHANY KEEPNODUPS USING(CTL1) -
  WITH(8,2) WITH(10,2) WITH(12,2)
//CTL1CNTL DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
                PARSE=(%01=(FIXLEN=02),%02=(FIXLEN=07)),
                BUILD=(%02,30X,%01)),

  IFTHEN=(WHEN=INIT,OVERLAY=(14:SEQNUM,2,ZD,RESTART=(1,7))),
  IFTHEN=(WHEN=(14,2,ZD,EQ,01),OVERLAY=(8:38,2)),
  IFTHEN=(WHEN=(14,2,ZD,EQ,02),OVERLAY=(10:38,2)),
  IFTHEN=(WHEN=(14,2,ZD,EQ,03),OVERLAY=(12:38,2))

  OUTFIL BUILD=(1,13)
//*


Output:
Code:
1111111YAYCYB
2222222YAYB
3333333YA
4444444YAYBYC
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 15, 2012 10:30 pm
Reply with quote

Naish,

Why are you using PARSE considering that the fields are in fixed positions?
PARSE is used when the fields are delimited with different lengths. Your PARSEd fields are equivalent to 1,2 and 3,7 - you don't need PARSE. Other than that, I don't know if your solution is a good one considering that the OP has not really explained what he wants to do.

devil13,

As Bill indicated, you need to do a better job of explaining the rules for what you want to do. It's certainly not clear from your example.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed May 16, 2012 2:59 pm
Reply with quote

Oops icon_redface.gif

icon_sad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top