Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Need a SORT job
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3908
Location: San Jose, CA

PostPosted: Thu Mar 20, 2008 1:19 am    Post subject:
Reply with quote

Have you even tried to work this out for yourself based on the previous example?

You've changed the requirement 3 times already. How many more changes will there be? Come back tomorrow morning and assure me there will be no more changes in the requirement and I'll give you one final solution.
Back to top
View user's profile Send private message
References
PostPosted: Thu Mar 20, 2008 1:19 am    Post subject: Re: Reply with quote

hariibm

New User


Joined: 05 Feb 2007
Posts: 35
Location: Chennai

PostPosted: Thu Mar 20, 2008 1:42 am    Post subject:
Reply with quote

Hi Frank,

There is no change in the requirement. I assure you that this is the final one.
Please give me the JCL.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3908
Location: San Jose, CA

PostPosted: Thu Mar 20, 2008 2:37 am    Post subject:
Reply with quote

Here's the DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
SPLICE FROM(IN) TO(T1) ON(49,4,CH) KEEPNODUPS KEEPBASE -
 WITHALL WITH(6,60) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION VLSCMP
  INCLUDE COND=(15,4,SS,EQ,C'PART,NAME')
  INREC IFTHEN=(WHEN=(15,4,CH,EQ,C'NAME'),
    BUILD=(1,4,5:C'0',49:23,4,66:27,16)),
   IFTHEN=(WHEN=NONE,BUILD=(1,4,5:C'1',6:5))
  SORT FIELDS=(49,4,ZD,A,5,1,CH,A)
  OUTFIL FNAMES=T1,OMIT=(16,4,CH,NE,C'PART'),
     BUILD=(1,4,5:6)
/*
//CTL2CNTL DD *
  SORT FIELDS=(30,6,ZD,A)
/*
Back to top
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 35
Location: Chennai

PostPosted: Wed Mar 26, 2008 8:58 pm    Post subject:
Reply with quote

Hi Frank,

Thanks for the JCL above.

Please tell me which option of the SPLICE allows the duplicates from the OVERLAY record?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3908
Location: San Jose, CA

PostPosted: Wed Mar 26, 2008 9:10 pm    Post subject:
Reply with quote

Quote:
Please tell me which option of the SPLICE allows the duplicates from the OVERLAY record?


WITHALL tells ICETOOL to splice the base record with each overlay record if that's what you mean.
Back to top
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 35
Location: Chennai

PostPosted: Thu Mar 27, 2008 10:58 am    Post subject:
Reply with quote

I have used DFSORT SPLICE for one of my requirements.
I am getting the results as below.


If there is no base record for a particular key, I am getting only one overlay record spliced(others are eliminated from the output).

If there are more than one base records for a particular key, I am getting only one overlay record spliced and also one base record.

I need the results as below:

If there is no base record for a particular key, I should get all the overlay records in the output and spaces for the positions where the base record should have values in the output.

If there are more than one base records for a given key, I should get all the overlay records in the output. And for the Base record positions in the output file, i should get the values from the first base record(since there are more than one base records for a given key). And I should not get any base record

Please let me know with which options I can handle this.

Note: I am just using the KEEPNODUPS option with my SPLICE operand(except WITHALL and WITH)
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6756
Location: 221 B Baker St

PostPosted: Thu Mar 27, 2008 7:29 pm    Post subject:
Reply with quote

Hello,

Please post some example input and output data that demonstrate your situation as well as the jcl and control statements for this process.
Back to top
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 35
Location: Chennai

PostPosted: Thu Mar 27, 2008 9:49 pm    Post subject:
Reply with quote

As in my first example,

If I have a data like this.. in the input file,

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+
--------  PART           01232K01121{03051AZZZZ-------------     
--------  PART           01232B01421A09011AXXXX-------------     
--------  PART           01122{08015{01021AMMMM-------------     
--------  PART           01122{08015{01021AMMMM-------------     
++++++++  NAME    ZZZZHARI            4                         
++++++++  NAME    XXXXRAMU            2                 



The output I am getting is like below..

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+---
--------  PART           01232K01121{03051AZZZZ-------------HARI   
--------  PART           01232B01421A09011AXXXX-------------RAMU   
--------  PART           01122{08015{01021AMMMM-------------       


The part number MMMM is appearing twice in the input file.. For this part there is no 'NAME' record.
So, I am getting only one record in the output for the part MMMM.


I am using this below SPLICE command.

SPLICE FROM(IN) TO(OUT) ON(48,4,CH) WITHALL KEEPNODUPS -
WITH(5,60)

I am using the 'NAME' record as the base and 'PART as the overlay records.

Please let me know how what changes can be done in SPLICE to get all the records of PART(overlay) if there is no part 'NAME'(base record) reocrd exists for a given key.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3908
Location: San Jose, CA

PostPosted: Thu Mar 27, 2008 10:11 pm    Post subject:
Reply with quote

If you go back to the example I showed, you'll see I have the KEEPBASE operand for the SPLICE operator. It's missing from your SPLICE operator.
You need KEEPBASE to keep the first duplicate without a match.

If adding KEEPBASE doesn't give you what you want, then show me your complete ICETOOL job.
Back to top
View user's profile Send private message
hariibm

New User


Joined: 05 Feb 2007
Posts: 35
Location: Chennai

PostPosted: Tue Apr 01, 2008 8:35 pm    Post subject:
Reply with quote

Hi Frank,
Atlast my problem got resolved.
Thanks a lot for the solution.

I have a question about the base and overlay records.

As I understood, the base records are assumed as NAME records and overlay records as PART records.

My question is how does the SPLICE command consider the base records as NAME and overlay records as PART records.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 3908
Location: San Jose, CA

PostPosted: Tue Apr 01, 2008 8:59 pm    Post subject:
Reply with quote

The SPLICE command treats the first record of a set of duplicates as the "base" record and the second (and subsequent)
record(s) of a set of duplicates as the "overlay" record(s). So we just had to set things up so the NAME records were first.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2