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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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