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

Replace & reject records in SORT


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

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Thu Jan 07, 2010 9:03 pm
Reply with quote

Hi,

I have a file as below:

0003 0004 0005 0012 20100108000604
0002 0004 0005 0012 20100108005804
0004 0004 0005 0012 20100108016704
0005 0004 0005 0012 20100108051704
0003 0004 0005 0012 20100108055904
0003 0004 0005 0012 20100108065004
0006 0004 0005 0012 20100108065704
0007 0004 0005 0012 20100108066504
0008 0004 0005 0012 20100108066604

The first 4 bytes wherever its 0003 i want to replace with 0050 and the before replacing want to write that records to another rejection file.
i.e.
Input: Data file
Output1: Data file with records replaced
Output2: Backup of the records replaced

Please help.

Thanks,
Nirmal
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 07, 2010 9:21 pm
Reply with quote

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


You also need to provide more detail than you already have.

What is the DSORG, RECFM & LRECL of the input file.
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Thu Jan 07, 2010 9:38 pm
Reply with quote

Hi Expat,

Its a SYNCSORT only, that's the reason i posted in JCL.
DSORG=PS
RECFM=8000
LRECL=80

Thanks,
Nirmal
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 07, 2010 10:00 pm
Reply with quote

kedianirmal wrote:
Its a SYNCSORT only, that's the reason i posted in JCL.

No offence intended, but a whole lot of people post in the wrong forum and other people spend time giving a solution that will not work because either the product is wrong, or they are given a solution for a different release level.

Which release of SYNCSORT do you have installed, as that too may affect the viable solutions.
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Thu Jan 07, 2010 10:16 pm
Reply with quote

Hope this will help:
SYNCSORT FOR Z/OS 1.3.1.1R
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Thu Jan 07, 2010 11:35 pm
Reply with quote

Hi,
Try this one.
Code:

//PS020    EXEC PGM=SORT                             
 //SYSOUT   DD  SYSOUT=*                             
 //TOOLMSG  DD  SYSOUT=*                             
 //DFSMSG   DD  SYSOUT=*                             
 //SORTIN   DD  *                                     
 0003 0004 0005 0012 20100108000604                   
 0002 0004 0005 0012 20100108005804                   
 0004 0004 0005 0012 20100108016704                   
 0005 0004 0005 0012 20100108051704                   
 0003 0004 0005 0012 20100108055904                   
 0003 0004 0005 0012 20100108065004                   
 0006 0004 0005 0012 20100108065704                   
 0007 0004 0005 0012 20100108066504                   
 0008 0004 0005 0012 20100108066604                   
 //SORTOFBK DD  DSN=XX.T1,                       
 //             DISP=(,CATLG,DELETE),                 
 //             UNIT=SYSDA,                           
 //             SPACE=(CYL,(1,1),RLSE)               
 //SORTOFCH DD  DSN=XX.T2,                       
 //             DISP=(,CATLG,DELETE),                 
 //             UNIT=SYSDA,                           
 //             SPACE=(CYL,(1,1),RLSE)               
 //SYSIN    DD  *                                     
    SORT FIELDS=COPY                                 
    OUTFIL  FILES=BK,                                 
    INCLUDE=(1,4,CH,EQ,C'0003')                       
    OUTFIL  FILES=CH,                                 
   INCLUDE=(1,4,CH,EQ,C'0003'),OUTREC=(C'0050',5,30)
 



Thanks
Krishy
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri Jan 08, 2010 5:00 pm
Reply with quote

Thanks a lot. Its working fine.
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top