View previous topic :: View next topic
|
Author |
Message |
ArunKoshy
New User
Joined: 18 Sep 2009 Posts: 4 Location: india
|
|
|
|
Hi,
I have a Single file wherein I have records of 2 different Items seperated by HEADER and TRAILER .
My reqt is to seperate out these into different files based on header Ie all CAR Detail recs into a file and all BIKE detail recs onto another .
Below is the sample input layout. First byte represents record type, ie. 0=HEADER,2=DETAIL,9=TRAILER.
02CAR
2370000000000000 SMPL1
2370000000000000 SMPL2
2370000000000000 SMPL3
9201007160000000
02BIKE
2370000000000000 SMPL4
2370000000000000 SMPL5
2370000000000000 SMPL6
9201007160000000
How Do I proceed with the sort?
Thanks,
Arun |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Which sort product are you using and which release level |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
expat wrote: |
Which sort product are you using and which release level |
JCL SORT, what else? |
|
Back to top |
|
|
ArunKoshy
New User
Joined: 18 Sep 2009 Posts: 4 Location: india
|
|
|
|
expat wrote: |
Which sort product are you using and which release level |
SYNCSORT ..Don't know about the release level. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then post the output from a very simple run of sort - below
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Then post the output from a very simple run of sort - below |
ABC |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Thats new for me, Dick making jokes. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Peter,
you err if you think that I am making jokes. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
LOL Dick, i should have known better. |
|
Back to top |
|
|
ArunKoshy
New User
Joined: 18 Sep 2009 Posts: 4 Location: india
|
|
|
|
expat wrote: |
Then post the output from a very simple run of sort - below
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
Got the Release details ..
Its SYNCSORT FOR Z/OS 1.3.2.1R |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is a SyncSort for z/OS 1.3.2 sort step that will produce the requested output:
Code: |
//SORT1 EXEC PGM=SORT
//SORTIN DD *
02CAR
2370000000000000 SMPL1
2370000000000000 SMPL2
2370000000000000 SMPL3
9201007160000000
02BIKE
2370000000000000 SMPL4
2370000000000000 SMPL5
2370000000000000 SMPL6
9201007160000000
//SORTOF01 DD SYSOUT=*
//SORTOF02 DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'0'),PUSH=(81:3,4))
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(81,4,CH,EQ,C'CAR ',AND,1,1,CH,EQ,C'2'),
BUILD=(1,80)
OUTFIL FILES=02,
INCLUDE=(81,4,CH,EQ,C'BIKE',AND,1,1,CH,EQ,C'2'),
BUILD=(1,80)
/* |
|
|
Back to top |
|
|
ArunKoshy
New User
Joined: 18 Sep 2009 Posts: 4 Location: india
|
|
|
|
Thanks Alissa! That worked beautifully..Do we have any Syncsort manuals containing the new features available? The ones I got from the net didnt have all these. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you send Alissa a PM or an e-mail at the e-address in her signature. |
|
Back to top |
|
|
|