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 & reject records in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replace & reject records in SORT
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 07, 2010 9:21 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 07, 2010 10:00 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Replace & reject records in SORT
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    Post subject:
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    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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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