IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Match two files, replace


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 13, 2012 3:56 am
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 Developer


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

PostPosted: Fri Jan 13, 2012 4:14 am
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: 1702
Location: Australia

PostPosted: Fri Jan 13, 2012 4:26 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top