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

Problem with Sort on multiple fields


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

New User


Joined: 08 Apr 2007
Posts: 7
Location: NJ

PostPosted: Sat Jun 02, 2007 6:48 am
Reply with quote

can any one help me in debugging following.

I am trying to get non matching records from File 1 & File 2 in Out 1 & Out2 on multiple fields using following code however I am getting abend S013 U0000

In Output I want records, which are not matching on any of fields which are in file 1 in OUT1 & records which are in file 2 in OUT2
Ex

File 1
11111111111111111111111 12345 2222222222
11111111111111111111111 12345 2222222222
11111111111111111111111 12345 3333333333
22222222222222222222222 33333 2222222222
22222222222222222222222 12345 2222222222
22222222222222222222222 12345 2222222222
File 2

11111111111111111111111 12345 2222222222
11111111111111111111111 12345 2222222222
11111111111111111111111 12345 9999999999
22222222222222222222222 55555 2222222222
22222222222222222222222 99999 2222222222
22222222222222222222222 99999 2222222222

I want output file as
Output file 1:-

11111111111111111111111 12345 3333333333
22222222222222222222222 33333 2222222222
22222222222222222222222 12345 2222222222
22222222222222222222222 12345 2222222222
Output File 2:-
11111111111111111111111 12345 9999999999
22222222222222222222222 55555 2222222222
22222222222222222222222 99999 2222222222
22222222222222222222222 99999 2222222222


I used following JCL:-

Code:

//PS001  EXEC PGM=SYNCTOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//*                                                                   
//DFSMSG DD SYSOUT=*                                                   
//*                                                                   
//IN1 DD DSN=SS.S.INPUT.PART.FILE1,DISP=SHR               
//*                                                                   
//IN2 DD DSN=SS.S.INPUT.PART.FILE2,DISP=SHR               
//*                                                                   
//T1       DD DSN=&&TEMP,DISP=(MOD,PASS,DELETE)                       
//*                                                                   
//F1       DD DSN=&&TEMP,DISP=(MOD,PASS,DELETE)                       
//*                                                                   
//OUT1  DD DSN=SS.S.PART.OUT1,       RECS IN FILE1 ONLY
//            DISP=(NEW,CATLG,DELETE),                                 
//            DSORG=PS,                                               
//            RECFM=FB,                                               
//            LRECL=81,                                               
//            BLKSIZE=0,                                               
//            UNIT=SYSDA                                               
//*                                                                   
//OUT2  DD DSN=SS.S.PART.OUT2,   RECS IN FILE2 ONLY
//            DISP=(NEW,CATLG,DELETE),                                 
//            DSORG=PS,                                               
//            RECFM=FB,                                               
//            LRECL=81,                                               
//            BLKSIZE=0,                                               
//            UNIT=SYSDA                                               
//*                                                                   
//TOOLIN DD *                                                         
  SELECT FROM(IN1) TO(F1) -                                           
                 ON(1,23,CH) -       * FIRST  FIELD                   
                 ON(35,5,CH) -      * SECOND FIELD                   
                 ON(59,10,CH)  -     * THIRD FIELD                     
                 FIRST                                                 
  SELECT FROM(IN2) TO(F1) -                                           
                 ON(1,23,CH) -       * FIRST  FIELD         
                 ON(35,5,CH) -      * SECOND FIELD         
                 ON(59,10,CH)  -     * THIRD FIELD         
                 FIRST                                     
  SELECT FROM(F1) TO(T1) -                                 
                 ON(1,23,CH) -       * FIRST  FIELD         
                 ON(35,5,CH) -      * SECOND FIELD         
                 ON(59,10,CH)  -     * THIRD FIELD         
                 FIRSTDUP USING(CTL1)                       
  SELECT FROM(F1) TO(T1) -                                 
                 ON(1,23,CH) -       * FIRST  FIELD         
                 ON(35,5,CH) -      * SECOND FIELD         
                 ON(59,10,CH)  -     * THIRD FIELD         
                 NODUPS USING(CTL2)                         
  COPY FROM(IN1) TO(T1) USING(CTL3)                         
  COPY FROM(IN2) TO(T1) USING(CTL4)                         
  SPLICE FROM(T1) TO(OUT1) -                               
                 ON(1,23,CH) -       * FIRST  FIELD         
                 ON(35,5,CH) -      * SECOND FIELD         
                 ON(59,10,CH)  -     * THIRD FIELD         
  WITHALL WITH(1,82) USING(CTL5)                           
/*                                                         
//CTL1CNTL DD                                               
   OUTFIL FNAMES=T1,OVERLAY=(82:C'DD')                     
/*                                                         
//CTL2CNTL DD                                               
   OUTFIL FNAMES=T1,OVERLAY=(82:C'UU')                     
/*                                                         
//CTL3CNTL DD                                               
   OUTFIL FNAMES=T1,OVERLAY=(82:C'11')                     
/*                                                         
//CTL4CNTL DD                                               
   OUTFIL FNAMES=T1,OVERLAY=(82:C'22')                     
/*                                                         
//CTL5CNTL DD                                               
   OUTFIL FNAMES=OUT1,INCLUDE=(82,2,CH,EQ,C'1U'),           
   BUILD=(1,81)                                             
   OUTFIL FNAMES=OUT2,INCLUDE=(82,2,CH,EQ,C'2U'),           
   BUILD=(1,81)                                       
/*                                                   
//*                                                   



I am getting toolmsg as
Code:

                                                           
    SELECT FROM(F1) TO(T1) -                               
                   ON(1,23,CH) -       * FIRST  FIELD       
                   ON(35,5,CH) -      * SECOND FIELD       
                   ON(59,10,CH)  -     * THIRD FIELD       
                   FIRSTDUP USING(CTL1)                     
  SYNCSORT CALLED WITH IDENTIFIER "0003"                   


Any help on this will be appreciated.
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: Sat Jun 02, 2007 9:22 am
Reply with quote

Hello,

Is your abend an 013-20? You have not posted most of the error information which would help. If the abend is an 013-20, it means you have a dcb cvonflict. The more complete error info will also tell you which dd statement has the problem.

Also, you have specified SPLICE which (i believe) is not supported in Syncsort. It is supported in DFSORT.
Back to top
View user's profile Send private message
rj007

New User


Joined: 08 Apr 2007
Posts: 7
Location: NJ

PostPosted: Sat Jun 02, 2007 12:29 pm
Reply with quote

I believe in my shop both are syncsort & DF sort both are available however how i can for to go to DF sort
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: Sat Jun 02, 2007 4:38 pm
Reply with quote

Hello,

If you talk with your system support people, they can tell you the proper module name or which loadlib needs to be named. Different sites have different ways to place/name multiple sort programs.

You might try executing ICETOOL instead of SYNCTOOL.

Also, some places name the sort executables SYNCSORT and DFSORT - usually "SORT" executes one or the other when both are installed.

Again, your support people can tell you how your environment is configured.

Did you resolve the s013?
Back to top
View user's profile Send private message
rj007

New User


Joined: 08 Apr 2007
Posts: 7
Location: NJ

PostPosted: Sat Jun 02, 2007 7:15 pm
Reply with quote

Hi,

is it possible to rewrite above DFSORT statement in above JCL to syncsort statements ?

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Jun 02, 2007 7:24 pm
Reply with quote

rj007 wrote:
is it possible to rewrite above DFSORT statement in above JCL to syncsort statements ?
Why would you want to, it appears that the statements are good to go, no sysntx errors.
Back to top
View user's profile Send private message
rj007

New User


Joined: 08 Apr 2007
Posts: 7
Location: NJ

PostPosted: Sun Jun 03, 2007 5:04 am
Reply with quote

In my shop only syncsort is available so i want to write DFSORT statements as above in syncsort.
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 Jun 03, 2007 5:11 am
Reply with quote

Hello,

The functionality you want has not yet been incorporated into syncsort. Several peopple have asked similar questions and so far, i recall no posted working "Syncsort only" solution for what you want.

I'd suggest you go ahead and write the program code to do what you want.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Jun 03, 2007 5:21 am
Reply with quote

rj007 wrote:
In my shop only syncsort is available so i want to write DFSORT statements as above in syncsort.

rj007 wrote:
I believe in my shop both are syncsort & DF sort both are available however how i can for to go to DF sort

PLEASE, speak with one tongue....
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Jun 06, 2007 9:42 pm
Reply with quote

dick scherrer wrote:
Hello,
Also, you have specified SPLICE which (i believe) is not supported in Syncsort. It is supported in DFSORT.


Dick,

One out of box query, my shop also uses syncsort but I could use SPLICE parameter successfully.
JCL used is:
Code:

//SYNCSORT  EXEC PGM=SYNCTOOL                                           
//TOOLMSG DD SYSOUT=*                                                 
//DFSMSG  DD SYSOUT=*                                                 
//IN1     DD DSN=HLQ.FIRST.FILE,DISP=(SHR,KEEP,KEEP)               
//IN2     DD DSN=HLQ.SECOND.FILE,DISP=(SHR,KEEP,KEEP)             
//TMP1    DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//OUT     DD DSN=HLQ.OUT.FILE1,DISP=(NEW,CATLG,CATLG)             
//TOOLIN  DD *                                                         
  COPY FROM(IN1) TO(TMP1) USING(CPY1)                                 
  COPY FROM(IN2) TO(TMP1) USING(CPY2)                                 
  SPLICE FROM(TMP1) TO(OUT) ON(1,3,CH) WITH(11,5)                     
//CPY1CNTL DD *                                                       
  OUTREC FIELDS=(1:1,3,5:5,5,11:5X)                                   
/*                                                                     
//CPY2CNTL DD *                                                       
  OUTREC FIELDS=(1:1,3,11:5,5)                                         
/*                                                                     



Does that mean in my shop both the tools SYNC- & DF-SORT are installed ..actually I doubt it, because the system-messages thrown in TOOLMSG shows that SYNCSORT is invoked, meassges displayed are :

Code:
SYT000I  SYNCTOOL RELEASE 1.5.1 - COPYRIGHT 2004  SYNCSORT INC.
SYT001I  INITIAL PROCESSING MODE IS "STOP"                     
SYT002I  "TOOLIN" INTERFACE BEING USED                         
                                                               
           COPY FROM(IN1) TO(TMP1) USING(CPY1)                 
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"               
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0               
                                                               
           COPY FROM(IN2) TO(TMP1) USING(CPY2)                 
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0002"               
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0               
                                                               
           SPLICE FROM(TMP1) TO(OUT) ON(1,3,CH) WITH(11,5)     
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0003"               
SYT031I  NUMBER OF RECORDS PROCESSED: 000000000000009         
SYT026I  NUMBER OF SELECTED RECORDS: 000000000000004           
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0               
                                                               
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0     
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0



Please clarify.
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: Wed Jun 06, 2007 10:00 pm
Reply with quote

Interesting - i'll call Syncsort and see what info is available. . .
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: Thu Jun 07, 2007 12:02 am
Reply with quote

Hello,

Spent some time on the phone with Syncsort and learned that many of the ICETOOL functions (such as SPLICE) are available in SYNCTOOL.

Unfortunately, there is no downloadable documentation at this time. SYNCTOOL was distributed to make life easier for people who knew ICETOOL and is designed to support the same style of syntax as ICETOOL. There is a direction that SYNCTOOL documentation be provided and it may be available the first part of next year (2008).

I asked about PARSE and that function is not yet available, but is planned for - currently, sometime early next year.
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: Thu Jun 07, 2007 12:58 am
Reply with quote

I can't resist saying that DFSORT has had ICETOOL with full documentation since 1991, and PARSE, etc since April, 2006.
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: Thu Jun 07, 2007 1:27 am
Reply with quote

heh heh heh icon_wink.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jun 07, 2007 1:39 pm
Reply with quote

Thanks Dick. Yeah, I tried to use PARSE verb as well, but it's not working.

Quote:

I can't resist saying that DFSORT has had ICETOOL with full documentation since 1991, and PARSE, etc since April, 2006.


ah...well.. Frank your documentation on DFSORT can make any one to fall in love with DFSORT. I was also failed to resist myself when compared DFSORT functionalities with other similar products. I am sure soon you'll come up with some new feactures of DFSORT. Good Luck icon_smile.gif
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 JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top