Page 1 of 1

Breaking down a record into records

PostPosted: Wed Nov 24, 2010 7:27 pm
by katcse
Hi,

I have the following data in variable file format

No of insurances (1-8) Insurnace number (10-17) insurance number (18-25) and so on for a max of 20 insurance numbers.

For eg:

1 12345
2 12345 11111
4 11111 22222 33333 44444

I need this data in output record as :

12345
12345
11111
11111
22222
33333
44444

Thanks,
Karthik.

Re: Breaking down a record into records

PostPosted: Wed Nov 24, 2010 10:25 pm
by skolusu
Katcse,

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create larger records from smaller records, or smaller records from larger records. For example, to create 7 byte records from 150 byte(first 9 bytes counter followed by 20X7 byte records), you would use:

//STEP0100 EXEC PGM=ICETOOL                           
//TOOLMSG  DD SYSOUT=*                                 
//DFSMSG   DD SYSOUT=*                                 
//IN       DD DSN=your FB input 149 byte file,DISP=SHR
//OUT      DD SYSOUT=*                                 
//TOOLIN   DD *                                       
  RESIZE FROM(IN) TO(OUT) TOLEN(7) USING(CTL1)         
//CTL1CNTL DD *                                       
  INREC BUILD=(10,140)                                 
  OUTFIL FNAMES=OUT,OMIT=(1,7,CH,EQ,C' ')             
//*

Re: Breaking down a record into records

PostPosted: Wed Nov 24, 2010 11:57 pm
by Frank Yaeger
Insurnace number (10-17) insurance number (18-25) and so on for a max of 20 insurance numbers.


The insurance numbers are actually 8 bytes, not 7 bytes, so the correct DFSORT job would be:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/169)
//OUT DD DSN=...  output file (FB/8)
//TOOLIN   DD *
RESIZE FROM(IN) TO(OUT) TOLEN(8) USING(CTL1)
//CTL1CNTL DD *
  INREC BUILD=(10,160)
  OUTFIL FNAMES=OUT,OMIT=(1,8,CH,EQ,C' ')
//*