Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
More than 1 Include criteria for single SORTOUT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Wed Sep 13, 2017 11:45 pm    Post subject: More than 1 Include criteria for single SORTOUT
Reply with quote

I'm using SyncSort and have come across something I need but cannot seem to get correct.

Code:

SORT FIELDS=(0110,18,CH,A,               POLICY-NUMBER   
             0128,04,PD,A)               RINK-DATE       
OUTFIL INCLUDE=(098,02,BI,EQ,X'010C',    EXTRACT-CODE     
            AND,005,02,CH,EQ,C'01')      W-DOCUMENT-CODE 
OPTION VLSHRT,SIZE=E70000000,EQUALS                       
/*                                                       


The SORT FIELDS works, but it seems like the INCLUDE is ignored. Checking with FileAid, I should have an output file consisting of about 20,000 records. Instead, I end up with the original file's 300,000 records.

I RTFM, but couldn't find a multiple condition example for wither INCLUDE or OMIT. Does anyone have any suggestions?
Back to top
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Thu Sep 14, 2017 12:27 am    Post subject:
Reply with quote

First, it makes sense to ignore unneeded records BEFORE sorting them. Use initial INCLUDE COND= statement, instead of INCLUDE= parameter of OUTFIL statement.

Next, there is no such thing as "multiple condition", at least in SORT utilities.
There is ALWAYS a single condition which may consist of complex logical expression: mainly with AND/OR logical operators.

Verify more carefully your specified fields offset, and stored values.

Take care of RECFM=VB (it shifts all fields 4 bytes to the right).

There are no such things as miracles.
Back to top
View user's profile Send private message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Thu Sep 14, 2017 12:32 am    Post subject: More than 1 Include criteria for single SORTOUT
Reply with quote

Ach! Come on, lad! All of mainframe programming is basically believing in miracles! (Just ask those Java nuts!).

But seriously, your solution was perfect. I forgot to put the include before the sort.

Thank you for your help.

Now to figure out how to delete a duplicated post......
icon_redface.gif
deleted
Back to top
View user's profile Send private message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Thu Sep 14, 2017 6:17 pm    Post subject:
Reply with quote

This is getting to the point of hari kari.

Here's what I have in my Job results:
Code:
 SORT FIELDS=(0110,18,CH,A,               
              0128,04,PD,A)               
 INCLUDE COND=(005,02,CH,EQ,C'01',       
           AND,098,02,BI,EQ,X'010C')     
 OPTION VLSHRT,SIZE=E70000000,EQUALS     

RCD IN     909263, OUT          0


According to FileAid, these are my fields:
Code:
W-DOCUMENT-CODE     EXTRACT-CODE
2/AN                   2/PS
(1-2)                  (94-95)


My JCL is
Code:
//TSO3972S JOB (20,49),'REW',NOTIFY=TSO3972,               
//          MSGCLASS=Q,CLASS=A,MSGLEVEL=(1,1)                   
//SORT01  EXEC PGM=SORT,PARM='SIZE=MAX'                         
//SYSUDUMP DD SYSOUT=Y                                         
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DISP=SHR,                                         
//            DSN=AT.REW.#090.PAP080.OTHERS.D080917.ORIG       
//SORTOUT  DD DSN=RT.REW.#030.AGB2000C.ORIG.FILE.SORT(+1),     
//            DISP=(,CATLG,DELETE),DATACLAS=DAILY               
//*            SPACE=(TRK,(0800,0800),RLSE),UNIT=WORK,         
//*            DISP=(,CATLG,DELETE)                             
//SYSIN    DD DISP=SHR,DSN=CHG.AGT1.STAGE.#000003.CTC(AGB2000C)
 OMIT    COND=(005,02,CH,NE,C'01',        W-DOCUMENT-CODE       
           AND,098,02,BI,NE,X'010C')      EXTRACT-CODE         
 SORT FIELDS=(110,18,CH,A,                POLICY-NUMBER         
              128,04,PD,A)                RINK-DATE             
 OPTION VLSHRT,SIZE=E70000000,EQUALS                           
//*                                                             


I get the same results if I swap the INCLUDE with the SORT. Oh yeah - on the latest test, I tried OMIT with the same results.

What am I doing wrong???
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Thu Sep 14, 2017 7:56 pm    Post subject:
Reply with quote

In FileAid, verify not only the format/position of your input fields, but their actual values (in HEX).

Present here real values found in your file via FileAid.

While it's not clear yet, run your test with reduced input file (or, at least, use STOPAFT=nn parameter)
Back to top
View user's profile Send private message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Thu Sep 14, 2017 7:58 pm    Post subject:
Reply with quote

That did the trick!
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Thu Sep 14, 2017 8:05 pm    Post subject:
Reply with quote

BTW: when switching between INCLUDE/OMIT, don't forget to change AND/OR, too!

Be careful about logical expressions.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us