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 Record using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replace Record using Syncsort
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: 1439
Location: Bangalore,India

PostPosted: Mon Mar 24, 2008 9:36 am    Post subject:
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    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Mon Mar 24, 2008 12:27 pm    Post subject:
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: 500
Location: USA

PostPosted: Tue Mar 25, 2008 11:06 pm    Post subject:
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 Moderator


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

PostPosted: Wed Mar 26, 2008 12:58 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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