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
 

 

Match two files, replace

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sudib19

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Fri Jan 13, 2012 3:36 am    Post subject: Match two files, replace
Reply with quote

Hi,

I have two fixed block files of length 492. I want to match the two files, if from the positions 142 of length 51 position 322 of length 66 and position 452 of lenght 1 match then replace from the first file to the second the 37th position record of length 10.

I want to have the same number of records in the output file as of the second file, just that the 37th position onwards till 10 bytes it is replaced from the first record.

I had coded it as follows but am not getting my numbers right. Can someone please let me know where I am going wrong?

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1    DD DSN=XX.XX#123.file1,DISP=SHR
//IN2    DD DSN=XX.XX#123.file2,DISP=SHR
//MATCH   DD DSN=XX.XX#123.JOIN1,
//             UNIT=(SYSDA,6),
//             SPACE=(CYL,(50,50),RLSE),
//             DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
//             DISP=(NEW,CATLG,DELETE)
//*            DISP=(OLD)
//ELNMTCH DD DSN=XX.XX#123.JOIN2,
//             UNIT=(SYSDA,6),
//             SPACE=(CYL,(50,50),RLSE),
//             DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
//             DISP=(NEW,CATLG,DELETE)
//GASNMCH DD DSN=XX.XX#123.JOIN3,
//             UNIT=(SYSDA,6),
//             SPACE=(CYL,(50,50),RLSE),
//             DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
//             DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
  OPTION COPY
  JOINKEYS F1=IN1,FIELDS=(142,51,A,322,66,A,452,1,A)
  JOINKEYS F2=IN2,FIELDS=(142,51,A,322,66,A,452,1,A)
  JOIN UNPAIRED
  REFORMAT FIELDS=(F1:01,492,F2:01,492,?,F2:01,36,F1:37,10,F2:47,446)
  OUTFIL FNAMES=MATCH,INCLUDE=(985,1,CH,EQ,C'B'),BUILD=(986,492)
  OUTFIL FNAMES=ELNMTCH,INCLUDE=(985,1,CH,EQ,C'2'),BUILD=(493,492)
  OUTFIL FNAMES=GASNMCH,INCLUDE=(985,1,CH,EQ,C'1'),BUILD=(1,492)
/*


In the next step I am using ICETOOL to get the duplicates out of ELNMTCH and then combining with MATCH file. I was expecting the count to match exactly with that of the IN2 file, but unfortunately it does not.

Please help.
Thanks
Sudip
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: Fri Jan 13, 2012 3:56 am    Post subject:
Reply with quote

Hello,

It may help if you post all of the informational messages (including the message ids) from the run that gave the undesired output.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 13, 2012 4:14 am    Post subject:
Reply with quote

Quote:
I had coded it as follows but am not getting my numbers right. Can someone please let me know where I am going wrong?


Which numbers do you think are not right? What do you think the right numbers should be? Are your output records as expected?

Posting the messages won't tell us what you did wrong unless we understand what you're trying to do and what you think is not working.

It would help if you'd explain more clearly what it is you want to do so we could see if you're doing it right.

Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 13, 2012 4:26 am    Post subject:
Reply with quote

Hi,

do you have duplicate records in either file ?


Gerry
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Match records - scdinesh DFSORT/ICETOOL 6 Wed Feb 22, 2017 5:02 am
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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