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 set of records

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


Joined: 30 Aug 2006
Posts: 9
Topics: 3

PostPosted: Tue Sep 19, 2006 4:11 pm    Post subject: sort set of records Reply with quote

Hi ,

i am facing problem to deal with this

Input

01aaa
02 mex
03
01bbb
02 xex
03
01ccc
02 mex
03

01,02 and 03 are record types of key aaa mentioned in first column.
So 01, 02 and 03 is one set record.

Output
should look after sort
01aaaxx
02 mex
01ccc
02 mex


if 02 record type has mex , then it;s 01 and 02 should be written

Please help me in this

Thanks,
Byh
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: Tue Sep 19, 2006 6:02 pm    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's INREC with SPLICE function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

If you see 'ICE201I E' in DFSMSG, you have the April, 2006 PTF. If you see 'ICE201I 0' in DFSMSG, you don't have the PTF. Without the PTF, you won't get any output records.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
SPLICE FROM(IN) TO(T1) ON(82,8,ZD) -
  KEEPBASE WITH(1,80) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(1,2,CH,EQ,C'03')
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),
    OVERLAY=(82:SEQNUM,8,ZD)),
   IFTHEN=(WHEN=(1,2,CH,EQ,C'02'),
    OVERLAY=(82:SEQNUM,8,ZD),HIT=NEXT),
   IFTHEN=(WHEN=(4,3,CH,EQ,C'mex'),
    OVERLAY=(81:C'Y'))
  SORT FIELDS=(82,8,ZD,A,1,2,CH,D)
/*
//CTL2CNTL DD *
  INCLUDE COND=(81,1,CH,EQ,C'Y')
  SORT FIELDS=(82,8,ZD,A,1,2,CH,A)
  OUTREC BUILD=(1,80)
/*

_________________
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
byhalia
Beginner


Joined: 30 Aug 2006
Posts: 9
Topics: 3

PostPosted: Tue Sep 19, 2006 9:18 pm    Post subject: forgot to mention Reply with quote

is it same if input file is variable block.
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: Wed Sep 20, 2006 10:26 am    Post subject: Reply with quote

With a VB file, we need to put the indicator and sequence number after the RDW rather than at the end of the record. Here's a modified DFSORT/ICETOOL job to do that. I assumed your input file has LRECL=80. For other LRECLs, just change WITH(6,89) to WITH(6,n) where n is LRECL+9.

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)
//OUT DD DSN=...  output file (VB/80)
//TOOLIN DD *
SPLICE FROM(IN) TO(T1) ON(6,8,ZD) VLENOVLY -
  KEEPBASE WITH(6,89) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(5,2,CH,EQ,C'03')
  INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'01'),
    BUILD=(1,4,6:SEQNUM,8,ZD,14:5)),
   IFTHEN=(WHEN=(5,2,CH,EQ,C'02'),
    BUILD=(1,4,6:SEQNUM,8,ZD,14:5),HIT=NEXT),
   IFTHEN=(WHEN=(17,3,CH,EQ,C'mex'),
    OVERLAY=(5:C'Y'))
  SORT FIELDS=(6,8,ZD,A,14,2,CH,D)
/*
//CTL2CNTL DD *
  INCLUDE COND=(5,1,CH,EQ,C'Y')
  SORT FIELDS=(6,8,ZD,A,14,2,CH,A)
  OUTREC BUILD=(1,4,14)
/*

_________________
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
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Sep 27, 2006 4:46 am    Post subject: Reply with quote

Hi Kolusu,
We had the new version of SYNCSORT (1.2.1.1N) where the IFTHEN function is working(I tried with a simple example).When I tried to execute the above code,I am getting the error like below.

WER186I SVC 109 IS INCORRECT VERSION OR NON-SYNCSORT - SVC NOT USED

Is there any difference in the CODING of the IFTHEN clause in SYNCSORT ?

Thank you
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 27, 2006 7:18 am    Post subject: Reply with quote

bprasanna,

The solutions posted by Frank both use INREC processing for SPLICE which is new feature for ICETOOL. It is a part of the PTF UK90007 for z/OS DFSORT V1R5 and PTF UK90006 for DFSORT R14 (April, 2006) which has not been copied/implemented by Syncsort.

But that does not explain as to why you got that error. Your job should have abended with S0C4 as Splice from syncsort does not recongnise the INREC statement and validation on the ZD field fails resulting in S0C4. This is the information I got from looking up the message WER186I

Code:

WER186I SVC nnn IS INCORRECT VERSION OR NON-SYNCSORT - SVC NOT USED -     
INEFFICIENT SORT                                                           
                                                                           
EXPLANATION:  The  SVC  did  not  return  a  code  indicating  it  was  at
the correct  version  level,  therefore  it  was  not  used. The  SVC  is 
either  at  the wrong  SyncSort  release/maintenance  level  or  is  not   
a  SyncSort  SVC.  The problem could cause less efficient I/O and/or loss 
of SMF records. ACTION:  Notify  your  system  programmer,  who  should   
check  that  the  SVC has  been  installed  in  the  system  libraries,   
has  been  IPLed  into  the  system, was  specified  via  SYNCMAC,  and   
was  not  incorrectly  overridden  via $ORTPARM or the PARM field.         


May be you need to call your systems programmer as I suspect that the alias for ICETOOL is not installed properly on your system.

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
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Sep 27, 2006 8:43 pm    Post subject: Reply with quote

Thank you Kolusu for the info.

Thanks
_________________
----------------
Thanks&Regards
Bprasanna
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