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
 

 

Replace a field in one file with filed in other file usng S.

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

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Fri Jan 18, 2008 3:01 pm    Post subject: Replace a field in one file with filed in other file usng S.
Reply with quote

Can anybody help in completing this task. its urgent

i have 2 files

FILEA - (VB, LRCL=5917) Key = 1st 11 bytes + 5bytes from 25th position
FILEB - (FB, LRCL=80) Key = 1st 11 bytes + 5bytes from 13th position

there are no duplicates in input files.
FILEB may not contain all the keys which are there in FILEA

i need to compare FILEA and FILEB and wherever key matches

the 8byte field starting at postion 31 in FILEA is need to be replaced with 8byte field starting at position 20 in FILEB.

in short my output file should contain all the records of FILEA with one field updated from FILEB.

sample inputs

FILEA:

00000018001 02342 100000S ---------
00000018002 02342 200000K -------
00000018003 02342 300000K -------
00000018004 02342 400000F -------
00000018005 02342 500000F -------
00000018006 02342 600000F -----
00000018007 02342 700000G -------
00000018008 02342 800000F -------
00000018009 02342 900000D -----
00000018010 02342 100000F ------

FILEB:

00000018001 02342 111111A
00000018002 02342 222222B
00000018003 02342 333333C
00000018004 02342 444444D
00000018005 02342 555555E
00000018010 02342 111111F

Outputfile:

00000018001 02342 111111A ---------
00000018002 02342 222222B -------
00000018003 02342 333333C -------
00000018004 02342 444444D -------
00000018005 02342 555555E -------
00000018006 02342 600000F -----
00000018007 02342 700000G -------
00000018008 02342 800000F -------
00000018009 02342 900000D -----
00000018010 02342 111111F ------
[/code]
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 18, 2008 11:33 pm    Post subject:
Reply with quote

Sri,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...  input file1 (VB/5917)
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (VB/5917)
//TOOLIN DD *
COPY FROM(IN2) USING(CTL1)
SPLICE FROM(CON) TO(OUT) ON(5,11,CH) ON(29,5,CH) VLENMAX -
  KEEPNODUPS WITH(35,8)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,FTOV,BUILD=(1:1,11,25:13,5,31:20,8)
/*
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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