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
 

 

OUTFIL & INCLUDE (Same DDNAME occuring multiple times)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Bhavan JS
Warnings : 1

New User


Joined: 30 Nov 2007
Posts: 10
Location: Bangalore

PostPosted: Sun Dec 30, 2007 7:54 pm    Post subject: OUTFIL & INCLUDE (Same DDNAME occuring multiple times)
Reply with quote

Hi,

I have a master file and I want to move the records from master to multiple files based on 2 fields (Field A and Field B)values. I' am using OUTFIL & INCLUDE for this. The problem here for me is I have many combinations of Field A and Field B which should go to File-1. Same case for the records which should go to File-2. For ex..

OUTFIL FNAMES=File-1,
INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'702')
OUTFIL FNAMES=File-1,
INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'703')

.......and many more conditions for File-1
OUTFIL FNAMES=File-2,
INCLUDE=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'702')
OUTFIL FNAMES=File-2,
INCLUDE=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'703')

.......and many more conditions for File-2
.......and many more conditions for multiple output files. (File-n)

Only first OUTFIL& INCLUDE condition for every output file is considered and all the duplicated DDnames are ignored by ICETOOL. As a result, I dont have records in File-1 & File-2 which satisfies the highlighted INCLUDE condtions. Is there a solution for my problem? Great if you can help.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sun Dec 30, 2007 8:22 pm    Post subject:
Reply with quote

Try
Code:

 OUTFIL FNAMES=File-1,
 INCLUDE=(2,6,CH,EQ,C'1',AND,
         (9,11,CH,EQ,C'702',OR,
          9,11,CH,EQ,C'703))
Back to top
View user's profile Send private message
Bhavan JS
Warnings : 1

New User


Joined: 30 Nov 2007
Posts: 10
Location: Bangalore

PostPosted: Sun Dec 30, 2007 9:44 pm    Post subject: Reply to: OUTFIL & INCLUDE (Same DDNAME occuring multipl
Reply with quote

Thanks for your reply Expat. I' am not coding OUTFIL INCLUDE in my JCL manually. Rather, I' am dynamically creating OUTFIL INCLUDE sysin by unloading records from a table. I have a table like below:

Field-1 Field-2 FileName
=================

FileName may repeat for different combinations of Field-1 and Field-2.
By unloading the below query to a file gives me a dynamic sysin for OUTFIL INCLUDE which I' am using in my JCL.

SELECT
'OUTFIL FNAMES=',FileName,
', INCLUDE=(2,6,CH,EQ, C''',Field-1,
''',AND,9,11,CH,EQ,C''',Field-2,''')'
FROM table-name;

Is there any option in ICETOOL to consider duplicate DD Names?
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: Sun Dec 30, 2007 11:18 pm    Post subject:
Reply with quote

Bhaven,

It seems that instead of figuring out the best way to do what you want, you've picked a way to do it that doesn't work and are insisting on using it.

You can't use the same ddname for multiple OUTFIL statements the way you want to, but you don't have to.

expat showed you one way to do what you want with one OUTFIL per ddname using OR in the INCLUDE operand.

Another way would be to use an INREC with IFTHEN clauses to set an indicator for the one OUTFIL statement for each ddname, e.g.

Code:

   INREC IFTHEN=(WHEN=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'702'),
      OVERLAY=(81:C'1'),HIT=NEXT),
    IFTHEN=(WHEN=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'703'),
      OVERLAY=(81:C'1'),HIT=NEXT),
    ...
    IFTHEN=(WHEN=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'703'),
      OVERLAY=(81:C'2'),HIT=NEXT),
    ...
   OUTFIL FNAMES=File-1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
   OUTFIL FNAMES=File-2,INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(1,80)
   ...


A third possible way would be to generate an ICETOOL COPY/USING for each condition so you can use multiple OUTFIL statements to a MOD ddname. However, this is inefficient, and also might give you multiple copies of a record in an output file that you don't want.

Code:

...
//File-1 DD DISP=MOD,...
//File-2 DD DSIP=MOD,...
//TOOLIN DD *
COPY FROM(IN) USING(CT11)
COPY FROM(IN) USING(CT12)
...
COPY FROM(IN) USING(CT21)
...
//CT11CNTL DD *
   OUTFIL FNAMES=File-1,
      INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'702')
//CT12CNTL DD *
   OUTFIL FNAMES=File-1,
     INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'703')
...
//CT21CNTL DD *
  OUTFIL FNAMES=File-2,
     INCLUDE=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'703')
...


You need figure out how to change your unload to generate control statements that are valid and will do what you want.
Back to top
View user's profile Send private message
Bhavan JS
Warnings : 1

New User


Joined: 30 Nov 2007
Posts: 10
Location: Bangalore

PostPosted: Mon Dec 31, 2007 10:11 am    Post subject:
Reply with quote

Thank you so much Frank. Before I started my work, I didn't realised that we cannot use duplicated DD names in OUTFIL. Then, as you said, instead of rework, I was wondering if availabe, I can specify "Use duplicated DD Names" option. Thanks again and I will get back to you with my result.
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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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