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
 

 

INCLUDE condition in SYNCSORT
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Mon Oct 15, 2007 10:37 pm    Post subject: INCLUDE condition in SYNCSORT
Reply with quote

Hi
I have a file which has 7 millions rcds. I need to extract rcds based on some data condition . The Data condition combination are about 50. The rest of the rcds needs to be in a diff file. I am doing like this below.Is there a simple way .Thanks

Code:

  SORT FIELDS=(118,5,CH,A,123,3,CH,A,126,3,CH,A)                 
  OUTFIL FNAMES=SORTFL2,INCLUDE=((118,5,CH,EQ,C'H6717'),OR,(118,5,CH,EQ,C'H7254'),OR,
           (118,5,CH,EQ,C'H9016'),OR,(118,5,CH,EQ,C'H9418'),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'004')     
                                 ,AND,(126,3,CH,EQ,C'001')),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'004')     
                                 ,AND,(126,3,CH,EQ,C'002')),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'004')     
                                 ,AND,(126,3,CH,EQ,C'003')),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'005')     
                                 ,AND,(126,3,CH,EQ,C'001')),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'005')     
                                 ,AND,(126,3,CH,EQ,C'002')),OR,
          ((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'005')     
                                 ,AND,(126,3,CH,EQ,C'003')),OR,
          ((118,5,CH,EQ,C'H5849'),AND,(123,3,CH,EQ,C'001')     
                                 ,AND,(126,3,CH,EQ,C'001')),OR,
          ((118,5,CH,EQ,C'H5849'),AND,(123,3,CH,EQ,C'001')     
                                 ,AND,(126,3,CH,EQ,C'002')),OR,
          ((118,5,CH,EQ,C'H5849'),AND,(123,3,CH,EQ,C'001')     
                                 ,AND,(126,3,CH,EQ,C'003')))   
  *
  OUTFIL FNAMES=SORTFL1,INCLUDE=((118,5,CH,NE,C'H6717'),OR,(118,5,CH,NE,C'H7254'),OR,
           (118,5,CH,NE,C'H9016'),OR,(118,5,CH,NE,C'H9418'),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'004')     
                                 ,AND,(126,3,CH,NE,C'001')),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'004')     
                                 ,AND,(126,3,CH,NE,C'002')),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'004')     
                                 ,AND,(126,3,CH,NE,C'003')),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'005')     
                                 ,AND,(126,3,CH,NE,C'001')),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'005')     
                                 ,AND,(126,3,CH,NE,C'002')),OR,
          ((118,5,CH,NE,C'H2320'),AND,(123,3,CH,NE,C'005')
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2007 10:46 pm    Post subject:
Reply with quote

Hello,

I believe these
Code:
((118,5,CH,EQ,C'H2320'),AND,(123,3,CH,EQ,C'004')
,AND,(126,3,CH,EQ,C'001')),OR,
could become
Code:
((118,5,CH,EQ,C'H2320'),AND,(123,6,CH,EQ,C'004001')),OR,
Back to top
View user's profile Send private message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Mon Oct 15, 2007 11:09 pm    Post subject:
Reply with quote

Hi

I changed my sort to the below but in OUTFIL=SORTFL2 the file is empty.Can someone tell me the reason or is there something wrong is sort card.

Code:
PRODUCT LICENSED FOR CPU SERIAL NUMBER 20F9E, MODEL 2084 304              LICEN
SYSIN :                                                                       
 SORT FIELDS=(133,5,CH,A,138,3,CH,A,141,3,CH,A)                               
 OUTFIL FNAMES=SORTFL1                                                         
     OMIT COND=((133,5,CH,EQ,C'H6717'),OR,(133,5,CH,EQ,C'H7254'),OR,           
            (133,5,CH,EQ,C'H9016'),OR,(133,5,CH,EQ,C'H9418'),OR,               
            (133,11,CH,EQ,C'H2320004001'),OR,                                 
            (133,11,CH,EQ,C'H2320004002'),OR,                                 
            (133,11,CH,EQ,C'H2320004003'),OR,                                 
            (133,11,CH,EQ,C'H2320005001'),OR,                                 
            (133,11,CH,EQ,C'H2320005002'),OR,                                 
            (133,11,CH,EQ,C'H2320005003'),OR,                                 
            (133,11,CH,EQ,C'H5849001001'),OR,                                 
            (133,11,CH,EQ,C'H5849001002'),OR,                                 
            (133,11,CH,EQ,C'H5849001003'))                                     
 OUTFIL FNAMES=SORTFL2,SAVE     
*                                               
WER108I  SORTIN   : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
WER110I  SORTFL1  : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
WER110I  SORTFL2  : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
WER045C  END SORT PHASE                                                       
WER055I  INSERT          0, DELETE       1157                                 
WER418I  DATASPACE(S) AND/OR HIPERSPACE(S) USED                               
WER405I  SORTFL1  :  DATA RECORDS OUT    2604122; TOTAL RECORDS OUT    2604122
WER405I  SORTFL2  :  DATA RECORDS OUT          0; TOTAL RECORDS OUT          0
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
WER246I  FILESIZE 1,213,520,852 BYTES                                         
WER054I  RCD IN    2605279, OUT    2604122                                     
WER072I  NOEQUALS IN EFFECT                                                   
WER169I  RELEASE 1.2 BATCH 0454 TPF LEVEL 3.0
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2007 11:27 pm    Post subject:
Reply with quote

Hello,

Please note that your system runs Syncsort, not DFSORT. This can be seen by the WERxxxx messages in your output.

It does not appear that all of the control info has been submitted/posted?

Please post all of the jcl, control info, and output info from the sort step.
Back to top
View user's profile Send private message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Mon Oct 15, 2007 11:37 pm    Post subject:
Reply with quote

Hi

Below is the sort step I am posting . For some reason OMIT SAVE File is empty.

Code:

//STEP1    EXEC PGM=SORT,COND=(0,NE)                                 
//SYSPRINT DD  SYSOUT=*                                             
//SYSOUT   DD  SYSOUT=*                                             
//SORTIN   DD  DISP=SHR,DSN=D@MMA.MARXBPA.PEXUTIL1.UNLD2             
//SORTFL1  DD  DSN=D@MMA.MARXBPA.PEXUTIL1.UNLD2.XCSF1,               
//             DISP=(,CATLG,DELETE),                                 
//             SPACE=(CYL,(1000,1000),RLSE),DATACLAS=DCLVOL,         
//             DCB=(*.SORTIN)                                       
//*                                                                 
//SORTFL2  DD  DSN=D@MMA.MARXBPA.PEXUTIL1.UNLD2.ICSF1,               
//             DISP=(,CATLG,DELETE),                                 
//             SPACE=(CYL,(100,100),RLSE),DATACLAS=DCLVOL,           
//             DCB=(*.SORTIN)                                       
//SORTWK01 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SORTWK02 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SORTWK03 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SORTWK04 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SORTWK05 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SORTWK06 DD  UNIT=SYSDA,SPACE=(CYL,(500,100),RLSE)                 
//SYSIN    DD  *                                                     
 SORT FIELDS=(133,5,CH,A,138,3,CH,A,141,3,CH,A)                     
 OUTFIL FNAMES=SORTFL1                                               
     OMIT COND=((133,5,CH,EQ,C'H6717'),OR,(133,5,CH,EQ,C'H7254'),OR,
            (133,5,CH,EQ,C'H9016'),OR,(133,5,CH,EQ,C'H9418'),OR,     
            (133,11,CH,EQ,C'H2320004001'),OR,                       
            (133,11,CH,EQ,C'H2320004002'),OR,                       
            (133,11,CH,EQ,C'H2320004003'),OR,                       
            (133,11,CH,EQ,C'H2320005001'),OR,                       
            (133,11,CH,EQ,C'H2320005002'),OR,                       
            (133,11,CH,EQ,C'H2320005003'),OR,                       
            (133,11,CH,EQ,C'H5849001001'),OR,                       
            (133,11,CH,EQ,C'H5849001002'),OR,                       
            (133,11,CH,EQ,C'H5849001003'))                           
 OUTFIL FNAMES=SORTFL2,SAVE                                         
/*
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 12:00 am    Post subject:
Reply with quote

Hello,

Well, you posted 2 out of 3. .
Quote:
Please post all of the jcl, control info, and output info from the sort step.
All of the output info from the sort step, please.

Is there some reason the sort control info changes from post to post?

All of the info posted needs to be from the same run. . .
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 12:20 am    Post subject:
Reply with quote

The OMIT condition will cause all the records other than the records that satisfy the condition to be written into the output file. SAVE will cause the files that were not written into the COND files to be written into this file.

Please check your data to make sure that there are records that satisfy the OMIT condition in the file. Only in that case records will be written into your SORTFL2.

Thanks
Anitha
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Oct 16, 2007 12:22 am    Post subject: Reply to: INCLUDE condition in SORT
Reply with quote

Code:
WER054I  RCD IN    2605279, OUT    2604122           


Just lurking :-)

where did something like 1000 records go ???
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 12:26 am    Post subject:
Reply with quote

Code:

WER045C  END SORT PHASE                                                       
WER055I  INSERT          0, DELETE       1157                                 


Guess this is where the 1000+ records went. But i agree, they should be in the save file. icon_confused.gif
Back to top
View user's profile Send private message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Tue Oct 16, 2007 12:34 am    Post subject:
Reply with quote

Prettymuch what I posted in 3 is the total sort step output.

Again the same as below
Code:

******************************** Top of Data ***********************************
 SYNCSORT FOR Z/OS  1.2.3.0R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCSO
                                                       z/OS   1.7.0             
 PRODUCT LICENSED FOR CPU SERIAL NUMBER 20F9E, MODEL 2084 304              LICEN
 SYSIN :                                                                       
  SORT FIELDS=(133,5,CH,A,138,3,CH,A,141,3,CH,A)                               
  OUTFIL FNAMES=SORTFL1                                                         
      OMIT COND=((133,5,CH,EQ,C'H6717'),OR,(133,5,CH,EQ,C'H7254'),OR,           
             (133,5,CH,EQ,C'H9016'),OR,(133,5,CH,EQ,C'H9418'),OR,               
             (133,11,CH,EQ,C'H2320004001'),OR,                                 
             (133,11,CH,EQ,C'H2320004002'),OR,                                 
             (133,11,CH,EQ,C'H2320004003'),OR,                                 
             (133,11,CH,EQ,C'H2320005001'),OR,                                 
             (133,11,CH,EQ,C'H2320005002'),OR,                                 
             (133,11,CH,EQ,C'H2320005003'),OR,                                 
             (133,11,CH,EQ,C'H5849001001'),OR,                                 
             (133,11,CH,EQ,C'H5849001002'),OR,                                 
             (133,11,CH,EQ,C'H5849001003'))                                     
  OUTFIL FNAMES=SORTFL2,SAVE                                                   
 WER108I  SORTIN   : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
 WER110I  SORTFL1  : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
 WER110I  SORTFL2  : RECFM=FB   ; LRECL=   466; BLKSIZE= 27960                 
 WER045C  END SORT PHASE                                                       
 WER055I  INSERT          0, DELETE       1157                                 
 WER418I  DATASPACE(S) AND/OR HIPERSPACE(S) USED                               
 WER405I  SORTFL1  :  DATA RECORDS OUT    2604122; TOTAL RECORDS OUT    2604122
 WER405I  SORTFL2  :  DATA RECORDS OUT          0; TOTAL RECORDS OUT          0
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
 WER246I  FILESIZE 1,213,520,852 BYTES                                         
 WER054I  RCD IN    2605279, OUT    2604122                                     
 WER072I  NOEQUALS IN EFFECT                                                   
 WER169I  RELEASE 1.2 BATCH 0454 TPF LEVEL 3.0                                 
 WER052I  END SYNCSORT - M3CQSOT1,STEP1,,DIAG=F900,FB5B,C01A,A4DD,A1F6,4CE3,8348
 ******************************* Bottom of Data ********************************
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 12:47 am    Post subject:
Reply with quote

Hello,

FWIW, the same thing happens on this system.

I've used different input, but have tried many combinations of control statements and the SAVE never does. . . The SAVE can be the first OUTFIL or some other, but no records are written to that dataset. Also tried FILES with the same result.

The data seems to get "lost" after this. . .
Code:
WER055I  INSERT          0, DELETE       nnn
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 12:57 am    Post subject:
Reply with quote

I tried to do this and SAVE worked for me. Am i doing something different?
Code:
//SORT1  EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                     
//SORTF1  DD DSN=ABC.SORTF1,DISP=(NEW,CATLG,DELETE),
//         DCB=(RECFM=FB),SPACE=(CYL,(1,1),RLSE)           
//SORTF2  DD DSN=ABC.SORTF2,DISP=(NEW,CATLG,DELETE),
//         DCB=(RECFM=FB),SPACE=(CYL,(1,1),RLSE)           
//SORTIN DD *                                               
SURESH  98347385385933987 PULI                             
KRISHN  30495849572938495 MADHU                             
MOHANK  13342345345345345 RAJEEV                           
RAMESH  67575789769876785 MADHU                             
SURESH  98347385385933987 PULI                             
ARAMES  34535345325354324 SURESH                           
KRISHN  50830948530859340 PULID                             
MOHANK  23423423434534344 KIRAN                             
/*                                                         
//SYSIN    DD *                                             
 SORT FIELDS=(1,6,CH,A)                                     
 OUTFIL FNAMES=SORTF1,OMIT=(27,4,CH,EQ,C'PULI')             
 OUTFIL FNAMES=SORTF2,SAVE               
/*


The output files were as follows:
ABC.SORTF1 had the following records
Code:
ARAMES  34535345325354324 SURESH
KRISHN  30495849572938495 MADHU
MOHANK  13342345345345345 RAJEEV
MOHANK  23423423434534344 KIRAN
RAMESH  67575789769876785 MADHU


ABC.SORTF2 had the following records
Code:
KRISHN  50830948530859340 PULID
SURESH  98347385385933987 PULI
SURESH  98347385385933987 PULI


Just wanted to check, can you try this with EQUALS option on?
Code:
SORT FIELDS=(1,6,CH,A),EQUALS


Thanks
Anitha
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Oct 16, 2007 1:04 am    Post subject:
Reply with quote

annujp wrote:
I tried to do this and SAVE worked for me. Am i doing something different?
Could you post you sysout?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 1:08 am    Post subject:
Reply with quote

Thanks Anitha,

This
Code:
OMIT COND=((133,5,CH,EQ,C'H6717'
is the problem with the sort that does not work.

Unfortunately, it just runs incorrectly rather than throwing an error. The COND= is the problem. As Anitha's job shows OMIT= is what should be used.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 1:13 am    Post subject:
Reply with quote

Hello Anitha,

Quote:
Just wanted to check, can you try this with EQUALS option on?

Code:
SORT FIELDS=(1,6,CH,A),EQUALS


I'm not sure i understand the question.
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 1:13 am    Post subject:
Reply with quote

Code:
SYSIN :                                                                       
 SORT FIELDS=(1,6,CH,A),EQUALS                                                 
 OUTFIL FNAMES=SORTF1,OMIT=(27,4,CH,EQ,C'PULI')                               
 OUTFIL FNAMES=SORTF2,SAVE                                                     
                         
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER110I  SORTF1   : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920                 
WER110I  SORTF2   : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920                 
WER045C  END SORT PHASE                                                       
WER418I  DATASPACE(S) AND/OR ZSPACE USED                                       
WER405I  SORTF1   :  DATA RECORDS OUT          5; TOTAL RECORDS OUT          5
WER405I  SORTF2   :  DATA RECORDS OUT          3; TOTAL RECORDS OUT          3                                         
WER416B  OUTFIL WAS USED FOR SORTOUT                                         
WER246I  FILESIZE 640 BYTES                                                   
WER054I  RCD IN          8, OUT          8                                   
WER072I  EQUALS IN EFFECT                 


Here u go....guess i am doing something different from the others. icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 1:16 am    Post subject:
Reply with quote

Hello Anitha,

Quote:
guess i am doing something different from the others


Yes, you are. You are doing it correctly. What we were submitting was incorrect.

Please look back at page 1 of this topic icon_smile.gif
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 1:18 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello Anitha,

Quote:
Just wanted to check, can you try this with EQUALS option on?

Code:
SORT FIELDS=(1,6,CH,A),EQUALS


I'm not sure i understand the question.


MSTP's sysout says NOEQUALS ON. I thought turning EQUALS option ON would make a difference.

I tried with both EQUALS and NOEQUALS on. Both times it worked.
Sorry if i caused more confusion.

Thanks
Anitha
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Tue Oct 16, 2007 1:18 am    Post subject:
Reply with quote

Thanks Dick. Guess this issue is closed icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 1:20 am    Post subject: Reply to: INCLUDE condition in SYNCSORT
Reply with quote

You're welcome icon_smile.gif

You didn't cause confusion - you provided the solution icon_biggrin.gif

d
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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