View previous topic :: View next topic |
Author |
Message |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Thu Jan 22, 2009 8:58 am Post subject: copy matching and its next record - Syncsort. |
|
|
Hi,
The input data set looks like below. It's LRECL=80 and RECFM=FB.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
0000016138800000NA132009 000002303070000100000230307000013ZX62 000100
0000016138800000NB11+C1U +LE5 +MN5 +NE1 +UE0 +U2J +VQ2 +VX7 +1FL +75U +83B
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +20U
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +70U
0000016138800000NA132009 000002303070000100000230307000019ZG61 000100
0000016138800000NB11+C1U +LE5 +MN5 +NE1 +UE0 +U2J +VQ2 +VX7 +1FL +75U +83B
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +71U
|
Requirement: Copy all the records that have "8SL28" starting at 67th column and its next 1 record. I want the outupt data as shown below:
Code: |
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +20U
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +70U
0000016138800000NA162009 000001896240000100000189624000018SL28 000100
0000016138800000NB11+C1U +C60 +LAX +MX0 +NE1 +PCM +VQ2 +VX7 +1SB +14C +71U
|
Our shop is using SYNCSORT FOR Z/OS 1.2.3.1R. Please help me to get it.
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
amargulies Beginner
Joined: 10 Jan 2007 Posts: 123 Topics: 0
|
Posted: Thu Jan 22, 2009 12:49 pm Post subject: |
|
|
This can be easily accomplished in SyncSort for z/OS 1.3.2 :
Code: | //SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:67,5))
SORT FIELDS=COPY
OUTFIL OUTREC=(1,80),INCLUDE=(81,5,CH,EQ,C'8SL28') |
I would recommend that you upgrade to the current release of SyncSort. _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Fri Jan 23, 2009 3:47 am Post subject: |
|
|
Alissa, I have contacted my managers and it is told that they have no plans for any upgrade. I even told them that it will be a free upgrade but the answer was no.
I request if there is other possible way to achieve the same.
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Sun Jan 25, 2009 10:31 am Post subject: |
|
|
Ok. I have achieved it at last without the need of WHEN=GROUP. I thought it is suitable to only my requirement and is not a generic one.
Quote: |
Copy 1st lines to a separate file
Copy 2nd lines to a separate file
Do Join keys based on matching field to club both 1st and 2nd line into a single record
Copy only required records (67,5,ch,eq,c'8SL28').
Split the single record into two halves using (1,80,/,81,80)
|
I have not understood why using ",/," with OUTREC FIELDS fails !!! It had to be used only with OUTFIL.
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Jan 27, 2009 5:28 am Post subject: Corrected Procedure. |
|
|
Here is the corrected procedure.
Quote: |
Copy 1st lines to a separate file with a SEQNUM
Copy 2nd lines to a separate file with a SEQNUM
Do Join keys based on matching field (SEQNUM) to club both 1st and 2nd line into a single record
Copy only required records (67,5,ch,eq,c'8SL28').
Split the single record into two halves using (1,80,/,81,80) excluding the SEQNUM.
|
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
|
|