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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
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 IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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