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 

How to sort sub groups witout affecting the hierarchy

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


Joined: 15 May 2007
Posts: 1
Topics: 1

PostPosted: Tue May 15, 2007 1:28 pm    Post subject: How to sort sub groups witout affecting the hierarchy Reply with quote

I have one VB file that has the length of 1067. Please find the dataset information
Code:

General Data                           Current Allocation                   
 Management class . . : STANDARD        Allocated tracks  . : 9             
 Storage class  . . . : STANDARD        Allocated extents . : 1             
  Volume serial . . . : PRI108                                             
  Device type . . . . : 3390                                               
 Data class . . . . . : **None**       Current Utilization                 
  Organization  . . . : PS              Used tracks . . . . : 9             
  Record format . . . : VB              Used extents  . . . : 1             
  Record length . . . : 1071                                               
  Block size  . . . . : 27998                                               
  1st extent tracks . : 9                                                   
  Secondary tracks  . : 30                                                 
  Data set name type  :                 SMS Compressible  . : NO           
                                                                           
  Creation date . . . : 2007/03/03      Referenced date . . : 2007/05/15   
  Expiration date . . : ***None***                                         
                 

Could you please give the ICETOOL code sorting this file using the following condition.

In this file,

If position 62 to 67 (without adding 4 bytes) is "ACTSUM",
position 68-69 (account id) should be sorted without affecting the order of other records.

If position 62 to 67 has 'ACTDET' , that record should go with corresposing 'ACTSUM' record.

Hierarchy is like this
Code:

POLDAT
  >ACTSUM
      > ACTDET

ACTSUM type records only sorted with in the group(position 62 to 67) based on the acctid (postion 68 to 69). Corresponding ACTDET records should go with ACTSUM records (that may or maynot appear immediate next ACTSUM record) Please find the sample input file and this should be sorted as in the output file

Please refer below example



Sample input files record
[code:1:5d136ee6b2]
0400600364040 MPU 400600364040 TRADMIN 40060
0400600364040 fMPU 400600364040 MPCOVER f001
0400600364040
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: Tue May 15, 2007 3:25 pm    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (VB/1071)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (VB/1071)
//TOOLIN   DD    *
 SPLICE FROM(IN) TO(T1) ON(7,8,ZD) KEEPNODUPS KEEPBASE -
   VLENOVLY WITHALL WITH(7,1083) USING(CTL1)
 SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
     BUILD=(1,4,5:72,2,7:SEQNUM,8,ZD,23:5)),
   IFTHEN=(WHEN=(84,6,CH,EQ,C'ACTSUM'),
     OVERLAY=(7:SEQNUM,8,ZD)),
   IFTHEN=(WHEN=NONE,
     OVERLAY=(5:X'4040',15:SEQNUM,8,ZD,
       7:7,8,ZD,SUB,15,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(45,10,ZD,A,5,2,CH,A)
  OUTREC BUILD=(1,4,5:23)
/*

_________________
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