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

replacing a character using SYNCSORT.


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

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Jan 13, 2006 12:15 pm
Reply with quote

Syncsort experts,

I have the following data in a file:

ABCD#FGHIJKLMNOPQRSTUVWXYZ

wherever I find # then that should be replaced with 'E'.

How to achieve this in SYNCSORT? Any help please.

Thanks in advance.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Fri Jan 13, 2006 12:22 pm
Reply with quote

How many records do u have ?
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Jan 13, 2006 12:28 pm
Reply with quote

I kept 100 records in the input file.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Fri Jan 13, 2006 12:40 pm
Reply with quote

Hi,

Do u want that to be done in syncsort or any other way is also ok.

The other way is open the file in edit mode and type on the command line

Code:
C ALL '#' 'E'


This on of the simple way....

Thanks,
Gau
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Jan 13, 2006 1:30 pm
Reply with quote

Thanks for the idea !!

We need to implement this in a job that runs in PROD region. I can't edit the PROD files with my id. We are looking towards a solution that works for some time (as long as data comes in like that).

Any help?
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Fri Jan 13, 2006 2:52 pm
Reply with quote

Hi,

Try this Job, this Job will change the Char '#' in the 5 th Position to 'E',

If the match is not found then it will copy the Record as it is. Please let

me know if any concerns.

//JobA JOB (U,1091),'aaaa',CLASS=0,MSGCLASS=J,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//S1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A.B.PS,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1,4,5,1,
CHANGE=(1,C'#',C'E'),NOMATCH=(5,1),
6,74)
/*

Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Jan 13, 2006 6:01 pm
Reply with quote

Hi Suganthy,

It worked out very well........

Yeah.....the copying of remaining records can be handled by OMIT !?

Thanks a lot.
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Jan 13, 2006 6:03 pm
Reply with quote

Hi Suganthy,

By the way, what can be changed to suit to replace any character in the 5th position?

Please suggest.

Thanks once again.
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Wed Jan 18, 2006 6:16 pm
Reply with quote

We can also use the following File-aid batch job to replace the character.

//*
//STEP01 EXEC PGM=FILEAID
//*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//*
//DD01 DD DSN=INPUT.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.FILE,DISP=OLD
//*
//SYSIN DD *
$$DD01 COPY RA=(5,5,C'#',C'E')
//*

Provided if File-Aid is there in their shop. Just another way of doing it. icon_wink.gif

HTH
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts String has hex character need to conv... COBOL Programming 3
No new posts Output LREC based on specific character DFSORT/ICETOOL 22
Search our Forums:

Back to Top