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
 

 

Picking Specific values for group of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Guest







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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7308

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


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

PostPosted: Tue May 15, 2012 10:30 pm    Post subject:
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    Post subject:
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    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
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 2 Wed Mar 22, 2017 7:46 am
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 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


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us