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 

No match records using sort

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


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Thu Nov 10, 2005 9:55 am    Post subject: No match records using sort Reply with quote

I have searched the old posts for our requirement and found the logic to do that, but it is giving the following error, please advise on this :

The requirement is like this :
Code:

File1 : (LRECL=80)
1234567890xxxxxxxxxxx
2222222222xxxxxxxxxxx
4444444444aaaaaaaaaaa

File2 :(LRECL=80)
1234567890yyyyyyyyyyyy
3333333333zzzzzzzzzzzzzz

Output should be :
2222222222xxxxxxxxxxxx
4444444444aaaaaaaaaaaa

Our code is :

//R010  EXEC  PGM=ICETOOL                                               
//INPUT1  DD  DSN=FILE1,DISP=SHR                                       
//INPUT2  DD  DSN=FILE2,DISP=SHR                                       
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//CTL2CNTL DD DSN=&&TEMP1,DISP=(,PASS)                                 
//OUTPUT   DD DSN=OUTFILE,                                             
//            DISP=(OLD,CATLG,CATLG),                                   
//            UNIT=SYSDA,                                               
//            BLKSIZE=0,                                               
//            DSORG=PS,                                                 
//            LRECL=80,                                                 
//            RECFM=FB                                                 
//TOOLIN   DD *                                                         
  COPY FROM(INPUT1)  TO(CTL2CNTL) USING(CTL1)                           
  COPY FROM(INPUT2)  TO(OUTPUT)   USING(CTL2)                           
/*                                                                     
//CTL1CNTL DD *                                                         
  OUTFIL HEADER1=(' INCLUDE COND=(1,10,CH,NE,C''',1,10,''',OR,',80:X), 
         OUTREC=(C'               1,10,CH,NE,C''',1,10,C''',OR,',80:X),
        TRAILER1=('               1,10,CH,NE,C''',1,10,''')',80:X)     
/*                                                                     


The error we are getting is :
Code:

- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 09:39 ON THU NOV
  OUTFIL HEADER1=(' INCLUDE COND=(1,10,CH,EQ,C''',1,10,''',OR,',80:X),
         OUTREC=(C'               1,10,CH,EQ,C''',1,10,C''',OR,',80:X)
        TRAILER1=('               1,10,CH,EQ,C''',1,10,''')',80:X)   
END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW   
DEBUG NOABEND,ESTAE                                                   
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=INPUT
               ,SORTOUT=CTL2CNTL,DYNALLOC                             
SORT FIELDS=COPY                                                     
[b]CTL1OUT  NOT DEFINED                                                  [/b]
C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E7-K90000                     
END OF DFSORT
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Nov 10, 2005 10:14 am    Post subject: Reply with quote

change your CTL1CNTL to the following.

Code:

//CTL1CNTL DD *
  OUTFIL FNAMES=CTL2CNTL,
  OUTREC=(C'               1,10,CH,NE,C''',1,10,C''',OR,',80:X),
  HEADER1=(' INCLUDE COND=(1,10,CH,NE,C''',1,10,''',OR,',80:X), 
  TRAILER1=('               1,10,CH,NE,C''',1,10,''')',80:X)     
/*       


Btw you don't need to code the DCB parameters on the output dataset.

Hope this helps...

Cheers

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


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Thu Nov 10, 2005 10:37 am    Post subject: Reply with quote

The following error occured:

Could you please explain how the CTL1CNTL works for my requirement :

Thanks in advance.


Error :
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:28 ON

THU NOV
1 INCLUDE COND=(1,10,CH,NE,C'0935829514',OR,
1 1,10,CH,NE,C'0935829514',OR,
$
TEXT BEGINS IN WRONG COLUMN
1,10,CH,NE,C'1411053431',OR,
$
SYNTAX ERROR
1,10,CH,NE,C'1319264130',OR,
$
SYNTAX ERROR
1,10,CH,NE,C'3730251323',OR,
$
SYNTAX ERROR
1,10,CH,NE,C'2344441468',OR,
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Nov 10, 2005 10:52 am    Post subject: Reply with quote

Sateesh_gontla,

The '1' in the first byte is the carriage control character. Since you are using reporting features header1 and trailer1 , the output will have a carriage control character. so you need to supress it using the parm REMOVECC. So change your ctl1cntl to the following.

Code:

//CTL1CNTL DD *                                                 
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,                             
  OUTREC=(C'               1,10,CH,NE,C''',1,10,C''',OR,',80:X),
  HEADER1=(' INCLUDE COND=(1,10,CH,NE,C''',1,10,''',OR,',80:X),
  TRAILER1=('               1,10,CH,NE,C''',1,10,''')',80:X)   
/*                                                             


Hope this helps...

Cheers

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


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Thu Nov 10, 2005 10:59 am    Post subject: Reply with quote

Thanks a lot Kolusu ....It's working perfectly and understood the logic also.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Nov 10, 2005 12:19 pm    Post subject: Reply with quote

Hmmm ... The JCL shown does NOT give the output shown. It gives:

1234567890yyyyyyyyyyyy
3333333333zzzzzzzzzzzzzz

In order to get the output shown:

2222222222xxxxxxxxxxxx
4444444444aaaaaaaaaaaa

you'd need to use the following DFSORT/ICETOOL job:

Code:

//R011  EXEC  PGM=ICETOOL
//INPUT1  DD  DSN=FILE1,DISP=SHR
//INPUT2  DD  DSN=FILE2,DISP=SHR
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//CTL2CNTL DD DSN=&&TEMP1,DISP=(,PASS)
//OUTPUT   DD DSN=OUTFILE,
//            DISP=(OLD,CATLG,CATLG),
//            UNIT=SYSDA
//TOOLIN   DD *
  COPY FROM(INPUT2) USING(CTL1)
  COPY FROM(INPUT1) TO(OUTPUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,
  OUTREC=(C'               1,10,CH,EQ,C''',1,10,C''',OR,',80:X),
  HEADER1=(' OMIT COND=(1,10,CH,EQ,C''',1,10,''',OR,',80:X),
  TRAILER1=('               1,10,CH,EQ,C''',1,10,''')',80:X)
/*


That would produce an OMIT statement like this:

Code:

   OMIT COND=(1,10,CH,EQ,C'1234567890',OR,     
                 1,10,CH,EQ,C'1234567890',OR, 
                 1,10,CH,EQ,C'3333333333',OR, 
                 1,10,CH,EQ,C'3333333333')     


When you run that OMIT statement against the FILE1 records, it gives you the records in file1 that are NOT in file2.
_________________
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
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