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

how to overwrite a filed in the record using DFSORTorICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Tue Aug 28, 2007 6:56 pm
Reply with quote

I want to overwrite the field in a record using the DFSORT or ICETOOL



The Input files are like this

INPUT FILES
File1
aaaaa bbbbb ccccc ddddd 06/08/20
aaaaa bbbbb ccccc ddddd 06/08/22
aaaaa bbbbb ccccc ddddd 06/08/30
aaaaa bbbbb ccccc ddddd 06/08/40

File2
wwwww xxxxx yyyyy zzzzz 07/08/28
wwwww xxxxx yyyyy zzzzz 07/08/27
wwwww xxxxx yyyyy zzzzz 07/08/26
wwwww xxxxx yyyyy zzzzz 07/08/25


OUTPUT FILE should Look like this

File3
aaaaa bbbbbb ccccc dddddd 07/08/28
aaaaa bbbbbb ccccc dddddd 07/08/27
aaaaa bbbbbb ccccc dddddd 07/08/26
aaaaa bbbbbb ccccc dddddd 07/08/25

Please provide the solution any one

Regards,
BRKS
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: Tue Aug 28, 2007 7:13 pm
Reply with quote

Hello,

You need to post more complete example data or explain what you have posted.

What is the relationship between file1 and file2?

What if there is a different number of records in the files?

What are the recfm and lrecl of the records?
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: Tue Aug 28, 2007 7:42 pm
Reply with quote

BRKS,

Take a look at the "Join fields from two files record-by-record" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

and see if you can use the technique described there to do what you want to do.

If not, then please answer Dick's questions.
Back to top
View user's profile Send private message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Wed Aug 29, 2007 9:57 am
Reply with quote

dick scherrer wrote:
Hello,

You need to post more complete example data or explain what you have posted.

What is the relationship between file1 and file2?

What if there is a different number of records in the files?

What are the recfm and lrecl of the records?



Hi Dick and Frank,

Thanks for responding to my query,

There is no relation between the File1 and File2 they two different input files which contains the date filed

The number of records or equal in the files

The Record format is fixed and
File1 LRECL=260 and
File2 LRECL=80 and the date field is at the position 252-260 in file1 and in File2 at 72-80

I want to overwrite the file1 date field with file2 date field the remaning data should be unchanged only the date field should be change.



Regards,
BRKS.
Back to top
View user's profile Send private message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Wed Aug 29, 2007 10:06 am
Reply with quote

Frank Yaeger wrote:
BRKS,

Take a look at the "Join fields from two files record-by-record" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

and see if you can use the technique described there to do what you want to do.

If not, then please answer Dick's questions.


Hi Frank,

Thanks for responding to my query, and for the sorttrck.PDF ,

i have refered the example which Join fields from two files on a key but in this example file2 data is concatinating, but in my requirement i just want to overwrite the date field of file1 with date field of file2 with out appending the file2 data.

Regards,
BRKS.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 10:58 am
Reply with quote

Code:
// EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//FILE1 DD ....
//FILE2 DD ....
//T1 DD DSN=&&T1,DISP=(MOD,PASS)
//OUT DD .....
//TOOLIN DD *
 COPY FROM(FILE1) TO(T1) USING(CTL1)
 COPY FROM(FILE2) TO(T1) USING(CTL2)
 SPLICE FROM(T1) TO(OUT) ON(261,9,ZD) WITH(252,8) USING(CTL3)
//CTL1CNTL DD *
 OPTION COPY
 INREC OVERLAY=(261:SEQNUM,9,ZD)
/*
//CTL2CNTL DD *
 OPTION COPY
 INREC OVERLAY=(252:72,8,261:SEQNUM,9,ZD)
/*
//CTL3CNTL DD *
 OUTREC FIELDS=(1,260)
/*
//
Back to top
View user's profile Send private message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Wed Aug 29, 2007 12:07 pm
Reply with quote

Thanks shankar it is working but there is small change in the CTL3
there is no ouput destination mentioned it is giving severe error

it is
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,260)

Regards,
BRKS
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 4:07 pm
Reply with quote

BRKS,
Quote:
it is working but there is small change in the CTL3
there is no ouput destination mentioned it is giving severe error

Code:
SPLICE FROM(T1) TO(OUT) ON(261,9,ZD) WITH(252,8) USING(CTL3)

The SPLICE itself contains the ddname of the output dataset in TO(OUT) and that's the syntax too.
I tried with the code which i posted. It's working fine.
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 Aug 31, 2007 4:03 am
Reply with quote

BRKS,

I said
Quote:
Take a look at the "Join fields from two files record-by-record" Smart DFSORT Trick


You said
Quote:
i have refered the example which Join fields from two files on a key


You are looking at the wrong trick. I pointed you to the trick for joining record-by-record. You apparently looked at the trick for joining on a key. These are two different tricks. Please look at the one I indicated.

BRKS and Shankar,

BRKS is right about Shankar's job being in error. An OUTREC statement is NOT allowed with SPLICE. You must use an OUTFIL statement. The newer version of DFSORT's ICETOOL will flag an OUTREC statement used with SPLICE as in error. Older versions may appear to work using OUTREC, but there's no guarantee OUTREC will always work, whereas OUTFIL will.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top