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
 

 

how to overwrite a filed in the record using DFSORTorICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: how to overwrite a filed in the record using DFSORTorICETOOL
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

Site Director


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

PostPosted: Tue Aug 28, 2007 7:13 pm    Post subject:
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 Moderator


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

PostPosted: Tue Aug 28, 2007 7:42 pm    Post subject:
Reply with quote

BRKS,

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

http://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    Post subject:
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    Post subject:
Reply with quote

Frank Yaeger wrote:
BRKS,

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

http://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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 31, 2007 4:03 am    Post subject:
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    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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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