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

Different INCLUDE based on value of header record


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

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Mon Jul 20, 2009 8:22 pm
Reply with quote

Hi,
I am challenged with a problem here
I have a file which has a header record followed by many data records.
Position 10 of the header record can have one out of two sets values. First set of Values being A or B and second set of values being X or Y.

Here is how the file can come in four different ways.

Code:
----+----1----+----2----+----3
HHHHHHHHHAHHHHHHHHHHHHHHHHHHHH
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD

Code:
----+----1----+----2----+----3
HHHHHHHHHBHHHHHHHHHHHHHHHHHHHH
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD
D01DDDDDDDDDDDDDDDDDDDDDDDDDDD

Code:
----+----1----+----2----+----3
HHHHHHHHHYHHHHHHHHHHHHHHHHHHHH
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD

Code:
----+----1----+----2----+----3
HHHHHHHHHZHHHHHHHHHHHHHHHHHHHH
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD
XD01DDDDDDDDDDDDDDDDDDDDDDDDDD


Now if the value of position 10 the header record is A or B, I need to include the data records based on one particular DFSORT card
say INCLUDE COND=(1,3,CH,EQ,C’D01’)

If the value of the header record is X or Y, then I need to include the data records based on another DFSORT card.
say INCLUDE COND=(2,3,CH,EQ,C’D01’)

Can we use ICETOOL to resolve this
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Jul 20, 2009 10:08 pm
Reply with quote

If I understand correctly what you want to do, you can use a DFSORT job like the following:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/30)
//SORTOUT DD DSN=...  output file (FB/30)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'H'),
    PUSH=(31:10,1))
  OUTFIL INCLUDE=((31,1,SS,EQ,C'AB',AND,1,3,CH,EQ,C'D01'),OR,
    (31,1,SS,EQ,C'XY',AND,2,3,CH,EQ,C'D01')),
    BUILD=(1,30)
/*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top