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

Syncsort - Splitting Files based on a condition


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

New User


Joined: 18 Sep 2009
Posts: 4
Location: india

PostPosted: Thu Sep 09, 2010 12:36 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Sep 09, 2010 12:57 pm
Reply with quote

Which sort product are you using and which release level
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 1:19 pm
Reply with quote

expat wrote:
Which sort product are you using and which release level


JCL SORT, what else?
Back to top
View user's profile Send private message
ArunKoshy

New User


Joined: 18 Sep 2009
Posts: 4
Location: india

PostPosted: Thu Sep 09, 2010 1:22 pm
Reply with quote

expat wrote:
Which sort product are you using and which release level


SYNCSORT ..Don't know about the release level.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Sep 09, 2010 1:24 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 1:30 pm
Reply with quote

Quote:
Then post the output from a very simple run of sort - below


ABC
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Sep 09, 2010 1:32 pm
Reply with quote

Thats new for me, Dick making jokes. icon_confused.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 2:01 pm
Reply with quote

Peter,
you err if you think that I am making jokes.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Sep 09, 2010 2:09 pm
Reply with quote

LOL Dick, i should have known better. icon_eek.gif
Back to top
View user's profile Send private message
ArunKoshy

New User


Joined: 18 Sep 2009
Posts: 4
Location: india

PostPosted: Thu Sep 09, 2010 3:14 pm
Reply with quote

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 icon_smile.gif ..
Its SYNCSORT FOR Z/OS 1.3.2.1R
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Sep 09, 2010 9:37 pm
Reply with quote

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
View user's profile Send private message
ArunKoshy

New User


Joined: 18 Sep 2009
Posts: 4
Location: india

PostPosted: Tue Sep 14, 2010 9:36 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Sep 14, 2010 9:41 am
Reply with quote

Hello,

Suggest you send Alissa a PM or an e-mail at the e-address in her signature.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top