MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple Include

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Neostar
Beginner


Joined: 29 Nov 2004
Posts: 4
Topics: 1

PostPosted: Tue Nov 30, 2004 2:39 pm    Post subject: Multiple Include Reply with quote

I am going to have multiple INCLUDES, say 4 in the SORTPARM.

Requirement is:

1. Record in 1st include should not fall in second include
2. Record in 1st and 2nd include should not fall in sub-sequent includes.

Pl guide.

Thanks !!

NeoStar
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Nov 30, 2004 5:54 pm    Post subject: Reply with quote

Neostar,


It would be of great help if you can provide us with examples.

Thanks

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Nov 30, 2004 11:21 pm    Post subject: Reply with quote

Neostart,

Are you trying to divide the records in the input file to 4 different output files based on certain criteria ? As Kolusu said, Please give us a sample input and sample output that you are trying to achieve. Also provide the LRECL, RECFM of the input and output files. Also the expected/actual size of the file may also help (No. of records on an average).

Thanks,
Phantom
Back to top
View user's profile Send private message
Neostar
Beginner


Joined: 29 Nov 2004
Posts: 4
Topics: 1

PostPosted: Wed Dec 01, 2004 9:42 am    Post subject: Reply with quote

Here is the example:

1-2 - Country code
3-6 - Position held
7-8 - Salary Range


OUTFIL FILES=01,INCLUDE=((1,2,CH,EQ,C'US'),AND,(7,8,CH,EQ,C'HI'))
OUTFIL FILES=02,INCLUDE=(3,6,CH,EQ,C'ADMN')
AND SO ON...
- IT MAY BE POSSIBLE THAT RECORDS IN FILE01 MAY MATCH THE CONDITION IN FILE02.
- SO FEW RECORDS PRESENT IN BOTH FILES.
- REQUIREMENT: RECORDS ALREADY IN FILE=01 SHOULD NOT FALL IN FILE=02
- NOT SURE IS ,SAVE IS GOING TO HELP

Thanks in Advance !!

Regards
NeoStar
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Dec 01, 2004 9:51 am    Post subject: Reply with quote

NeoStar,

You can add the other outfil conditions also but with a NE(NOT equal) relational expression

ex:
Code:

OUTFIL FILES=01,INCLUDE=((1,2,CH,EQ,C'US',AND,7,8,CH,EQ,C'HI'),AND,
                          (3,6,CH,NE,C'ADMN'))

OUTFIL FILES=02,INCLUDE=((1,2,CH,NE,C'US',AND,7,8,CH,NE,C'HI'),AND,
                          (3,6,CH,EQ,C'ADMN'))
...



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Neostar
Beginner


Joined: 29 Nov 2004
Posts: 4
Topics: 1

PostPosted: Wed Dec 01, 2004 11:21 am    Post subject: Reply with quote

Kolusu

Thanks !!

But I did know this and its running in production.

- There are too many conditions here.
- I just dummy out few in example above.
- Was wondering if any other easy way to carry out this functinality.

Wishes !!
NeoStar
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Dec 01, 2004 11:40 am    Post subject: Reply with quote

Well, of course the obvious way to do it is to use multiple DFSORT/ICETOOL COPY operators and just feed the remaining records to the next operator, but this will take multiple passes and be less efficient then if you could code all of the conditions in one pass as Kolusu suggested. Anyway, here's a DFSORT/ICETOOL job that shows the multiple pass method:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
US    HI
US    HI
US    LO  AA
US    LO  AB
      LO  AA
      LO  AB
  ADMN
  ADMN    AA
  ADMN    AB
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//OUT3 DD SYSOUT=*
//OUT4 DD SYSOUT=*
//OUT5 DD SYSOUT=*
//TOOLIN DD *
  COPY FROM(IN) USING(CTL1)
  COPY FROM(T1) USING(CTL2)
  COPY FROM(T2) USING(CTL3)
  COPY FROM(T1) USING(CTL4)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT1,
    INCLUDE=(1,2,CH,EQ,C'US',AND,7,8,CH,EQ,C'HI')
  OUTFIL FNAMES=T1,SAVE
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT2,
    INCLUDE=(3,6,CH,EQ,C'ADMN',AND,11,2,CH,EQ,C'AA')
  OUTFIL FNAMES=T2,SAVE
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT3,
    INCLUDE=(1,2,CH,EQ,C'US')
  OUTFIL FNAMES=T1,SAVE
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=OUT4,
    INCLUDE=(11,2,CH,EQ,C'AA')
  OUTFIL FNAMES=OUT5,SAVE
/*


The output files would contain the following records:

OUT1
US HI
US HI

OUT2
ADMN AA

OUT3
US LO AA
US LO AB

OUT4
LO AA

OUT5
LO AB
ADMN
ADMN AB
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group