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

Select records based on stored values


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

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Thu Oct 18, 2007 8:48 pm
Reply with quote

Hello,

Please help me builiding sort card.

Input:

01AAAA
02BBBB
03D01
01CCCC
02DDDD
03D01
01EEEE
02FFFF
03D02 (because it is not 01-after 03D, this set (01,02 & 03D) should not get selected)
01GGGG
02HHHH
03D01

Output:

01AAAA
02BBBB
03D01
01CCCC
02DDDD
03D01
01GGGG
02HHHH
03D01

3rd set of records should not be part of output because after rec type 03D the value is not '01'.

Thanks,
Dinesh

RIP...
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Oct 19, 2007 8:27 am
Reply with quote

Dinesh,

Please explain your requirement as your post is not clear. On what basis are you ignoring the records (01EEEE,02FFFF,03D02 ) from the input?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 8:36 am
Reply with quote

Hello,

The value 03D02 causes that group (set) to be excluded.

Only groups/sets ending with a record of 03D01 are to be included in the output.
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Fri Oct 19, 2007 11:28 am
Reply with quote

Here is what you are looking for
Code:

//STEP0001 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//TOOLIN   DD *
  SPLICE FROM(IN) TO(OUTX) USING(ICE0) WITHALL KEEPBASE -
         ON(81,5,ZD) WITH(1,85)
/*
//IN       DD *
01AAAA
02BBBB
03D01
01CCCC
02DDDD
03D01
01EEEE
02FFFF
03D02
01GGGG
02HHHH
03D01
/*
//OUTX     DD SYSOUT=*
//ICE0CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
                OVERLAY=(81:SEQNUM,5,ZD,START=2)),
        IFTHEN=(WHEN=(1,3,CH,NE,C'03D'),
                OVERLAY=(86:SEQNUM,5,ZD,
                         81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5,
                         86:C'1')),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'03D'),
                OVERLAY=(81:SEQNUM,5,ZD),
                HIT=NEXT),
        IFTHEN=(WHEN=(4,2,CH,EQ,C'01'),
                OVERLAY=(86:C'2')),
        IFTHEN=(WHEN=(4,2,CH,EQ,C'02'),
                OVERLAY=(86:C'0')),
        IFOUTLEN=86
  SORT FIELDS=(81,6,ZD,A)
  OUTFIL FNAMES=OUTX,
         OMIT=(86,1,CH,EQ,C'0'),
         BUILD=(1,80)

OUTX shows:
Code:

01AAAA
02BBBB
03D01
01CCCC
02DDDD
03D01
01GGGG
02HHHH
03D01

Alain


Dfsort is not yet able to read files backwards, writing records one above the other.
If it was, we could use the group key technique from a copy, treating TRL as HDR icon_smile.gif
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Sat Oct 20, 2007 12:25 am
Reply with quote

Thanks heaps, Alain...
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