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 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 22, 2007 12:10 pm    Post subject: matching record - different occurrence on same record Reply with quote

I want to expand the message msg1,msg2 by matching it in the second file.
first file
Code:

9----+----0----+----1----+----2----+----3----+-
fileA   no       date ind       msg1  msg2
100054,000, ,20070503,N,       ,BBBB , AAAA    ,
100054,000  ,20071503,N,       ,AAAA , CCCC   ,
100054,000  ,20071503,N,       ,BBBB ,AAAA ,
100054,000  ,20072503,Y,       ,VVVV ,     ,
100054,000  ,20071503,Y,       ,MMMM ,     ,
100054,000  ,20070503,N,       ,QQQQ ,     ,


second file
Code:
90----+----1----+----2----+----3----+-
msgcod    msg1 

AAAA     , k1256 is missing
BBBB     , achieved ydt
CCCC     , result set to NO

DDDD , invalid pro code


[/code]

result :


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


[/code]



Totally msg codes are 5. msg1 to msg5. Some rows have only one msg1 . some may have all the five.
Using splice, I matched for one error code per record. But more than one matching for the same record, can anyone let me know how to handle this in DFSORT

hope iam clear in my query.
thanks.
Back to top
View user's profile Send private message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 22, 2007 12:15 pm    Post subject: Reply with quote

Code:
----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----
fileA   no       date ind   msg1     msg1 desc             msg2        msg2 desc          msg3    mesg3 desc 

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

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


It can also have this format. either of the two formats are fine.

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


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

PostPosted: Tue May 22, 2007 12:28 pm    Post subject: Reply with quote

radkrish,

1. what is the lrecl and recfm of the input datasets

2. what is the pos & format of the key to be matched in both files.

3. Is easytrieve an option ? What is the total record count in file 2 which has the message description?

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 22, 2007 1:36 pm    Post subject: Reply with quote

Input record - first file

Total Recl = 700, RCFM = FB

MSG-CD1 starts at 314 - 4 char
MSG-CD2 starts at 323 - 4 char
MSG-CD3 starts at 332 - 4 char
MSG-CD4 starts at 341 - 4 char
MSG-CD5 starts at 350 - 4 char


Code:
-+----2----+----3----+----4----+----5----+----6----+---
******** Top of Data **********************************
MSG-CD1 ,MSG-CD2 ,MSG-CD3 ,MSG-CD4 ,MSG-CD5 ,
AAAA    ,BBBB    ,DDDD    ,EEEE    ,        ,
BBBB    ,DDDD    ,AAAA    ,        ,        ,
AAAA    ,        ,        ,        ,        ,
DDDD    ,CCCC    ,CCCC    ,        ,   
,




second file
RECORD COUNT = 455 rows
recl = 80
rcfm = FB
msg cod starts at position 1 having 4 char size
msg description starts at 11 and has 25 char size

Code:
0----+----1----+----2----+----3----+-
msgcode    msg description 

AAAA     ,k1256 is missing
BBBB     ,achieved ydt
CCCC     ,result set to NO
DDDD     ,DEW set to NO


msg-cd(from 1 to 5) in first file should be matched with msgcode(pos 1,4) in second file and picks msg description(pos 9,25) and paste it in the first file correspondingly.

Intention is to expand each MSG-CD in file 1 with respect to matching file2 description.

Any possible format which looks understandable is fine.
Easytrieve can also be an option. Preferrably, would like to have in our DFSORT utilities.

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


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

PostPosted: Tue May 22, 2007 2:32 pm    Post subject: Reply with quote

Quote:

Easytrieve can also be an option. Preferrably, would like to have in our DFSORT utilities.

radkrish,

In this case easytrieve is the BEST option. One pass of data and you got all your code descriptions, where as with sort you atleast 2 passes

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 22, 2007 2:42 pm    Post subject: Reply with quote

fine, Kolusu. I will try to implement the same.
Please provide me the best option.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 22, 2007 3:04 pm    Post subject: Reply with quote

radkrish,

Try this untested ezt solution. I took an existing example and changed it around.

Code:

//STEP0100 EXEC PGM=EZTPA00                       
//STEPLIB  DD DSN=EASYTREV.LOADLIB,     
//            DISP=SHR                             
//EZTVFM   DD UNIT=SYSDA,SPACE=(CYL,(50,50),RLSE) 
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SYSSNAP  DD SYSOUT=*                             
//SYSUDUMP DD SYSOUT=*                             
//INFILE   DD DSN=your input file,
//            DISP=SHR                             
//MSGCODE  DD DSN=Your 455 rec file,
//            DISP=SHR
//OUTFILE  DD DSN=your output file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE),
//            DCB=(LRECL=500,RECFM=FB,BLKSIZE=0)   
//SYSIN    DD *                     
 
 FILE INFILE                                                 
      IN-REC                     001 313 A                   
      IN-MSG-CODES               314 009 A OCCURS 5 INDEX IDX
       I-MSG-CD  IN-MSG-CODES        004 A                   
       I-FIL1    IN-MSG-CODES   +004 005 A                   
                                                             
 FILE MSGCODE TABLE                                         
      ARG                        001 004 A                   
      DESC                       011 025 A                   
                                                             
                                                             
 FILE OUTFILE FB(0 0)                                       
      OUT-REC                    001 313 A                   
      OUT-MSG-CODES              314 035 A OCCURS 5         
        O-MSG-CD OUT-MSG-CODES       004 A                   
        O-FIL1   OUT-MSG-CODES  +004 005 A                   
        O-DESC   OUT-MSG-CODES  +009 025 A                   
        O-FIL2   OUT-MSG-CODES  +034 001 A                   
                                                             
 W-SEARCH-CODE               W  04 A                         
 W-MESG-DESC                 W  25 A                         
                                                             
****************************************************************
* PROCESSES AREA                                               *
****************************************************************
                                                               
 JOB INPUT INFILE                                               
                                                               
     OUT-REC             = IN-REC                               
     PERFORM GET-DESC                                           
     PUT OUTFILE                                               
                                                               
 GET-DESC. PROC                                                 
                                                               
     IDX = 1                                                   
     DO UNTIL IDX > 5                                           
                                                               
        W-SEARCH-CODE    = ' '                                 
        W-MESG-DESC      = ' '                                 
        W-SEARCH-CODE    = I-MSG-CD (IDX)                       
                                                               
        IF W-SEARCH-CODE > ' '                                 
           SEARCH MSGCODE WITH W-SEARCH-CODE, GIVING W-MESG-DESC
        END-IF                                                 
                                                               
        O-MSG-CD(IDX)    = I-MSG-CD (IDX)                       
        O-FIL1  (IDX)    = I-FIL1   (IDX)                       
        O-DESC  (IDX)    = W-MESG-DESC                         
        O-FIL2  (IDX)    = ','                                 
                                                               
        IDX              = IDX + 1                             
     END-DO                                                     
                                                               
 END-PROC                                                       
                                                               
/*


Hope this helps...

Cheers

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 22, 2007 3:23 pm    Post subject: Reply with quote

Thanks for the solution, Kolusu.
I have used EZACFSM1 in this shop to create time stamp &HR &MIN.....
But Iam not able to find the loadlib and the program EZTPA00. Trying to locate the loadlib. Not sure its applicable in our side.

Iam not able to issue the loadlib and the ezetrieve program.
Please help.

Thanks for all your help.

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


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

PostPosted: Tue May 22, 2007 3:34 pm    Post subject: Reply with quote

Quote:

I have used EZACFSM1 in this shop to create time stamp &HR &MIN.....
But Iam not able to find the loadlib and the program EZTPA00. Trying to locate the loadlib. Not sure its applicable in our side

radkrish,

EZACFSM1 has got nothing to do with EASYTRIEVE. Easytrieve is a reporting tool/language and it is a CA-product. I don't know how your easytrieve is set up in your shop.

Does your shop even have easytrieve installed? When I asked the question about easytrieve you said it is OK. Did you run any easytrieve programs before ?

Kolusu

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 22, 2007 3:39 pm    Post subject: Reply with quote

I misunderstood that if the program name starts with EZ then easytrieve.
how to check whether it is set up in my shop?
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: Tue May 22, 2007 3:52 pm    Post subject: Reply with quote

Well...talk to your colleagues or search for the keyword EZTPA00 in all your Prod JCL / Proc libraries.

Thanks,
Phantom
Back to top
View user's profile Send private message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 22, 2007 4:04 pm    Post subject: Reply with quote

Hi Phantom,

I searched all libraries, but no luck on it. didn't get any usefull information from them. It seems that they haven't come across such requirement and haven't used it before on their own.

would like to get help here. If you have DFSORT logic, I will try that too.

Thanks
regds,
radkrish
Back to top
View user's profile Send private message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Wed May 23, 2007 9:55 am    Post subject: Reply with quote

Pls let me know is it possible in DFSORT techniques.

thanks.
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: Wed May 23, 2007 12:46 pm    Post subject: Reply with quote

Radkrish,

I do not have DFSORT in my shop and I'm a bit outdated with the features of SPLICE. Frank / Kolusu would definitely be able to help you out.

Frank / Kolusu....Could you please answer this query.

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


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

PostPosted: Wed May 23, 2007 1:54 pm    Post subject: Reply with quote

Quote:

Frank / Kolusu....Could you please answer this query.


Frank is on vacation and I am too lazy too code it. Confused
_________________
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 1, 2  Next
Page 1 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