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 

DFSORT include condition
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Thu Mar 05, 2015 8:15 am    Post subject: DFSORT include condition Reply with quote

Hi,

I have DFSORT as follows

Code:

//SORTIN DD DSN=FILE0,DISP=SHR
//SORTOUT1 DD DSN=FILE1,DISP=SHR
//SORTOUT2 DD DSN=FILE2,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY                                                     
OUTFIL FNAMES=SORTOUT1,                                               
       INCLUDE=(5,1,CH,EQ,C'R',OR,5,1,CH,EQ,C'V',OR,5,1,CH,EQ,C'Z')   
OUTFIL FNAMES=SORTOUT2,                                               
       INCLUDE=(18,6,Y2T,GE,Y'DATE1'-750,AND,17,1,CH,EQ,C'2',AND,     
               5,1,CH,NE,C'R',AND,5,1,CH,NE,C'V',AND,5,1,CH,NE,C'Z') 


Finally we are merging this two files into one using following sort, Is it possible to do this in a single sort ?.


Code:

//SORTIN DD DSN=FILE1,DISP=SHR
//            DD DSN=FILE2,DISP=SHR
//SORTOUT DD DSN=FILE3,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY   
SUM FIELDS=NONE     
/*



Please advise.

Thanks
Magesh
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Thu Mar 05, 2015 9:37 am    Post subject: Reply with quote

Hi,

Here is the code i tried, which seems to work
Code:

//SYSIN    DD *                                         
  OPTION COPY                                           
  RECORD TYPE=V                                         
  INCLUDE COND=((18,6,Y2T,GE,Y'DATE1'-750,AND,         
                17,1,CH,EQ,C'2',AND,                   
                5,1,CH,NE,C'R',AND,                     
                5,1,CH,NE,C'V',AND,                     
                5,1,CH,NE,C'Z'),                       
                     OR,                               
               (5,1,CH,EQ,C'R',OR,                     
                5,1,CH,EQ,C'V',OR,                     
                5,1,CH,EQ,C'Z'))                       


Thanks
Magesh
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Mar 05, 2015 12:39 pm    Post subject: Reply with quote

Unless the physical location of the R, V and Z are already discreet from the other data, this will give you different output (records will be in a different order).

On what you have:

Code:
  INCLUDE COND=((5,1,CH,EQ,C'R',
                   OR,                     
                 5,1,CH,EQ,C'V',
                   OR,                     
                 5,1,CH,EQ,C'Z'),
               OR,                               
                (17,1,CH,EQ,C'2',
                   AND,
                 18,6,Y2T,GE,Y'DATE1'-750))


Swapping the test of 5.1 removes the need for negation of that test in the other "leg". Why do the date test, and only then check a simple one-byte value? So reverse, only do the (more complex) date-checking when you know the rest of the test is true.

The test for three values on the same position can be simplified with SS, but...


Last edited by William Collins on Thu Mar 05, 2015 2:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Mar 05, 2015 2:05 pm    Post subject: Reply with quote

William Collins,

I believe that the intention is to drop the records that satisfy the date condition but have 'V' or 'R', or 'Z' in position 5.

for ex: (I moved the dates to position 20 to make it clear from the 17th byte indicator of '2')

Code:

//SORTIN   DD *                 
----+----1----+----2----+----3---
    R           2  130213       
    V           2  130214       
    Z           2  130215       
    A           2  130213       
    B           2  130214       
    C           2  130215       


I think OP wants to pick the last 3 records even though the first 3 also satisfy the date condition.

But the other condition will pull them back again. So I am not really sure as to what OP wants.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Mar 05, 2015 2:33 pm    Post subject: Reply with quote

Kolusu,

In the original first step, there are two OUTFILs each with an INCLUDE=.

First OUTFIL gets just the R. V or Z irrespective of anything else.

Second OUTFIL does the date and 2 selection, but wants to ignore the R, V or Z.

I have only just noticed the names of the OUTFILs Smile

And the SUM FIELDS=NONE on the subsequent COPY step...

So I could have missed anything Smile

The two OUTFIL DSNs are then concatenated. Effectively "sorting" all the R, V and Z to the beginning of the output file, which will include stuff which satisfies and date and 2 checking, followed by non-R, S, V which matches the date and 2 checking.

In one step, that order cannot be produced unless the data on the original input is in that order.

But, the same selection can be done. If it is R. S or V, use it, otherwise if 2 and date, use it.

I've run the original, the new, and my version (correcting the original missing comma, now edited in original) and they produce the same output (all records selected) in the same order (since your data allows for that).

Yes, something else could be wanted...
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Fri Mar 06, 2015 8:30 am    Post subject: Reply with quote

Thanks Willam and Kolusu,

Code sugested by you is workng good. Only once challenge we have is records are not in same sequence.

Code:

INCLUDE COND=((5,1,SS,EQ,C'R,V,Z'),     
                     OR,                 
              (17,1,CH,EQ,C'2',AND,     
               18,6,Y2T,GE,Y'DATE1'-750))


Which can be handled.

Thanks
Magesh
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Fri Mar 06, 2015 8:46 am    Post subject: Reply with quote

If you are trying to reduce resource use, you could consider just concatenating your two files each time you need the one logical file, rather than copying to one, and rather than dealing with the change in order.

Code:

//STEP1 EXEC PGM=APPLCTN
//DATAFILE DD DSN=dsn-from-first-OUTFIL...
//         DD DSN=dsn-from-second-OUTFIL...


If retaining something of the original code, please change the DDnames of the OUTFILs. You should not prefix anything with SORT.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Mar 06, 2015 12:11 pm    Post subject: Reply with quote

Magesh_J wrote:

Code sugested by you is workng good. Only once challenge we have is records are not in same sequence.


Magesh_J,

If you are just writing to a single output file, I don't think the sequence of the records change. Are you seeing a different sequence when writing to a single file?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Mon Mar 09, 2015 8:50 am    Post subject: Reply with quote

Kolusu,

I think i miss communicated, In Current jcl when we compare sortout1 and sortout2 with single sort condition, the sequence mismatch. i.e. current jcl sortout1 and sortout2 will have different sequence of records, when compare to single sort condition.

also please advise why sortout1 and sortout2 should not be used ?

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


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

PostPosted: Mon Mar 09, 2015 10:47 am    Post subject: Reply with quote

Magesh_J wrote:
Kolusu,

I think i miss communicated, In Current jcl when we compare sortout1 and sortout2 with single sort condition, the sequence mismatch. i.e. current jcl sortout1 and sortout2 will have different sequence of records, when compare to single sort condition.


Magesh_J,

Ideally I would remove the 2 OUTFIL processing and go with a single step using INCLUDE COND. By doing so you are avoiding the out of sequence issue as well avoiding multiple passes of data.

Magesh_J wrote:

also please advise why sortout1 and sortout2 should not be used ?
Magesh


I don't remember giving any such advise. You can use them without any issue.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Tue Mar 10, 2015 5:37 am    Post subject: Reply with quote

Thanks Kolusu,

Could you please advise,is there any option parameter we can pass to below sort step to improve CPU.

Code:

//STEP01   EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SYSUDUMP DD SYSOUT=*                                   
//SORTDIAG DD DUMMY                                     
//SYSPRINT DD SYSOUT=*                                   
//SORTIN   DD DSN=VSAMFILE,DISP=SHR,   
//         AMP='BUFND=34'                               
//SORTOUT  DD DSN=TAPEFILE,       
//            DISP=(,CATLG,DELETE),                     
//            UNIT=CART                                 
//*                                                     
//SYSIN    DD *
  OPTION COPY                               
  RECORD TYPE=V                             
  INCLUDE COND=((5,1,SS,EQ,C'R,V,Z'),       
                       OR,                 
                (17,1,CH,EQ,C'2',AND,       
                 18,6,Y2T,GE,Y'DATE1'-750))
                                         


Code:

1ICE805I 1 JOBNAME: AAAAAAAA , STEPNAME: STEP01
 ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
 ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5
 ICE168I 0 CENTURY WINDOW FOR Y2 FORMAT FIELDS IS FROM 1935 TO 2034
 ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 EE-K51707 E9-K60823 C9-BASE   E5-K62201 E7-K62201
 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 02:43 ON TUE MAR 10, 2015 -
0            OPTION COPY
             RECORD TYPE=V
             INCLUDE COND=((5,1,SS,EQ,C'R,V,Z'),
                                  OR,
                           (17,1,CH,EQ,C'2',AND,
                            18,6,Y2T,GE,Y'DATE1'-750))
 ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5
 ICE168I 0 CENTURY WINDOW FOR Y2 FORMAT FIELDS IS FROM 1935 TO 2034
 ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 EE-K51707 E9-K60823 C9-BASE   E5-K62201 E7-K62201
 ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
 ICE088I 0 AAAAAAAA.STEP01  .        , INPUT LRECL = 616, BLKSIZE = 22528, TYPE = V
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
 ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG
 ICE130I 0 OPTIONS: RESALL=8192,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
 ICE235I 0 OPTIONS: NULLOUT=RC0
 ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
 ICE084I 1 VSAM ACCESS METHOD USED FOR SORTIN
 ICE889I 0 CT=MAX     , SB=241, L=0, D=0000, CCW=1MAM
 ICE902I 0 O MZ11  I RP10
 ICE751I 1 EF-K49535 F0-K66716 E8-K61438
 ICE900I 0 CON=1,MUV=1,VOL=1,ENU=0,SBK=0,SRC=0,VEM=0
 ICE090I 0 OUTPUT LRECL = 616, BLKSIZE = 32760, TYPE = VB   (SDB)
 ICE055I 0 INSERT 0, DELETE 73766271
 ICE054I 0 RECORDS - IN: 99328824, OUT: 25562553
 ICE891I 1 6283496 WMAIN, 7960 CMAIN, MAX CALLOC, N SCN, B BA, 0 AZ, 0 BZ, NY QC, 0 CZ, 0 DZ, 1 PLE
 ICE892I 1 616 RIN  620 BLI  32760 BLO  613 RUN  0 BUN  2818 CPU  00 CVC
 ICE804I 1 SORTOUT  EXCP COUNT: 3613
 ICE052I 0 END OF DFSORT


Input VSAM File

Code:

1IDCAMS  SYSTEM SERVICES                                           TIME: 15:56:46        06/23/14     PAGE      1
0
    LISTCAT ENT('VSAMFILE') ALL
0CLUSTER ------- VSAMFILE
      IN-CAT --- CATALOG.VOLUXXX
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2014.172
        RELEASE----------------2     EXPIRATION------0000.000
      SMSDATA
        STORAGECLASS ---STANDARD     MANAGEMENTCLASS-PRODVSAM
        DATACLASS ------XTNDADDR     LBACKUP ---0000.000.0000
        EATTR-------------(NULL)
        BWO STATUS------00000000     BWO TIMESTAMP---00000 00:00:00.0
        BWO---------------(NULL)
      RLSDATA
        LOG ----------------(NULL)   RECOVERY REQUIRED --(NO)     FRLOG ------------(NULL)
        VSAM QUIESCED -------(NO)    RLS IN USE ---------(NO)
0       LOGSTREAMID-----------------------------(NULL)
        RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'
        RECOVERY TIMESTAMP GMT-------X'0000000000000000'
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        DATA-----VSAMFILE.ZZZZZZZZ.DATA
        INDEX----VSAMFILE.ZZZZZZZZ.INDX
0   DATA ------- VSAMFILE.ZZZZZZZZ.DATA
      IN-CAT --- CATALOG.VOLUXXX
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2014.172
        RELEASE----------------2     EXPIRATION------0000.000
        ACCOUNT-INFO-----------------------------------(NULL)
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        CLUSTER--VSAMFILE
      ATTRIBUTES
        KEYLEN----------------27     AVGLRECL--------------80     BUFSPACE-----------49152     CISIZE-------------22528
        RKP--------------------0     MAXLRECL-------------612     EXCPEXIT----------(NULL)     CI/CA-----------------33
        STRIPE-COUNT-----------1
        ACT-DIC-TOKEN----X'4000000A01000540070208FE05FE0DFE0EFE0AFE00000000000000000000000000000000'
        SHROPTNS(2,3)      SPEED     UNIQUE           NOERASE     INDEXED       NOWRITECHK     NOIMBED       NOREPLICAT
        UNORDERED        NOREUSE     NONSPANNED    COMP-FORMT     EXTENDED        EXT-ADDR
      STATISTICS
        REC-TOTAL-------99672605     SPLITS-CI--------------0     EXCPS-------------238518
        REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------3
        REC-INSERTED--------5854     FREESPACE-%CI---------15     SYSTEM-TIMESTAMP:
        REC-UPDATED------------0     FREESPACE-%CA---------10          X'CD586AE157189D08'
        REC-RETRIEVED--299145797     FREESPC-------1523185664
        USER-DATA-SIZE----------------------------24244909162     COMP-USER-DATA-SIZE------------------------9794693864
      ALLOCATION
        SPACE-TYPE------CYLINDER     HI-A-RBA-----13381632000
1IDCAMS  SYSTEM SERVICES                                           TIME: 15:56:46        06/23/14     PAGE      2
0       SPACE-PRI-----------1000     HI-U-RBA-----13044860928
        SPACE-SEC-----------1000
      VOLUME
        VOLSER------------VVSM08     PHYREC-SIZE---------5632     HI-A-RBA-----13381632000     EXTENT-NUMBER----------3
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------9     HI-U-RBA-----13044860928     EXTENT-TYPE--------X'40'
        VOLFLAG------------PRIME     TRACKS/CA-------------15
        EXTENTS:
        LOW-CCHH-----X'00BE0000'     LOW-RBA----------------0     TRACKS-------------15000
        HIGH-CCHH----X'04A5000E'     HIGH-RBA-------743423999
        LOW-CCHH-----X'04E20000'     LOW-RBA--------743424000     TRACKS-------------45000
        HIGH-CCHH----X'1099000E'     HIGH-RBA------2973695999
        LOW-CCHH-----X'38E10000'     LOW-RBA-------2973696000     TRACKS------------210000
        HIGH-CCHH----X'6F90000E'     HIGH-RBA-----13381631999
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
0   INDEX ------ VSAMFILE.ZZZZZZZZ.INDX
      IN-CAT --- CATALOG.VOLUXXX
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2014.172
        RELEASE----------------2     EXPIRATION------0000.000
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        CLUSTER--VSAMFILE
      ATTRIBUTES
        KEYLEN----------------27     AVGLRECL---------------0     BUFSPACE---------------0     CISIZE--------------4096
        RKP--------------------0     MAXLRECL------------4089     EXCPEXIT----------(NULL)     CI/CA-----------------12
        SHROPTNS(2,3)   RECOVERY     UNIQUE           NOERASE     NOWRITECHK       NOIMBED     NOREPLICAT     UNORDERED
        NOREUSE         EXTENDED     EXT-ADDR
      STATISTICS
        REC-TOTAL----------17611     SPLITS-CI--------------0     EXCPS-------------145969     INDEX:
        REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------2     LEVELS-----------------3
        REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:            ENTRIES/SECT-----------5
        REC-UPDATED------------0     FREESPACE-%CA----------0          X'CD586AE157189D08' SEQ-SET-RBA----------------0
        REC-RETRIEVED----------0     FREESPC----------1593344                              HI-LEVEL-RBA---------1245184
      ALLOCATION
        SPACE-TYPE------CYLINDER     HI-A-RBA--------73728000
        SPACE-PRI-------------60     HI-U-RBA--------72134656
        SPACE-SEC-------------20
      VOLUME
        VOLSER------------VVSM08     PHYREC-SIZE---------4096     HI-A-RBA--------73728000     EXTENT-NUMBER----------2
1IDCAMS  SYSTEM SERVICES                                           TIME: 15:56:46        06/23/14     PAGE      3
0       DEVTYPE------X'3010200F'     PHYRECS/TRK-----------12     HI-U-RBA--------72134656     EXTENT-TYPE--------X'40'
        VOLFLAG------------PRIME     TRACKS/CA--------------1
        EXTENTS:
        LOW-CCHH-----X'04A60000'     LOW-RBA----------------0     TRACKS---------------900
        HIGH-CCHH----X'04E1000E'     HIGH-RBA--------44236799
        LOW-CCHH-----X'109A0000'     LOW-RBA---------44236800     TRACKS---------------600
        HIGH-CCHH----X'10C1000E'     HIGH-RBA--------73727999
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
      VOLUME
        VOLSER-----------------*     PHYREC-SIZE------------0     HI-A-RBA---------------0     EXTENT-NUMBER----------0
        DEVTYPE------X'3010200F'     PHYRECS/TRK------------0     HI-U-RBA---------------0     EXTENT-TYPE--------X'FF'
        VOLFLAG--------CANDIDATE     TRACKS/CA--------------0
1IDCAMS  SYSTEM SERVICES                                           TIME: 15:56:46        06/23/14     PAGE      4
0         THE NUMBER OF ENTRIES PROCESSED WAS:
                    AIX -------------------0
                    ALIAS -----------------0
                    CLUSTER ---------------1
                    DATA ------------------1
                    GDG -------------------0
                    INDEX -----------------1
                    NONVSAM ---------------0
                    PAGESPACE -------------0
                    PATH ------------------0
                    SPACE -----------------0
                    USERCATALOG -----------0
                    TAPELIBRARY -----------0
                    TAPEVOLUME ------------0
                    TOTAL -----------------3
0         THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0



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


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

PostPosted: Tue Mar 10, 2015 12:07 pm    Post subject: Reply with quote

Magesh_J wrote:
Thanks Kolusu,

Could you please advise,is there any option parameter we can pass to below sort step to improve CPU.


Magesh_J,

Is there a reason that you chose RECORD TYPE=V ? According to your Listcat info your AVGLRECL is 80 and all of your Include condition fields are within that range. Do you need the Output file to be VB?

Can you try running the following control cards? I changed the control cards to read the VSAM file as RECORD TYPE=F which is the default and adjusted the positions of the INCLUDE condition to remove the RDW length.

Code:

//SYSIN    DD *
  OPTION COPY
  INCLUDE COND=((1,1,SS,EQ,C'R,V,Z'),       
                       OR,                 
                (13,1,CH,EQ,C'2',AND,       
                 14,6,Y2T,GE,Y'DATE1'-750))
   
  OUTFIL FTOV
//*

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


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Wed Mar 11, 2015 2:55 am    Post subject: Reply with quote

Quote:

also please advise why sortout1 and sortout2 should not be used ?


That was me misremembering the manual. Sorry.

I'd still not do it personally, too much tendency for the next reader to think it is something "official" when they look at the JCL Smile

It looks like your KSDS has been read lots of times sequentially. I hope that is not your testing. If not, it would look possible that making it a flat file early would give benefit.

Make yourself a large-ish file with small fixed-length records, then test my INCLUDE against yours.

Where are the usage stats for your index component?[/list]
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Mon Mar 30, 2015 2:18 pm    Post subject: Reply with quote

Hi Kolusu,

Sorry for the delay,

You solution worked greated, CPU reduced great, but exception increased.

Code:

 SDSF OUTPUT DISPLAY JOINKEYS JOB06573  DSID   102 LINE 7       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 10:56 ON MON MA
            OPTION COPY                                                         
            RECORD TYPE=V                                                       
            INCLUDE COND=((5,1,SS,EQ,C'R,V,Z'),                                 
                                 OR,                                           
                          (17,1,CH,EQ,C'2',AND,                                 
                           18,6,Y2T,GE,Y'DATE1'-750))                           

 SDSF OUTPUT DISPLAY JOINKEYS JOB06573  DSID     4 LINE 31      COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
*                                                                               
*  UNIT-T-DDNAME------EXCP CNT---MB TRANSFER  UNIT-T-DDNAME------EXCP CNT---MB T
*  A655   SORTIN        40,060       619.968  A65C   SORTIN        39,716       
*  2577 T SORTOUT        3,552       116.363                                   
*                                                                               
*  EXCP TOTAL          105,088                TOTAL DASD MB TRANSFERS         1,
*                                                                               


 SDSF OUTPUT DISPLAY JOINKEYS JOB06573  DSID     4 LINE 42      COLUMNS 55- 134
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
                                                                               
YSTEM - VERSION 11.0                                                           
                                                                               
                                                                               
CESSFULLY                                                                       
                                                                               
***************************                                                     
*******************************************************************************
                                                                              *
 END TERMINATION REPORTING                                                    *
                                                  HH.MM.SS.TH     MMM.THT     *
   CPU SERVICE    8,537,771     JOB VECTOR TIME   00.00.00.00                 *
   SRB SERVICE       27,298     INIT VECTOR TIME  00.00.00.00                 *
   MSO SERVICE            0     CPU TCB TIME      00.06.58.78       6.979     *
   I/O SERVICE       52,600     CPU SRB TIME      00.00.01.34       0.022     *
   TOT SERVICE    8,617,669     CPU TIME                          386.285     *
                                                                              *
*******************************************************************************



 SDSF OUTPUT DISPLAY JOINKEYS JOB06571  DSID   102 LINE 9       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 10:45 ON MON MA
            OPTION COPY                                                         
            INCLUDE COND=((1,1,SS,EQ,C'R,V,Z'),                                 
                                 OR,                                           
                          (13,1,CH,EQ,C'2',AND,                                 
                           14,6,Y2T,GE,Y'DATE1'-750))       
                   
 SDSF OUTPUT DISPLAY JOINKEYS JOB06571  DSID     4 LINE 31      COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
*                                                                               
*  UNIT-T-DDNAME------EXCP CNT---MB TRANSFER  UNIT-T-DDNAME------EXCP CNT---MB T
*  A655   SORTIN        40,060       619.968  A65C   SORTIN        39,716       
*  2565 T SORTOUT      157,258     5,151.772                                   
*                                                                               
*  EXCP TOTAL          258,794                TOTAL DASD MB TRANSFERS         1,
*                                                                               


 SDSF OUTPUT DISPLAY JOINKEYS JOB06571  DSID     4 LINE 42      COLUMNS 55- 134
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
                                                                               
YSTEM - VERSION 11.0                                                           
                                                                               
                                                                               
CESSFULLY                                                                       
                                                                               
***************************                                                     
*******************************************************************************
                                                                              *
 END TERMINATION REPORTING                                                    *
                                                  HH.MM.SS.TH     MMM.THT     *
   CPU SERVICE    7,846,286     JOB VECTOR TIME   00.00.00.00                 *
   SRB SERVICE       48,143     INIT VECTOR TIME  00.00.00.00                 *
   MSO SERVICE            0     CPU TCB TIME      00.06.24.86       6.414     *
   I/O SERVICE      129,497     CPU SRB TIME      00.00.02.36       0.039     *
   TOT SERVICE    8,023,926     CPU TIME                          356.048     *
                                                                              *



I see another job using the same file, with different include condition.
So i have thought, if we include the same here, then read once, write into two files will save lot of cpu, If that is the case, i think we need to use OUTFIL FNAMES= and INCLUDE as follows. Please advise

Code:

OPTION COPY
OUTFIL FNAMES=FILE1,INCLUDE((5,1,SS,EQ,C'R,V,Z'),     
                     OR,                 
              (17,1,CH,EQ,C'2',AND,     
               18,6,Y2T,GE,Y'DATE1'-750))
OUTFIL FNAMES=FILE2,INCLUDE(18,6,Y2T,GE,Y'DATE1'-750,AND,17,1,CH,EQ,C'2')


Also one more requirement added in the file1 to exclude 'Z' records having SPACES in any of the following fields

338,5,CH,EQ,C' ',OR
346,5,CH,EQ,C' ',OR
354,5,CH,EQ,C' ',OR
362,5,CH,EQ,C' ',OR
370,5,CH,EQ,C' ',OR

Coded below, but the fields are in variable data, Please advise how best we can handle this situation.
Code:

OPTION COPY                                     
OUTFIL FNAMES=FILE1,                             
       INCLUDE((5,1,CH,EQ,C'R',OR,               
                5,1,CH,EQ,C'V',OR,               
                (5,1,CH,EQ,C'Z',AND,             
                 (338,5,CH,NE,C'     ',OR,       
                  346,5,CH,NE,C'     ',OR,       
                  354,5,CH,NE,C'     ',OR,       
                  362,5,CH,NE,C'     ',OR,       
                  370,5,CH,NE,C'     '))),       
                     OR,                         
               (17,1,CH,EQ,C'2',AND,         
                18,6,Y2T,GE,Y'DATE1'-750,AND,
                5,1,CH,NE,C'Z'))             
OUTFIL FNAMES=FILE2,                             
       INCLUDE(18,6,Y2T,GE,Y'DATE1'-750,AND,     
               17,1,CH,EQ,C'2')                 



Thanks for the great support.

Regards
Magesh
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Mon Mar 30, 2015 2:23 pm    Post subject: Reply with quote

I have one doubt, when i test above code, it is taking it as Fixed automatically, Hence changed as below
Code:

SORT FIELDS=COPY                               
OUTFIL FNAMES=SORTOUT1,FTOV,                   
       INCLUDE((1,1,CH,EQ,C'R',OR,             
                1,1,CH,EQ,C'V',OR,             
                (1,1,CH,EQ,C'Z',AND,           
                 (334,5,CH,NE,C'     ',OR,     
                  342,5,CH,NE,C'     ',OR,     
                  350,5,CH,NE,C'     ',OR,     
                  358,5,CH,NE,C'     ',OR,     
                  366,5,CH,NE,C'     '))),     
                     OR,                       
               (13,1,CH,EQ,C'2',AND,           
                14,6,Y2T,GE,Y'DATE1'-750,AND,   
                1,1,CH,NE,C'Z'))               
OUTFIL FNAMES=SORTOUT2,FTOV,                   
       INCLUDE(14,6,Y2T,GE,Y'DATE1'-750,AND,   
               13,1,CH,EQ,C'2')                 


But in prod for below code it is taking it as Variable. Please advise in what way it is considering VB/FB

Code:

ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 21:06 ON FRI M
           SORT FIELDS=COPY                                                   
           OUTFIL FNAMES=SORTOUT1,                                             
                  INCLUDE=(5,1,CH,EQ,C'R',OR,5,1,CH,EQ,C'V',OR,5,1,CH,EQ,C'Z')
           OUTFIL FNAMES=SORTOUT2,                                             
                  INCLUDE=(18,6,Y2T,GE,Y'DATE1'-750,AND,17,1,CH,EQ,C'2',AND,   
                          5,1,CH,NE,C'R',AND,5,1,CH,NE,C'V',AND,5,1,CH,NE,C'Z')
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5                         


Thanks
Magesh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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