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: 6966
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: 6966
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: 2422
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: 6966
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: 2422
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
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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