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 

Search the Corresponding Field and get the Matching entries

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Dinesh Kumar
Beginner


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Thu Mar 03, 2011 11:20 am    Post subject: Search the Corresponding Field and get the Matching entries Reply with quote

FILE-LAYOUT:

Field Name : Position
Code:

PROCEDURE NAME      :    01 - 08 (Position 1-4 Represents the system name)
STEP-NAME           :    09 - 16
STEP-SEQUENCE-NUMB  :    17 - 19
DD-NAME             :    20 - 27
DATASET-NAME        :    28 - 57
DISPOSITION-CODE    :    58 - 80


INPUT RECORDS:
Code:

TTILD010TTIL184 015I2IL484 TTAA.P.TRN01001(+1)      (,CATLG,CATLG)
TTKKD222TTIL184 015I2IL484 TTAA.P.TRN01001(+1)      (,CATLG,CATLG)
TTBBD340TTIL184 016O1IL484 TTBB.P.IL.TRN18401(+1)       (NEW,CATLG,DELETE)   
TTCCD080TTIL184 018R1IL484 TTCC.P.IL.TRN18401(+1)       (MOD,CATLG,CATLG)
TTEED777TTIL184 018R1IL484 TTCC.P.IL.TRN18401(+1)       (MOD,CATLG,CATLG)
TTZZD010TTIL184P020SYSUT1  TTDD.P.IL.TRN18401(+1)   (NEW,CATLG,DELETE)
TTYYD110TTIL184P020SYSUT1  TTFF.P.IL.TRN18401.FLAT   (NEW,CATLG,DELETE)
TTCCD260TTIL184 017O2IL484 TTAA.P.TRN01001(+0)      SHR          -- File used is created by different system TTIL & TTKK
TTILD111TTIL184O019DD1     TTBB.P.IL.TRN18401(+0)   (OLD,DELETE,KEEP)   -- File used is created by different system TTBB
TTEED260TTIL184 017O2IL484 TTCC.P.IL.TRN18401(-12)     SHR          -- File used is created by different system TTCC as well by same system TTEE(TTEE  entry should be discarded)
TTZZD555TTIL184 015I2IL484 TTDD.P.IL.TRN18401(+0)   (OLD,DELETE,KEEP)   -- File used is created by same system TTZZ hence no entry
TTXXD110TTIL184P020SYSUT1  TTFF.P.IL.TRN18401.FLAT   (OLD,DELETE,KEEP)   -- File used is created by different system TTYY

Expected Output
Code:

Proc-name : Dataset-Name :             Inbound system     
     (GDG version should be discarded)

TTCCD260 TTAA.P.TRN01001           TTIL,TTKK   
TTILD111  TTBB.P.IL.TRN18401        TTBB
TTEED260 TTCC.P.IL.TRN18401        TTCC             
TTXXD110 TTFF.P.IL.TRN18401.FLAT  TTYY



The file layout and the sample records are mentioned as stated above,
Here is my requirement.The file mentioned above has records with the Procedure name, Dataset-name(both GDG and flat file) and the disposition
of the file.I need to take the dataset name which has Disposition as [shr or (old,delete,keep or old ] and
scan against all the records which has the following Disposition as [(new,catlg,delete) or (,catlg.delete) or (MOD,CATLG,CATLG)] and if there
are any entries the corresponding system name should be marked against it(Same system name need not be captured[Starting
4 bytes of PROC represents the system name)

Please let me know the solution the same
_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Mar 03, 2011 12:52 pm    Post subject: Reply with quote

Dinesh Kumar,

Your Output does NOT match the requirements. How did you capture TTIL,TTKK for TTAA.P.TRN01001 dataset when the Disp for them is (,CATLG,CATLG) ? It is not in your match criteria.

The max DSN length is 44 bytes and here you only have a max of 30 bytes. Are you sure that all DSN names are less than or equal to 30 bytes?

Here is a DFSORT JCL which will just give the matched records according to your criteria. I did not show you the method of clubbing the matching records into a single line.

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
TTILD010TTIL184 015I2IL484 TTAA.P.TRN01001(+1)           (,CATLG,CATLG)
TTKKD222TTIL184 015I2IL484 TTAA.P.TRN01001(+1)           (,CATLG,CATLG)
TTBBD340TTIL184 016O1IL484 TTBB.P.IL.TRN18401(+1)        (NEW,CATLG,DELE
TTCCD080TTIL184 018R1IL484 TTCC.P.IL.TRN18401(+1)        (MOD,CATLG,CATL
TTEED777TTIL184 018R1IL484 TTCC.P.IL.TRN18401(+1)        (MOD,CATLG,CATL
TTZZD010TTIL184P020SYSUT1  TTDD.P.IL.TRN18401(+1)        (NEW,CATLG,DELE
TTYYD110TTIL184P020SYSUT1  TTFF.P.IL.TRN18401.FLAT       (NEW,CATLG,DELE
TTCCD260TTIL184 017O2IL484 TTAA.P.TRN01001(+0)           SHR           
TTILD111TTIL184O019DD1     TTBB.P.IL.TRN18401(+0)        (OLD,DELETE,KEE
TTEED260TTIL184 017O2IL484 TTCC.P.IL.TRN18401(-12)       SHR           
TTZZD555TTIL184 015I2IL484 TTDD.P.IL.TRN18401(+0)        (OLD,DELETE,KEE
TTXXD110TTIL184P020SYSUT1  TTFF.P.IL.TRN18401.FLAT       (OLD,DELETE,KEE
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  INCLUDE COND=(58,22,CH,EQ,C'SHR',OR,                                 
                58,22,CH,EQ,C'OLD',OR,                                 
                58,22,CH,EQ,C'(,CATLG,CATLG)',OR,                       
                58,22,CH,EQ,C'(,CATLG,DELETE)',OR,                     
                58,22,CH,EQ,C'(OLD,DELETE,KEEP)',OR,                   
                58,22,CH,EQ,C'(NEW,CATLG,DELETE)',OR,                   
                58,22,CH,EQ,C'(MOD,CATLG,DELETE)')                     
                                                                       
  INREC PARSE=(%01=(ABSPOS=28,ENDBEFR=C' ',ENDBEFR=C'(',FIXLEN=30)),   
  BUILD=(1,80,C'001',%01)                                               
  SORT FIELDS=(84,30,CH,A,1,4,CH,A),EQUALS                             
  SUM FIELDS=(81,3,ZD)                                                 
  OUTFIL OMIT=(81,3,ZD,GT,1),BUILD=(84,30,2X,1,4)                       
//*


The output from this

Code:

TTAA.P.TRN01001                 TTCC
TTAA.P.TRN01001                 TTIL
TTAA.P.TRN01001                 TTKK
TTBB.P.IL.TRN18401              TTBB
TTBB.P.IL.TRN18401              TTIL
TTCC.P.IL.TRN18401              TTEE
TTFF.P.IL.TRN18401.FLAT         TTXX
TTFF.P.IL.TRN18401.FLAT         TTYY

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


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Fri Mar 04, 2011 12:30 am    Post subject: Reply with quote

Thanks Kolusu. Sorry forgot to mention even the Disp (,CATLG,CATLG) also come in match criteria. Is there a way to club the matching records into a single line. Can I have the output as

Code:

Proc Name: Dataset Name         :Inbound system     
TTCCD260 TTAA.P.TRN01001           TTIL,TTKK   
TTILD111 TTBB.P.IL.TRN18401        TTBB
TTEED260 TTCC.P.IL.TRN18401        TTCC             
TTXXD110 TTFF.P.IL.TRN18401.FLAT   TTYY

_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Mar 04, 2011 12:42 am    Post subject: Reply with quote

Dinesh Kumar,

What is the max number of system names you can have for a dataset? What about my other question about the dataset name being 44 bytes?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dinesh Kumar
Beginner


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Fri Mar 04, 2011 4:00 am    Post subject: Reply with quote

Code:
The maximum no of systems for a dataset would be 15 systems . The Dataset field is of 44 bytes but the DSN has a max of 35 bytes.
Please let me know If you need any more information on the same

_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
Dinesh Kumar
Beginner


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Fri Mar 04, 2011 7:21 am    Post subject: Reply with quote

Code:
TTUUD340TTIL184 016O1IL484 TTUU.P.IL.TRN18401(+1)        (NEW,CATLG,DELE    ------ File created is not used anywhere 
TTVVD380TTIL567 016O1IL484 TTVV.P.IL.TRN77701(+0)        SHR                ------ File used is not created anywhere

If the above mentioned scenario exists we should not capture in our output file 
(The maximum no of systems for a dataset would be 15 systems . The Dataset field is of 44 bytes but the DSN has a max of 35 bytes.

_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Mar 04, 2011 1:35 pm    Post subject: Reply with quote

Dinesh Kumar,

Use the following DFSORT control which will give you the desired results

Code:

//SYSIN    DD *                                                       
  INCLUDE COND=(58,22,CH,EQ,C'SHR',OR,                                 
                58,22,CH,EQ,C'OLD',OR,                                 
                58,22,CH,EQ,C'(,CATLG,CATLG)',OR,                     
                58,22,CH,EQ,C'(,CATLG,DELETE)',OR,                     
                58,22,CH,EQ,C'(OLD,DELETE,KEEP)',OR,                   
                58,22,CH,EQ,C'(NEW,CATLG,DELETE)',OR,                 
                58,22,CH,EQ,C'(MOD,CATLG,DELETE)')                     
                                                                       
  INREC PARSE=(%01=(ABSPOS=28,ENDBEFR=C' ',ENDBEFR=C'(',FIXLEN=35)),   
  BUILD=(1,80,C'001',%01)                                             
  SORT FIELDS=(84,35,CH,A,1,4,CH,A),EQUALS                             
  SUM FIELDS=(81,3,ZD)                                                 


  OUTREC IFTHEN=(WHEN=INIT,BUILD=(84,35,75X,81,3,1,8)),               
  IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,35),PUSH=(122:SEQ=3)),               
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,01),                         
          PUSH=(036:114,4,125:114,8)),                               
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,02),PUSH=(041:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,03),PUSH=(046:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,04),PUSH=(051:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,05),PUSH=(056:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,06),PUSH=(061:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,07),PUSH=(066:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,08),PUSH=(071:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,09),PUSH=(076:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,10),PUSH=(081:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,11),PUSH=(086:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,12),PUSH=(091:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,13),PUSH=(096:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,14),PUSH=(101:114,4)),       
  IFTHEN=(WHEN=GROUP,BEGIN=(122,3,ZD,EQ,15),PUSH=(106:114,4)),       
  IFTHEN=(WHEN=(122,3,ZD,EQ,01),OVERLAY=(041:70X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,02),OVERLAY=(046:65X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,03),OVERLAY=(051:60X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,04),OVERLAY=(056:55X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,05),OVERLAY=(061:50X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,06),OVERLAY=(066:45X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,07),OVERLAY=(071:40X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,08),OVERLAY=(076:35X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,09),OVERLAY=(081:30X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,10),OVERLAY=(086:25X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,11),OVERLAY=(091:20X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,12),OVERLAY=(096:15X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,13),OVERLAY=(101:10X)),                   
  IFTHEN=(WHEN=(122,3,ZD,EQ,14),OVERLAY=(106:05X))       

  OUTFIL OMIT=(111,3,ZD,GT,1),REMOVECC,NODETAIL,BUILD=(125X),       
  HEADER1=('PROC NAME:',16:'DATASET NAME:',51:'INBOUND SYSTEM',/,   
           '==========',16:'=============',51:'=============='),   
  SECTIONS=(1,35,TRAILER3=(125,8,7X,1,35,36,75))                   
//*

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


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Sun Mar 06, 2011 10:56 pm    Post subject: Reply with quote

Code:
Thanks a lot query. Will the above solution work if the DSN has the following set of records. The scenario is mentioned below

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
TTFFD010TTIL184 015I2IL484 TTAA.B.TRN01001(+1)           (,CATLG,CATLG)
TTGGD222TTIL184 015I2IL484 TTAA.B.TRN01001(+1)           (,CATLG,CATLG)
TTBBD340TTIL184 016O1IL484 TTAA.B.TRN01001(+0)           SHR
TTBBD990TTIL184 018R1IL484 TTAA.B.TRN01001(+0)           SHR


Proc Name: Dataset Name         :Inbound system     
TTBBD340 TTAA.B.TRN01001          TTFF,TTGG   
TTBBD990 TTAA.B.TRN01001          TTFF,TTGG   
     

_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Sun Mar 06, 2011 11:11 pm    Post subject: Reply with quote

Dinesh Kumar wrote:
Will the above solution work if the DSN has the following set of records. The scenario is mentioned below


Dinesh Kumar,

How much time does it take to run a test with the control cards provided and know the result for yourself?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dinesh Kumar
Beginner


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Mon Mar 07, 2011 3:41 am    Post subject: Reply with quote

My shop has DFSORT V1R10 , it throwed out an error "OPERAND DEFINER ERROR" for
Code:

                  IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,35),PUSH=(122:SEQ=3)),
                                     $
ICE006A 0 OPERAND DEFINER ERROR
 

_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Mar 07, 2011 11:22 am    Post subject: Reply with quote

Dinesh Kumar,

Looks like your shop does NOT have the PTF H which supports keybegin Operand.

Change the following statement on OUTREC
Code:

IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,35),PUSH=(122:SEQ=3)),     


to

Code:

IFTHEN=(WHEN=INIT,OVERLAY=(122:SEQNUM,3,ZD,RESTART=(1,35))), 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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