IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SELECT TO MULIPLE OUTFIL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Fri Mar 23, 2018 10:44 pm
Reply with quote

I am selecting from 1 file need data to go onto 2 different files.

I have:

Code:
  SELECT FROM(INDD)       -       
          TO(OUTDD)      -       
     DISCARD(DUPFILE)      -     
          ON(1,8,CH)       -     
       EQUAL(1)            -     
       USING(SRT1)               


SRTCNTL:

Code:

SORT FIELDS=(1,8,CH,A)         
OMIT CONDITIONN=(1,4,CH,EQ,C'UHDR',OR,1,4,CH,EQ,C'UTRL',OR,1,8,CH,EQ,   
           C'ML-AC-NO')                                   
INREC IFTHEN=(WHEN=(277,2,CH,EQ,C'BA',AND,                       
                   (603,10,CH,NE,C'2010-06-22',AND,               
                    603,10,CH,NE,C'2010-06-29')),                 
              OVERLAY=(11:C'N'),HIT=NEXT),                       
      IFTHEN=(WHEN=(277,2,CH,EQ,C'BA',AND,                       
                   (603,10,CH,EQ,C'2010-06-22',OR,               
                    603,10,CH,EQ,C'2010-06-29')),                 
              OVERLAY=(11:C'F'),HIT=NEXT),                       
      IFTHEN=(WHEN=((312,1,CH,NE,C' ',AND,191,1,CH,EQ,C' '),AND, 
                   (11,1,CH,EQ,C'F',OR,11,1,CH,EQ,C'N')),         
              OVERLAY=(191:C'M')),                               
      IFTHEN=(WHEN=((312,1,CH,NE,C' ',AND,191,1,CH,EQ,C' '),AND, 
                   (11,1,CH,NE,C'F',AND,11,1,CH,NE,C'N')),       
              OVERLAY=(11:C' ',191:C'M')),                       
      IFTHEN=(WHEN=(NONE),                                       
              OVERLAY=(11:C' '))                                 
OUTFIL FNAMES=OUTDD,
IFTHEN=(WHEN=(71,1,CH,NE,C' ',AND,                                 
                     71,1,CH,NE,C'R',AND,71,1,CH,NE,C'W'),         
               BUILD=(1:1,8,1X,                                   
                      772:C'Y',198,1,223,1,226,1,227,1,           
                      542,06,CHANGE=(6,C'      ',                 
                                       C'000000'),NOMATCH=(542,06),
                      548,06,CHANGE=(6,C'      ',                 
                                       C'000000'),NOMATCH=(548,06),
                      71,1,67,3,C'B',561,1,C'000000',             
                      455,01,CHANGE=(1,C' ',                       
                                       C'N'),NOMATCH=(455,01),     
                      568,01,                                     
                      231,1,                                       
                      386,1,                                       
                      84,2,                                       
                      11,1,                                       
                      191,1,                                       
                      114,20,                                     
                      54,1,                                       
                      3X,                                         
                      2X,                                         
                      66,1,                                       
                     10X)),   
 IFTHEN=(WHEN=NONE,                                         
         BUILD=(1:1,8,1X,                                   
                772:C'Y',198,1,223,1,226,1,227,1,           
                542,06,CHANGE=(6,C'      ',                 
                                 C'000000'),NOMATCH=(542,06),
                548,06,CHANGE=(6,C'      ',                 
                                 C'000000'),NOMATCH=(548,06),
                71,1,67,3,C' ',561,1,C'000000',             
                455,01,CHANGE=(1,C' ',                       
                                 C'N'),NOMATCH=(455,01),     
                568,01,                                     
                231,1,                                       
                386,1,                                       
                84,2,                                       
                11,1,                                       
                191,1,                                       
                114,20,                                     
                54,1,                                       
                3X,                                         
                2X,                                         
                66,1,             
               10X))                             
OUTFIL FNAMES=OUTDD3,                                       
               BUILD=(1:1,8,1X,                             
                      59X,                                   
                      C'T',                                 
                      725,1,CHANGE=(1,C' ',                 
                                      C'N'),NOMATCH=(725,01),
                      130X)                                         



I am expecting same number of records out OUTDD and OUTDD to be same and have same 8 bytes in position 1-8,

I get:
Quote:

RECORDS - IN: 14271838, OUT: 14271838
OUTDD : DELETED = 5, REPORT = 0, DATA = 14271833
OUTDD : TOTAL IN = 14271838, TOTAL OUT = 14271833
OUTDD3 : DELETED = 14271835, REPORT = 0, DATA = 3
OUTDD3 : TOTAL IN = 14271838, TOTAL OUT = 3


What am I missing?
Back to top
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Fri Mar 23, 2018 11:42 pm
Reply with quote

I didn't include input info: 1 INDD file no concatenated files.

Code:

UHDR 2018080                                                             
000M0001OPT10010473988031A                           H     000000       
000M0002OPT10010573988031A                           H     000000       
000M0007OPT10010673988031A                           H     000000       
000M0008OPT10010773988031A                           H     000000       
000M0009OPT10010873988031A                           H     000000       
000M0010OPT10010973988031A                           D     000000       
000M0017OPT10010083988031A                           H     000000       
000M0019OPT10010183988031A                           H     000000       
000M0080OPT10010283988031A                           H     000000       
000M0081OPT10010383988031A                           H     000000       
000M0083OPT10010483988031A                           H     000000       
000M0085OPT10010583988031A                           H     000000       
000M0087OPT10010683988031A                           H     000000       
000M0100OPT10010783988031A                           D     000000       
000M0102OPT10010883988031A                           H     000000       
000M0120OPT10010983988031A                           D     000000       
000M0121OPT10010093988031A                           D     000000       
000M0200OPT10010193988031A                           H     000000       
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Mar 23, 2018 11:43 pm
Reply with quote

speermb,

You just need to remove the BELOW line from your TOOLIN control card.
Code:
DISCARD(DUPFILE)      -   


DFSORT manual says wrote:
•If you specify TO(outdd) and DISCARD(savedd), you can further process the outdd and savedd records after SELECT processing using two (and only two) OUTFIL statements like this:

OUTFIL FNAMES=outdd,...
OUTFIL FNAMES=savedd,...
This suggests the two OUTFILs correspond to the TO output and the DISCARD output.

Quote:
•If you specify TO(outdd) without DISCARD(savedd), you can further process the outdd records after SELECT processing using an OUTFIL statement like this:
OUTFIL FNAMES=outdd,...copy to clipboard
or multiple OUTFIL statements like this:
OUTFIL FNAMES=outdd,...
OUTFIL FNAMES=outdd1,...
...

Since you mentioned you need the same number of records in both the outputs, I guess you are trying to process only the TO output and NOT the DISCARD output. So your control cards should be in line with the format-2 above.

Post back if you still face issues. Good luck.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Fri Mar 23, 2018 11:51 pm
Reply with quote

1) Please, explain in plain English your desired selection criteria for each DATASET?

2) Simplify your test to only those suspicious statements/parameters which do not work properly, from your point of view

3) Truncate your test input DATASET to the only minimum required for functional testing of suspicious statements/parameters

4) Analyze in full: the input data, and two output datasets

5) If not able to find the reason of malfunction, then ask for help at the forum, AFTER ALL REQUIRED INFORMATION IS PRESENT, and ALL IRRELEVANT INFORMATION IS TRUNCATED.
Back to top
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Mon Mar 26, 2018 5:59 pm
Reply with quote

Thanks. Arun Raj that solved it 100%.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Mar 26, 2018 7:07 pm
Reply with quote

speermb wrote:
Thanks. Arun Raj that solved it 100%.
You're welcome. Thanks for letting us know.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
Search our Forums:

Back to Top