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

Syncsort - SPLICE only certain info.


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 24, 2013 4:48 pm
Reply with quote

Hi,

I have two records like shown below and want to put info appearing at 65th column (three characters) from 02 rec on to 03 rec. (LRECL = 80, RECFM = FB)

Input:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
02XXX    ABCXXX99VOT   2013102 000999999990000100009999999900001OVRTP 9AB39
03XXX    ABCXXXRAMARAO C MELLI              11 SEVEN ROADS                 


Expected Output:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
02XXX    ABCXXX99VOT   2013102 000999999990000100009999999900001OVRTP 9AB39
03XXX    ABCXXXRAMARAO C MELLI              11 SEVEN ROADS      OVR           


I've tried below SPLICE but don't get expected output icon_sad.gif

Code:

//TOOLIN   DD *                                                   
 SPLICE FROM(IN) TO(OUT) ON(10,6,CH) WITH(65,3) WITHALL KEEPBASE 


Please help.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 24, 2013 5:16 pm
Reply with quote

Ramsri,

Do you have just 2 records in the entire input? If so you could use WHEN=GROUP RECORDS=2 and PUSH the 3 bytes at pos-65
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 24, 2013 5:19 pm
Reply with quote

Arun, thanks......its a big file.......looking for SPLICE way of it.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 24, 2013 5:47 pm
Reply with quote

ramsri wrote:
Arun, thanks......its a big file.......looking for SPLICE way of it.
I believe the 'SPLICE way' is not a part of your requirement.

The initial post just showed 2 records and you wanted to push/propagate one field from record-1 to record-2. If your input file has more than 2 records, then show a sample with more records and do a better way of explaining what exactly you are trying to achieve.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 24, 2013 6:20 pm
Reply with quote

entire file will have 02 and 03 as shown earlier. I kept 03 first followed by 02

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
03XXX    ABCXXXRAMARAO C MELLI              11 SEVEN ROADS                 
02XXX    ABCXXX99VOT   2013102 000999999990000100009999999900001OVRTP 9AB39


and used below TOOLIN

Code:

//TOOLIN   DD *                                 
  SPLICE FROM(IN) TO(OUT) ON(10,6,CH) WITH(65,3)


Output:
Code:

03XXX    ABCXXXRAMARAO C MELLI              11 SEVEN ROADS      OVR


Thanks.

Its working but partially as I could not retain 02 record.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 24, 2013 7:00 pm
Reply with quote

ramsri wrote:
Its working but partially
Someone trying to help you may well be looking for your "expected output", NOT partially working code/output. Your first post showed 02XXX-record followed by 03XXX, where as it just got reversed in your latest post.

Arun Raj wrote:
If your input file has more than 2 records, then show a sample with more records and do a better way of explaining what exactly you are trying to achieve.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 24, 2013 9:37 pm
Reply with quote

Arun, your WHEN=GROUP idea has given me results........thanks a lot.

Code:

//SYSIN    DD *                                   
 OPTION COPY                                       
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(65:65,3))
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 24, 2013 9:52 pm
Reply with quote

Ramsri,

Are you sure about that? It it going to do the PUSH, unconditionally, for every record on your file.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Jul 25, 2013 1:32 pm
Reply with quote

Bill, yes.......ran the job and got expected results too......thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jul 25, 2013 2:55 pm
Reply with quote

Ramsri,

You're welcome.

One of those cases where we could help the TS in arriving at a solution, without having any clue on what the actual requirement was icon_smile.gif . My best guess is that the input file has the above 2-record set repeated through out the file.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 25, 2013 9:26 pm
Reply with quote

Hello,

Suggest you make sure you have used proper data for the test.

There may be some condition(s) that will fail, but haven't been included in the test imput.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Jul 26, 2013 1:44 pm
Reply with quote

.. so.. Wednesday was psychic day this week...

Garry
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts in REXX,how to get sysprt info CLIST & REXX 9
Search our Forums:

Back to Top