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 

matching record - different occurrence on same record
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 24, 2007 3:22 pm    Post subject: Reply with quote

radkrish,

Try this job.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//DFSMSG   DD SYSOUT=*                                     
//TOOLMSG  DD SYSOUT=*                                     
//IN1      DD DSN=your input file,
//            DISP=SHR                                     
//IN2      DD DSN=Your lookup mesg code file,
//            DISP=SHR                                     
//T1       DD DSN=&T1,DISP=(MOD,PASS),SPACE=(CYL,(x,y),RLSE)
//T2       DD DSN=&T2,DISP=(MOD,PASS),SPACE=(CYL,(x,y),RLSE)
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SORT FROM(IN2) USING(CTL1)                               
  COPY FROM(IN1) USING(CTL2)                               
  SPLICE FROM(T1) TO(T2) ON(347,4,CH) WITH(1,321) WITHALL   
  SORT FROM(T2) USING(CTL3)                                 
//CTL1CNTL DD *                                             
  SORT FIELDS=(1,4,CH,A)                                   
  OUTFIL FNAMES=T1,                                         
  OUTREC=(321X,11,25,1,9)                                   
//CTL2CNTL DD *                                             
  OUTREC FIELDS=(1,700,SEQNUM,8,ZD)                         
  OUTFIL FNAMES=T1,                                         
  OUTREC=(1,313,701,8,25X,314,9,/,                         
          1,313,701,8,25X,323,9,/,                         
          1,313,701,8,25X,332,9,/,                         
          1,313,701,8,25X,341,9,/,                         
          1,313,701,8,25X,350,9)                           
//CTL3CNTL DD *                                             
  SORT FIELDS=(314,8,CH,A)                                 
  OUTFIL FNAMES=OUT,                                       
  OUTREC=(1,313,347,9,322,25)                               
/*


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


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Fri May 25, 2007 11:19 am    Post subject: Reply with quote

Thanks, Kolusu. The descriptions are coming correctly.

Additionally, I have incuded logic to remove records which are not having error records. Its easily done and adjuted header record too. Iam trying to find the missing 2nd character in the resultant file.

Code:
fileA   no       date ind   msgcod    msg1 

100054,000, ,20070503,N,    BBBB     ,a1hieved ydt
100054,000, ,20070503,N,    AAAA     ,k2256 is missing
100054,000  ,20071503,N,    CCCC     ,r2sult set to NO 

2ND CHAR - 1,2,2 ... i understood the logic. I will try for it.
my reqd format in my post is below :
Code:
9----+----0----+----1----+----2----+----3----+-
fileA   no       date ind   msgcod    msg1 

100054,000, ,20070503,N,    BBBB     ,achieved ydt
                            AAAA     ,k1256 is missing

100054,000  ,20071503,N,    AAAA     , k1256 is missing
                            CCCC     , result set to NO

i.e. If Error message is repeatetive then entire record should be written only once and error message and error code alone are written for the repeatetive valid occurence of error.

By matching "file-a" field am trying to move spaces for more than one occurence of detail record and write only error code and error description. you can also provide if you have any easier option than this.

Thanks for all your replies.
regds,
radkrish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri May 25, 2007 11:28 am    Post subject: Reply with quote

radkrish,

Just change ctl2cntl to the following

Code:

//CTL2CNTL DD *                                             
  OUTREC FIELDS=(1,700,SEQNUM,8,ZD)                         
  OUTFIL FNAMES=T1,                                         
  OUTREC=(1,313,701,8,25X,314,9,/,                         
          313X,701,8,25X,323,9,/,                         
          313X,701,8,25X,332,9,/,                         
          313X,701,8,25X,341,9,/,                         
          313X,701,8,25X,350,9) 


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


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Fri May 25, 2007 3:09 pm    Post subject: Reply with quote

Thanks, Kolusu. My requirement is satisfied now, though one concern.
But Iam getting the following order.
Code:
                             AAAA     ,k1256 is missing
100054,000, ,20070503,N,    BBBB     , achieved ydt
                            CCCC     , result set to NO
100054,000  ,20071503,N,    AAAA     , k1256 is missing
                           


I tried to do sorting. either it arranges by spaces or thru ascending order of file-a fields... the logical result is fine. But the display should be like required format. Iam bit confused to re-arrange it so that first line contains detailed followed by repeatetion of messages.
New record should start at the begining and then followed by its own messages.

required :
Code:

100054,000, ,20070503,N,    BBBB     ,achieved ydt
                            AAAA     ,k1256 is missing

100054,000  ,20071503,N,    AAAA     , k1256 is missing
                            CCCC     , result set to NO


regds,
radkrish
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri May 25, 2007 6:06 pm    Post subject: Reply with quote

radkrish,

Please post your JCL - we would like to see if you changed something which affected the sort sequence. I believe that Kolusu's control cards would work the way you want.

Thanks,
Phantom
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sat May 26, 2007 2:23 am    Post subject: Reply with quote

not just the JCL - the control cards as well!
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 29, 2007 12:48 pm    Post subject: Reply with quote

Thanks for all your replies.

Here Iam pasting the ACTUAL jcl with control cards.

Code:
//STEP0100 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN1      DD DSN=ACTMP.SNV.BR10A,
//            DISP=SHR
//IN2      DD DSN=ACTMP.SNV.DESCER,
//            DISP=SHR
//T1       DD DSN=&T1,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//T2       DD DSN=&T2,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//OUT      DD DSN=ACTMP.CSA.OUT,
//            DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(10,10),RLSE)
//TOOLIN   DD *
  SORT FROM(IN2) USING(CTL1)
  COPY FROM(IN1) USING(CTL2)
  SPLICE FROM(T1) TO(T2) ON(347,4,CH) WITH(1,321) WITHALL
  SORT FROM(T2) USING(CTL3)
//CTL1CNTL DD *
  SORT FIELDS=(1,4,CH,A)
  OUTFIL FNAMES=T1,
  OUTREC=(321X,11,25,1,9)
//CTL2CNTL DD *
  OUTREC FIELDS=(1,700,SEQNUM,8,ZD)
  OUTFIL FNAMES=T1,
  OUTREC=(1,313,701,8,25X,314,9,/,
            313X,701,8,25X,323,9,/,
            313X,701,8,25X,332,9,/,
            313X,701,8,25X,341,9,/,
            313X,701,8,25X,350,9)
//CTL3CNTL DD *
  SORT FIELDS=(314,8,CH,A)
  OUTFIL FNAMES=OUT,
  OUTREC=(1,313,347,9,322,25)
/*
//


which code controls the order?

regds,
radkrish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 29, 2007 1:52 pm    Post subject: Reply with quote

radkrish,

I am guessing that you are missing the option EQUALS parm. Change CTL3CNTL to the following

Code:

//CTL3CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(314,8,CH,A)
  OUTFIL FNAMES=OUT,
  OUTREC=(1,313,347,9,322,25)
/*


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


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 29, 2007 2:00 pm    Post subject: Reply with quote

you are right! i followed your previous code. As I was concentrating much on control card 2 for this problem, I didn't check 3.

Now it works well, Kolusu.
Thanks for all your replies.

Thanks again!
regds,
radkrish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 29, 2007 2:17 pm    Post subject: Reply with quote

Quote:

you are right! i followed your previous code. As I was concentrating much on control card 2 for this problem, I didn't check 3.

Now it works well, Kolusu.
Thanks for all your replies.


Rakrish,

My shop has defaulted to OPTION EQUALS. So I never had to code it explicitly. So I keep forgetting to code it. I only look into the code when someone complains that it is not working. Crying or Very sad

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Wed May 30, 2007 2:14 am    Post subject: Reply with quote

Hi Rakrish,

i think you can acheive this using the JOIN option

(Left out join)

Regards,
Venkata Apparao Jajula
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 30, 2007 4:43 am    Post subject: Reply with quote

Quote:

i think you can acheive this using the JOIN option (Left out join)

jajularamesh,

what is a left out Join? which sort product supports it?

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Wed May 30, 2007 5:31 am    Post subject: Reply with quote

Sorry kolusu
The scenario is like Left outer join.
For the same kind of requirement i got this from this forum only


JOINKEYS FILES=F1,FIELDS=(30,3,A)
JOINKEYS FILES=F2,FIELDS=(1,3,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,40,F2:10,30)

Regards,
Venkata Apparao Jajula
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 30, 2007 6:38 am    Post subject: Reply with quote

Quote:

Sorry kolusu
The scenario is like Left outer join.
For the same kind of requirement i got this from this forum only


jajularamesh,

I was aware of the JOIN feature of syncsort, but I was wondering about the left outer join. Even with join feature you would still need 2 passes of the data. DFSORT does NOT support join feature and radkrish has only DFSORT at his shop.

Kolusu
_________________
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
Goto page Previous  1, 2
Page 2 of 2

 
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