DFSORT on variable length file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

DFSORT on variable length file

Postby nobin » Tue Apr 01, 2008 9:40 am

Hi,

I have variable length file where the length can vary between 50 to 20050 bytes. The file structure is as shown below,

Fixed data of 50 bytes length.
Array of 50 bytes which occurs from 0 to 400 times with a depending on clause. Offsets 49 and 50 of the file (last 2 bytes of fixed data) contains the value of array occurance.

Our requirement is to write all the records having a value of '01' in the first two bytes in any occurance of array into an output file.
For eg:
if first record in file have '01' in 51 & 52 offset (ie first two fields of first occurance of array), that record should be written to output file.
if second record is having '01' in 101 & 102 offset (ie first two fields of second occurance of array), that record should also be written to output file.
Similary if '01' is present in first two bytes of any other occurance of array, those records should be written into output file.

Please guide us in writting the sort card for above requirement where variable length file needs to be handled.

Thanks in advance.


Regards
Nobin
nobin
 
Posts: 2
Joined: Tue Apr 01, 2008 9:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT on variable length file

 


Re: DFSORT on variable length file

Postby Frank Yaeger » Tue Apr 01, 2008 8:55 pm

Nobin,

CICS guy is right. You will need VLSCMP and 400 INCLUDE conditions to do this. I could show you a way to "generate" the INCLUDE conditions so you don't have to code them by hand. But first I need to know the following:

Fixed data of 50 bytes length


Does this fixed data include the RDW in positions 1-4, or does it really start in position 5 after the RDW?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: DFSORT on variable length file

Postby nobin » Wed Apr 02, 2008 8:59 am

Hi Frank,

The 50 bytes of fixed data is without including the RDW in positions 1-4. The data really starts from offset 5 after RDW.

Thanks
Nobin
nobin
 
Posts: 2
Joined: Tue Apr 01, 2008 9:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT on variable length file

Postby Frank Yaeger » Wed Apr 02, 2008 10:23 pm

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

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//ONE DD *
RECORD
/*
//C1 DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//TOOLIN   DD    *
COPY FROM(ONE) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=C1,REPEAT=400,
    BUILD=(2X,SEQNUM,5,ZD,START=55,INCR=50,
      C',2,EQ,C''01'',OR,',80:X)
/*
//CTL2CNTL DD *
  OPTION COPY,VLSCMP
  INCLUDE FORMAT=CH,
    COND=(1,1,NE,1,1,OR,
/*
//    DD DSN=*.C1,VOL=REF=*.C1,DISP=(OLD,PASS)
// DD *
       1,1,NE,1,1)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post