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 

Is this possible with DFSORT?

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


Joined: 23 Sep 2003
Posts: 7
Topics: 4

PostPosted: Fri Mar 04, 2005 12:07 pm    Post subject: Is this possible with DFSORT? Reply with quote

Hello,

I have 1 file who looks like this (they are letters from 2 different companys):

Code:

Company1

        Dear Mr. xxxxx
                      xxxxxxxxxxxx
                      xxxxxxxxxxxx
Company2

        Dear Mr.yyyyyyyyy
                    yyyyyyyyyyy
                    yyyyyyyyyyy
Company1

        Dear Mr. kkkkkkk
                      kkkkkkkk
                      kkkkkkkkk
etc...


I want to sort the letters from Company1 and Company2 into 2 different files.
The file is VB. It
Back to top
View user's profile Send private message
Dummy
Beginner


Joined: 03 Jan 2003
Posts: 8
Topics: 1

PostPosted: Fri Mar 04, 2005 12:46 pm    Post subject: Reply with quote

This might be possible depending on our input.

Is the Address always 4 lines?

Will it be alternate addresses like 1,3, 5 & 7 records will be company-1. 2,4,6 & 8 will be company-2?
Back to top
View user's profile Send private message
nsantos
Beginner


Joined: 23 Sep 2003
Posts: 7
Topics: 4

PostPosted: Fri Mar 04, 2005 1:01 pm    Post subject: Reply with quote

The address is variable, it can be 4 lines or 3 lines, and each adress belongs at each client. The adresses are always different, because the clients changes. The only thing that repeats is the name of the company at the beginning of each letter.
There are only 2 companys.
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 Mar 04, 2005 1:43 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use the new functions IFTHEN, KEEPBASE, VLENOVLY along with SPLICE to do what you want. I assume when you say "I want to sort the letters from Company1 and Company2 into 2 different files" you mean you want the letters from Company1 in one output file in their original order, and the letters from Company2 in another output file in their original order, and that there's really no sorting involved. I also assumed that your VB input file has LRECL=80, but the job can be adjusted for other LRECLs.

If you have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). Note that the job will not work with Syncsort, because it doesn't have these new functions.

Here's the DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file (VB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1 (Company1)
//OUT2 DD DSN=...  output file2 (Company2)
//TOOLIN   DD    *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT1) ON(5,8,ZD) KEEPBASE -
  WITHALL WITH(5,16) WITH(22,80) VLENOVLY USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,8,ZD,22:5)),
       IFTHEN=(WHEN=(22,7,CH,EQ,C'Company'),
               OVERLAY=(5:SEQNUM,8,ZD,21:29,1)),
       IFTHEN=(WHEN=NONE,
               OVERLAY=(13:SEQNUM,8,ZD,
                   5:5,8,ZD,SUB,13,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
   OUTFIL FNAMES=OUT1,INCLUDE=(21,1,CH,EQ,C'1'),
     OUTREC=(1,4,5:22)
   OUTFIL FNAMES=OUT2,SAVE,
     OUTREC=(1,4,5:22)
/*


OUT1 will have all of the Company1 letters and OUT2 will have all of the Company2 letters.
_________________
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