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 

balance-line with sort

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


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Sep 03, 2008 5:03 pm    Post subject: balance-line with sort Reply with quote

hi,

is it possible to perform a balance-line between two sequential files with DFSORT, please?

if so, could you provide an example, please.

thanks.
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed Sep 03, 2008 5:29 pm    Post subject: Reply with quote

Quote:
is it possible to perform a balance-line between two sequential files with DFSORT, please?


I don't know what you mean by this. You need to explain what you want to do.

Please show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field.
_________________
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
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Sep 03, 2008 6:06 pm    Post subject: Reply with quote

Hi,
please suppose the following files:
Code:

    a                       b
---------          --------------
    1                       2   
    5                       3
    6                       5
    9                       6
                            8


I'd like to read these 2 input files and produce an output file ''C'' containing only the matched keys, that is, only keys 5 and 6.
the RECFM and LRECL are not important but consider it as FB and 80, respectively. there are no duplicate records in either input file.
Code:

         c
-----------------
         5
         6

thanks a lot.
jc
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 03, 2008 6:12 pm    Post subject: Reply with quote

jctgf,

Concatenate both files and use FIRSTDUP parm of DFSORT'S ICETOOL SELECT operator.

Code:

//STEP0100 EXEC PGM=ICETOOL                   
//TOOLMSG  DD SYSOUT=*                         
//DFSMSG   DD SYSOUT=*                         
//IN       DD DSN=your input file1,DISP=SHR
//         DD DSN=your input file2,DISP=SHR
//OUT      DD SYSOUT=*                         
//TOOLIN   DD *                               
  SELECT FROM(IN) TO(OUT) ON(1,1,CH) FIRSTDUP 
/*


The output will contain
Code:

         5
         6


Hope this helps....

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


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Sep 03, 2008 7:52 pm    Post subject: Reply with quote

thanks a lot but we do not have icetool.
thanks again.
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Sep 04, 2008 10:10 am    Post subject: Reply with quote

Quote:
is it possible to perform a balance-line between two sequential files with DFSORT, please?


Quote:
thanks a lot but we do not have icetool.


In your first post, you say you have DFSORT. In your latest post, you say you don't have ICETOOL. This makes no sense. If you have DFSORT, then you have ICETOOL. ICETOOL has been shipped with DFSORT since 1991. Have you actually tried using PGM=ICETOOL? If not, try it. If you have tried it and received an error message, show the error message you received.
_________________
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
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Thu Sep 04, 2008 3:40 pm    Post subject: Reply with quote

sorry.
we have icetool but only in the development environment.
they doesn't allow us to run icetool in production.
i tried icetool in development and it works great.
thanks.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 04, 2008 3:51 pm    Post subject: Reply with quote

jctgf,

If that is the case then try this DFSORT JCL which would give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD DSN=your input file1,DISP=SHR
//         DD DSN=your input file2,DISP=SHR
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=(1,1,CH,A)                       
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,1))
  OUTFIL INCLUDE=(81,8,ZD,EQ,2),BUILD=(1,80)   
/*


Hope this helps...

Cheers
_________________
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: Thu Sep 04, 2008 4:38 pm    Post subject: Reply with quote

Quote:
we have icetool but only in the development environment.
they doesn't allow us to run icetool in production.
i tried icetool in development and it works great.


So your shop has ICETOOL and is paying for ICETOOL and you like ICETOOL, but some idiot at your shop decided you can't use it in production? Just curious if they gave you a reason? Considering DFSORT's ICETOOL is fully documented and supported and has been shipped with DFSORT since 1991, maybe it's time they reevaluated this policy. DFSORT's ICETOOL is extremely popular so it's difficult to understand why any shop would make that kind of ridiculous decision.
_________________
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