View previous topic :: View next topic
|
Author |
Message |
Unique
New User
Joined: 10 Jul 2007 Posts: 24 Location: Blore
|
|
|
|
Hi
I have a requirement to replace the first record using syncsort. I have 2 input file, File1 and File2 .
File1
HEADERUAT2RECORD
File 2
HEADERTESTRECORD
DATA1 NAME1
DATA2 NAME2
DATA3 NAME3
DATA4 NAME4
After Replacing the file2 should be
File2
HEADERUAT2RECORD
DATA1 NAME1
DATA2 NAME2
DATA3 NAME3
DATA4 NAME4
Can you please guide. Should i use merge and Is it possible to do the same in a step using syncsort ?
Regards |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
Is it possible to do the same in a step using syncsort ? |
Though Im not an expert in SYNCSORT, I believe you can get your requirement usign 'synctool',
Simple solution is to use the combination of STOPAFT & STARTREC statements. |
|
Back to top |
|
|
Unique
New User
Joined: 10 Jul 2007 Posts: 24 Location: Blore
|
|
|
|
Hi.
Can you please guide me with the code please.
thanks |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Hi,
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
HEADERUAT2RECORD
/*
//IN2 DD *
HEADERTESTRECORD
DATA1 NAME1
DATA2 NAME2
DATA3 NAME3
DATA4 NAME4
/*
//OUT1 DD DSN=OUTPUT-FILE-NAME,
// DSORG=PS,RECFM=FB,SPACE=(CYL,(999,999),RLSE),VOL=(,,,10),
// DISP=(MOD,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1)
COPY FROM(IN2) TO(OUT1) USING(SRT1)
/*
//SRT1CNTL DD *
OPTION COPY
OMIT COND=(1,6,CH,EQ,C'HEADER')
/*
|
Output:
Code: |
HEADERUAT2RECORD
DATA1 NAME1
DATA2 NAME2
DATA3 NAME3
DATA4 NAME4
|
--Parag |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Unique,
Parag made an assumption that file1 contains only one record. May be modify his logic bit to get your thing. Also remember the provided code use ICETOOL.
You may search the forum for SYNCTOOL examples. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
murmohk1 wrote: |
Also remember the provided code use ICETOOL.
You may search the forum for SYNCTOOL examples. |
Just a note,
PGM=ICETOOL should work in a SyncSort environment as well. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
PGM=ICETOOL should work in a SyncSort environment as well. |
To clarify, since people get very confused about this:
If you are using DFSORT, PGM=ICETOOL invokes DFSORT's ICETOOL. For complete documentation on DFSORT's ICETOOL, see:
Use [URL] BBCode for External Links
If you are using Syncsort, PGM=ICETOOL invokes Syncsort's undocumented SYNCTOOL (Syncsort ships ICETOOL as an alias for SYNCTOOL). |
|
Back to top |
|
|
|