Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Guest

 Posted: Mon May 14, 2012 4:36 pm    Post subject: Picking Specific values for group of records 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.

Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Mon May 14, 2012 4:54 pm    Post subject: Reply to: Picking Specific values for group of records 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?
Naish

New User

Joined: 07 Dec 2006
Posts: 82
Location: UK

Posted: Mon May 14, 2012 6:42 pm    Post subject:

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

DFSORT Moderator

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

 Posted: Tue May 15, 2012 10:30 pm    Post subject: 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.
Naish

New User

Joined: 07 Dec 2006
Posts: 82
Location: UK

 Posted: Wed May 16, 2012 2:59 pm    Post subject: Oops
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am Group changes and numbering the groups Auryn DB2 2 Tue Mar 20, 2018 7:12 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us