MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort problem - SELECT FROM(INPUT) TO(DIFFILE) ON(?,?,CH)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 10:51 am    Post subject: Sort problem - SELECT FROM(INPUT) TO(DIFFILE) ON(?,?,CH) Reply with quote

I have two files F-A(150) and F-B(200) and I know the 150 records in F-A is there in F-B, my aim is to get the other 50 new records in F-B which are not there in F-A.

Code:

//USERIDD5 JOB (CRIS,9999,9999),'GET DIFF REC',       
//             NOTIFY=&SYSUID,REGION=16M             
//STEP100 EXEC PGM=ICETOOL                           
//*                                                   
//TOOLMSG DD SYSOUT=*                                 
//DFSMSG  DD SYSOUT=*                                 
//INPUT   DD DSN=E100.IRS.G0151V00,   
//           DISP=SHR                                 
//        DD DSN=E100.IRS.OFFP.G0152V00,   
//           DISP=SHR                                 
//DIFFILE  DD DSN=E100.IRS.CNREC.A,         
//            DISP=(OLD,CATLG,DELETE)                 
//TOOLIN  DD *                                       
  SELECT FROM(INPUT) TO(DIFFILE) ON(?,?,CH) NODUPS
/*                                                   
 


F-A and F-B are VB sequential files of lrecl 2004.
I don't know what to specify in ON parameter. I think there is a limitation on the lrecl on this. Can anyone help me with this.
I appreciate your time.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 10:52 am    Post subject: Reply with quote

F-A(150) and F-B(200) , I forgot to mention- the number i specified are the total number of records in each file.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Jul 20, 2007 10:57 am    Post subject: Reply with quote

vak255,

Do you want to compare the entire 2004 bytes of data? you can use a max of 10 ON conditions like this

Code:

SELECT FROM(INPUT) TO(DIFFILE) NODUPS ON(0001,256,CH) -
                                      ON(0257,256,CH) - 
                                      ON(0513,256,CH) -
                                      ON(0769,256,CH) -
                                      ON(1025,256,CH) -
                                      ON(1281,256,CH) -
                                      ON(1537,256,CH) -
                                      ON(1793,211,CH)


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jul 20, 2007 11:15 am    Post subject: Reply with quote

Kolusu,

The CH can have a max length of 1500. Any advantage to using several smaller lengths as apposed to say 2 for 1002 each?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jul 20, 2007 11:24 am    Post subject: Reply with quote

As Dick points out, DFSORT's SELECT operator allows you to use a maximum of 1500 bytes for CH and BI ON fields so the ON fields for positions 1-2004 could be:

ON(1,1500,BI) ON(1501,504,BI)

If you're comparing bytes without regard to format, BI is probably a better choice than CH from a doc standpoint.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Fri Jul 20, 2007 11:25 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 11:24 am    Post subject: Reply with quote

I don't have to compare the entire 2004, all i need is the 50 new records in the F-B file.

Can this be done using simple SORT.

Quote:

//STEP01 EXEC PGM=SORT
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=E100.IRS.G0151V00,
// DISP=SHR
// DD DSN=E100.IRS.G0152V00,
// DISP=SHR
//SORTOUT DD DSN=E100.IRS.CNREC.A,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,75),RLSE),
// RECFM=VB,LRECL=2004
//SYSIN DD *
SUM Fields = None


Does this work?? let me know ure views.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Jul 20, 2007 11:30 am    Post subject: Reply with quote

Quote:

I don't have to compare the entire 2004, all i need is the 50 new records in the F-B file.


vak,

how do you identify which records are new?

apart from that go back and read the 1st post once again and your last post. You started with something and in the end you come back with another approach

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jul 20, 2007 11:31 am    Post subject: Reply with quote

Quote:
I don't have to compare the entire 2004, all i need is the 50 new records in the F-B file.


You have to identify which bytes in the records are to be used to compare them. That's what the ON fields are for in this case. There could be a big difference between comparing positions 11-20 and comparing positions 21-30. You have to decide which bytes you want to compare in each pair of records and use the ON fields to tell DFSORT that. Remember that for a VB file, the first four bytes contains the RDW with the length in the first two bytes. You may or may not want to compare on that.

Your STEP01 step won't work for several reasons. SUM FIELDS=NONE will give you the first record with each value - it won't give you the records that don't compare. And even if you could use SUM FIELDS=NONE, you would need a SORT statement to indicate which bytes to compare on.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 11:55 am    Post subject: Reply with quote

Kolusu,

Sorry for the confusion. I know 150 records in FA is going to match the 150 of 200 records in FB. So all I need is the other 50 records.I don't have a common field to compare so i have to compare the entire length-2004.i will try with the first option and will update you.
I was just curious to know whether this could be done using SORT.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 12:11 pm    Post subject: Reply with quote

Kolusu, when I used the below select, the SORT is ending with U0016 ABEND.Please find below the messages.
Quote:

SELECT FROM(INPUT) TO(DIFFILE) NODUPS ON(0001,256,CH) -
ON(0257,256,CH) -
ON(0513,256,CH) -
ON(0769,256,CH) -
ON(1025,256,CH) -
ON(1281,256,CH) -
ON(1537,256,CH) -
ON(1793,211,CH)


,STEP100 , -CONTROL FIELD BEYOND RECORD
STEP100 - ABEND=S000 U0016 REASON=00000000 989


Quote:

SORT FIELDS=(00001,0256,CH,A,00257,0256,CH,A,00513,0256,CH,A,00769,025
25,0256,CH,A,01281,0256,CH,A,01537,0256,CH,A,01793,0211,CH,A)
MODS E35=(SYNCT$35,4096,,N)
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER276B SYSDIAG= 392853, 1443555, 1443555, 1734381
WER164B 16,748K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 16,392K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I INPUT : RECFM=VB ; LRECL= 2004; BLKSIZE= 27998
WER110I DIFFILE : RECFM=VB ; LRECL= 2004; BLKSIZE= 27998
WER168I CONTROL FIELD WITHIN RDW


Quote:

SYT000I SYNCTOOL RELEASE 1.5.3 - COPYRIGHT 2004 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED

SELECT FROM(INPUT) TO(DIFFILE) NODUPS ON(0001,256,CH) -
ON(0257,256,CH) -
ON(0513,256,CH) -
ON(0769,256,CH) -
ON(1025,256,CH) -
ON(1281,256,CH) -
ON(1537,256,CH) -
ON(1793,211,CH)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jul 20, 2007 12:39 pm    Post subject: Reply with quote

Kiran,

other than this being SYNCSORT and not DFSORT (thus Frank will not respond), you have forgotten to add 4 to the ON offsets (for the rdw), since it is a variable length record, and the error msgs told you the problem:
Quote:
WER168I CONTROL FIELD WITHIN RDW


apparently you can not reference the RDW. I don't know.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 20, 2007 4:08 pm    Post subject: Reply with quote

Thanks everyone, I added 4 bytes and it solved the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group