Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Select records based on stored values

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

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Thu Oct 18, 2007 8:48 pm    Post subject: Select records based on stored values
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: 1288
Location: Chennai, India

PostPosted: Fri Oct 19, 2007 8:27 am    Post subject: Reply to: Select records based on stored values
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

Site Director


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

PostPosted: Fri Oct 19, 2007 8:36 am    Post subject:
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    Post subject:
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: 38
Location: Chicago

PostPosted: Sat Oct 20, 2007 12:25 am    Post subject:
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    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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts How to force a select query to abend neo4u DB2 7 Mon Apr 23, 2018 1:36 pm
No new posts LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us