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 the file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 1:37 pm    Post subject: SYNCSORT Splitting the file
Reply with quote

I have a file of lrecl 400.

I need to split that into two files where one file should contain all the unique records and the other should contains the rest.
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: Fri Sep 19, 2008 1:45 pm    Post subject:
Reply with quote

What constitutes a duplicate, specific fields or the whole record.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 1:55 pm    Post subject: Reply to: Spliting the file
Reply with quote

Hi,

The following code will help u, and i assumed the key field as (1,9). You can change as ur requirement.

Code:

//GETMATCH EXEC PGM=SYNCTOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                             
310789954 004 836                                           
310789954 004 836                                           
310789954 004 836                                           
310789954 004 836                                           
310789954 004 836                                           
310789954 004 836                                           
242293732 001 836                                           
433679765 004 836                                           
/*                                                         
//OUTDUP   DD SYSOUT=*                                     
//OUTNODUP DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SELECT FROM(IN) TO(OUTNODUP) ON(1,9,CH) NODUPS
  SELECT FROM(IN) TO(OUTDUP) ON(1,9,CH) ALLDUPS                         
/*                                                         


OUTNODUP: Unique records
OUTDUP: Rest

Regards
R KARTHIK
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 1:57 pm    Post subject: Reply to: Spliting the file
Reply with quote

Hi,

The following output i got,

OUTNODUP:
Code:

242293732 001 836           
433679765 004 836         


OUTDUP:
Code:

310789954 004 836   
310789954 004 836   
310789954 004 836   
310789954 004 836   
310789954 004 836   
310789954 004 836           


Regards
R KARTHIK
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Fri Sep 19, 2008 2:27 pm    Post subject:
Reply with quote

Karthik,

You can avoid an additional pass of data by using the DISCARD option in SELECT.
Code:
SELECT FROM(IN) TO(OUTNODUP) ON(5,4,CH) NODUPS DISCARD(OUTDUP)

Thanks,
Arun
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 2:30 pm    Post subject: Reply to: Spliting the file
Reply with quote

Hi Arun,

Ya. U are correct. Thanks for sharing that option.

Regards
R KARTHIK
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 2:54 pm    Post subject:
Reply with quote

hiii all,

Thanks for ur reply.
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:06 pm    Post subject:
Reply with quote

Hi,
I have used the card that u have mentioned here....
But i a,m getting RC = 20 errror thr....

Code:

SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A) 
              NODUPS DISCARD(SORTXSUM)                     


I am still not able to get my result. could any body please help me out.

EXAMPLE :-

INPUT
a
a
b
c
d

OUT1
b
c
d

OUT2
a
a


Thanks in advance .
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: Fri Sep 19, 2008 6:18 pm    Post subject:
Reply with quote

Please clarify which sort product that you are using, DFSORT or SYNCSORT as the solution to your problem may vary depending on the product being used.

Also you have not yet answered my original question in this thread regarding the fields that constitue a duplicate or if we are comparing the whole record.

Please post the JCL that you are using including the control statements.

Unless you help us, we can not help you.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:56 pm    Post subject: Reply to: Spliting the file
Reply with quote

HI,

ON - a field to be used for this operation. From 1 to 10 ON fields can be specified.
– (p,m,f) gives the position, length and format of a numeric or character field.

Change

Code:

SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A) 
              NODUPS DISCARD(SORTXSUM)


To,

Code:

SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH) 
              NODUPS DISCARD(SORTXSUM)


Regards
R KARTHIK
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:59 pm    Post subject: Reply to: Spliting the file
Reply with quote

HI,

To continue the control statement to next line use '-'.

For example,

Code:

SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A)  -
              NODUPS DISCARD(SORTXSUM)


Regards
R. KARTHIK
[/code]
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:59 pm    Post subject:
Reply with quote

Hi,
I dont know exactly but it is SYNCSORT. More over in this thread we are comparing the whole record.

The JCL I m using is

Code:

//SORTIN   DD DSN=file1
//            DISP=SHR                           
//SYSOUT   DD SYSOUT=*                           
//SORTOUT  DD DSN=Out1
//            DISP=(OLD,CATLG,DELETE),           
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(15,15),RLSE),           
//            DCB=*.SORTIN                       
//SORTXSUM DD DSN=Out2
//            DISP=(OLD,CATLG,DELETE),           
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(15,15),RLSE),           
//            DCB=*.SORTIN                       
//SYSIN DD     *                                               
             
          SORT FIELDS=(1,99,CH,A,122,278,CH,A)                   
           SUM FIELDS=NONE,XSUM                                 
/*                                                               



Please let me know if u need any more information for my issue.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Sep 19, 2008 7:01 pm    Post subject: Reply to: Spliting the file
Reply with quote

Hi,

In last post i misused the on fields. Actual code is as follows

Code:

SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH) -
              NODUPS DISCARD(SORTXSUM)


Regards
R KARTHIK
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 7:10 pm    Post subject:
Reply with quote

Hi Karthik,

Thanks for ur reply...
But still i am getting the same RC = 20.
I am not able to find out the reason for the error also.

Do u have any idea for this ??? wt may be the wrong in the JCL ??
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Fri Sep 19, 2008 7:22 pm    Post subject:
Reply with quote

Hi,

I have tried with EXEC PGM=ICETOOL, Got RC = 20
PGM=SYNCTOOL , Got RC = 20
and when i tried using EXEC PGM=SYNCSORT , I got the below error
Code:

DSS11043E  NO SORT OR MERGE CONTROL STATEMENT WAS FOUND
DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'SELECT'.       
DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'NODUPS'.       


Really thanks for your concern regarding this.

Do u have any other technique to achieve my required output.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Fri Sep 19, 2008 7:56 pm    Post subject:
Reply with quote

Siva,
Quote:

wt may be the wrong in the JCL ??

Already the solution for your problem has been posted in this thread. i.e, separating records with duplicates into one file and those without duplicates into another file. you just need to understand that and modify it as per your requirement.

If you are still getting errors, post the run jcl and sysout messages.

Thanks,
Arun
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Sep 20, 2008 12:03 am    Post subject:
Reply with quote

siva102 wrote:

Code:

DSS11043E  NO SORT OR MERGE CONTROL STATEMENT WAS FOUND
DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'SELECT'.       
DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'NODUPS'.       


Are you sure you have SyncSort installed at your site? These do not appear to be SyncSort messages. SyncSort messages are typically WERnnnn and SYNCTOOL messages are SYTnnnn.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Sep 20, 2008 2:57 am    Post subject:
Reply with quote

Those are messages from a product called PRO./JCL (JJSCAN) that scans JCL but doesn't seem to keep up with the latest changes to various products. See this thread for more information:

http://ibmmainframes.com/viewtopic.php?t=33385&highlight=jscan
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Sat Sep 20, 2008 8:02 pm    Post subject:
Reply with quote

Hi Alissa,

I dont know exactly wt type of sort we are having.
Actully i just did QW SORT AND there it shows like SYNCSORT. So i suppose it was a syncsort one.


Thanks for ur concern
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 64
Location: Chennai

PostPosted: Sat Sep 20, 2008 8:09 pm    Post subject:
Reply with quote

Hi Arun,

I had already posted my run JCL here.

I ve posted the error message too there.
Apart from that i could not find anything in my spool.

Arun i ve tried with the SORT card that has been provided to me in this forum, but as per my previous thread i m getting an RC = 20.

As per frank, the error is a PROJCL Scan one.

Could anyone please tell me how to overcome this issue.

Thanks in advance.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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