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
 

 

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 Group Data based on a key Arun Raj DFSORT/ICETOOL 4 Thu Apr 27, 2017 11:29 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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