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
 

 

Syncsort - Splitting Files based on a condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Splitting Files based on a condition
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: 8593
Location: Back in jolly old England

PostPosted: Thu Sep 09, 2010 12:57 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 1:19 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Sep 09, 2010 1:24 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 1:30 pm    Post subject:
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu Sep 09, 2010 1:32 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 2:01 pm    Post subject:
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu Sep 09, 2010 2:09 pm    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Thu Sep 09, 2010 9:37 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 14, 2010 9:41 am    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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