Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Modifying a records of a file using input from another file

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

New User


Joined: 02 Jun 2006
Posts: 5

PostPosted: Wed Sep 20, 2006 3:23 pm    Post subject: Modifying a records of a file using input from another file
Reply with quote

I have two files (file 1 & file 2) a below. I want to modify only last two bytes of file 2 to 95 in the places of 00. But changes in file 2 only to record keys found in file 1.
Files are FB.

Many Thanks.


File 1:
AAAAA
CCCC
FFFFFFF


File 2:
10AAAAAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
10BBBBBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
10CCCCCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
10EEEEEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
10FFFFFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
10DDDDDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00
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: Wed Sep 20, 2006 8:17 pm    Post subject:
Reply with quote

In file1, you have five A's, four C's and seven F's. In file2, you have 5 A's, five C's and five F's. It's not clear which of these you consider a match and which you don't. Please clarify.

What is the starting position and length of the "key" in file1? What is the starting position and length of the "key" in file2?

What is the RECFM and LRECL of file1 and file2?

Show the output you expect for the example input records you showed.
Back to top
View user's profile Send private message
balaa

New User


Joined: 02 Jun 2006
Posts: 5

PostPosted: Thu Sep 21, 2006 3:07 pm    Post subject: Modifying a records of a file using input from another file
Reply with quote

I am very sorry for not giving the out all information in first instance.
Please disregard my previous post.

I have two files (file 1 & file 2) a below. I want to modify only last two bytes of file 2 to 95 in the places of 00. But changes in file 2 only to record keys found in file 1.


File 1:
AAAAA
CCCCC
FFFFF

File1, sequential file of Lrecl = 50 and recfm = FB, key position = 1 key length = 5.

File 2:
10AAAAA- 66 bytes of other info- 00
10BBBBB- 66 bytes of other info- 00
10CCCCC- 66 bytes of other info- 00
10EEEEE- 66 bytes of other info- 00
10FFFFF- 66 bytes of other info- 00
10DDDDD- 66 bytes of other info- 00

File2, sequential file of lrecl = 100 and recfm = FB, key position = 3 key length = 5.


Output should be
10AAAAA- 66 bytes of other info- 95
10BBBBB- 66 bytes of other info- 00
10CCCCC- 66 bytes of other info- 95
10EEEEE- 66 bytes of other info- 00
10FFFFF- 66 bytes of other info- 95
10DDDDD- 66 bytes of other info- 00

Keys should match

Many Thanks
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: Thu Sep 21, 2006 9:33 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed that 00/95 is in positions 99-100 (the last two bytes of the file2 records). Since you want your records in their original order rather than sorted by the key, we need an extra SORT operator.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/50)
//IN2 DD DSN=...  input file2 (FB/100)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/100)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(3,5,CH) -
  KEEPNODUPS WITH(1,98) WITH(101,8)
SORT FROM(T2) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(3:1,5,99:C'95',101:8X)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(101:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  SORT FIELDS=(101,8,ZD,A)
  OUTREC BUILD=(1,100)
/*
Back to top
View user's profile Send private message
balaa

New User


Joined: 02 Jun 2006
Posts: 5

PostPosted: Fri Sep 22, 2006 2:05 pm    Post subject: Re: Modifying a records of a file using input from another f
Reply with quote

Many Thanks for the solution. It is very much appreciated.

Thanks Again
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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts VSAM File free space sancraig16 JCL & VSAM 13 Fri Mar 30, 2018 1:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us