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

SYNCSORT Splitting the file


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

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 1:37 pm
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: 8796
Location: Welsh Wales

PostPosted: Fri Sep 19, 2008 1:45 pm
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
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
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: 2481
Location: @my desk

PostPosted: Fri Sep 19, 2008 2:27 pm
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
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: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 2:54 pm
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: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:06 pm
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: 8796
Location: Welsh Wales

PostPosted: Fri Sep 19, 2008 6:18 pm
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
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
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: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 6:59 pm
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
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: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 7:10 pm
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: 63
Location: Chennai

PostPosted: Fri Sep 19, 2008 7:22 pm
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: 2481
Location: @my desk

PostPosted: Fri Sep 19, 2008 7:56 pm
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: 496
Location: USA

PostPosted: Sat Sep 20, 2008 12:03 am
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 Developer


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

PostPosted: Sat Sep 20, 2008 2:57 am
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:

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: 63
Location: Chennai

PostPosted: Sat Sep 20, 2008 8:02 pm
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: 63
Location: Chennai

PostPosted: Sat Sep 20, 2008 8:09 pm
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
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Sep 20, 2008 8:47 pm
Reply with quote

Quote:
I have tried with EXEC PGM=ICETOOL, Got RC = 20


In case it helps, for DFSORT's ICETOOL, RC=20 is issued if you do not have the //TOOLMSG DD.

If that's not the problem, then i suggest you show your complete JCL for the SELECT job. I'm guessing you set it up wrong.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Sat Sep 20, 2008 10:05 pm
Reply with quote

Hi,
siva102 wrote:
I dont know exactly wt type of sort we are having.
Check the SYSOUT of some SORT JOB, if the messages appear there are of type ICExxxx then your shop make use of DFSORT & if messages are of type WERxxxx it's SyncSort. Both of these are competitive products and on this portal they are discussed under different forums. Syncsort falls under JCL forum & DFSORT question are discussed in DFSORT & ICETOOL forum.

Quote:
Actully i just did QW SORT AND there it shows like SYNCSORT.
MVS/QuickRef product is like "tutorial" it would contain a general information, it's not the right place to get such information.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Sep 21, 2008 12:18 am
Reply with quote

Hello,

If this is still not working, please post all of the jcl and sort control statements for this step as well as the all of the information created by the step (including the message ids) when the step was executed.

Use copy/paste and the "Code" tag to post this info. Do not post the messages from JJ or some other jcl-check tool.
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Mon Sep 22, 2008 11:48 am
Reply with quote

Hi all,

Thanks to Dick and Frank. The RC = 20 error has been resolved.

Now the JCL runned successfully but the output remains the same. Please chk the JC that i runned,
Code:

//******* JOB ('TEST'),MSGCLASS=O,CLASS=T,NOTIFY=&SYSUID       
//*STEP1    EXEC PGM=SORT                                       
//STEP1    EXEC PGM=ICETOOL                                     
//SORTIN   DD DSN=Input File,
//            DISP=SHR                                         
//SYSOUT   DD SYSOUT=*                                         
//DFSMSG   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                                     
//TOOLMSG  DD SYSOUT=*                                         
//TOOLIN   DD *   
     SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH) -
              NODUPS DISCARD(SORTXSUM)                           
/*                                                                                                           
If my file is having 3 duplicate records then one record is going to OUT1 and the other two to OUT2.

But i need aal the 3 records need to goto OUT2.

Please help me regarding this.




Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Sep 22, 2008 12:04 pm
Reply with quote

Hi,

instead of NODUPS, try ALLDUPS except all dups will be written to SORTOUT


Gerry
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts Syncsort help SYNCSORT 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top