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
 

 

Different INCLUDE based on value of header record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Different INCLUDE based on value of header record
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 Moderator


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

PostPosted: Mon Jul 20, 2009 10:08 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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