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

Replace Record using Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Mon Mar 24, 2008 1:50 am
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Mar 24, 2008 9:36 am
Reply with quote

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
View user's profile Send private message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Mon Mar 24, 2008 9:47 am
Reply with quote

Hi.
Can you please guide me with the code please.

thanks
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Mon Mar 24, 2008 11:04 am
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Mar 24, 2008 12:27 pm
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Mar 25, 2008 11:06 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Mar 26, 2008 12:58 am
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
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 Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top