Variable Length Records



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

Variable Length Records

Postby Ron Mascarenhas » Mon Nov 03, 2008 2:08 am

I have three questions on DFSORT/ICETOOL

1. For variable length files, can I get the record length of the current record as a symbol (like VLEN) so that I can use it in some computation.

2. In a COBOL SORT with an INPUT/OUTPUT procedure, can I use a OMIT statement in a DFSPARM and if so is the record omitted before the input procedure or after the sort in the output procedure. Can I use INREC OUTREC statements?

3. Is there any way to process OCCURS fields in a variable length record.

Thanks Frank
Ron Mascarenhas
 
Posts: 15
Joined: Mon Nov 03, 2008 2:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Variable Length Records

Postby dick scherrer » Mon Nov 03, 2008 10:58 am

Hello,

In your second question, you ask about input and output procedures. The input procedure code can OMIT anything thast may be skipped by the "pre-sort proccessing'). These records would be detected between the read from the input file and before the release to the sort. Another approch would be to intercept information after the return from the sort but before using it in any output from this process. Using input/output procedure can make a major difference in pereformance of your job. When using the internal sort, the using/giving options should not be used for the same sort operation.

For your first and third questions, how would you use the values? If you post what task you have in mind for the 2 situations, we may be able to offer better suggestions. When posting, please post representative sample input and output data and the rules fpr prcessing the input to reach the desired output.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Variable Length Records

Postby Frank Yaeger » Mon Nov 03, 2008 11:37 pm

Ron,

1. I'm not sure what you mean. The 1,2,BI field has the length of a variable-length record. You can use 1,2,BI in computations. I don't know what symbols has to do with it, but you could set up a symbol for the 1,2,BI field, e.g.

REC_LEN,1,2,BI

2. An INPUT PROCEDURE is equivalent to a DFSORT E15 exit. An OUTPUT PROCEDURE is equivalent to a DFSORT E35 exit. The following Figure shows the order of processing of DFSORT control statements and exits:

http://publibz.boulder.ibm.com/cgi-bin/ ... FIGSTMTSEQ

You can use DFSORT control statements in //DFSPARM and they will be processed in the order shown in relation to an E15 exit (INPUT PROCEDURE) or E35 exit (OUTPUT PROCEDURE).

3. The OCCUR operator of DFSORT's ICETOOL can use a VB file as input, so I'm not sure what you're asking.
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: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Variable Length Records

Postby Ron Mascarenhas » Wed Nov 05, 2008 1:29 am

1. I had an idea to use the record length in two situations:

a) In the substring search SS. For example if RECLEN was a builtin DFSORT variable for the current record length then to search the entire record
INCLUDE COND=(RECLEN,SS,C'string').
Frank has already given one solution to define a symbolic and use that.

b) For example if I have variable length records like the following and I wish to modify the last 3 chars:

ABC0987923847987234ABC
ABC238479827394879273497283ABC

I should be able to use something like
IFTHEN=(WHEN=(VLEN-3,3,CH,EQ,C'ABC'),
OVERLAY=(VLEN-3:C'DEF'))

Or maybe there is another way to do this?

2. Thanks Frank, the figure in the manual explains my questions on the sequence of the external SORT statements in the internal sort.

3. For example I have records with occuring fields. The record has the following format:
Dept= 4 bytes
Occurance=2 bytes
Occuring fields each 4 bytes long

For Example here are two records, I have seperated the fields for clarity:
DEPT 05 3498 9839 4898 3498 3948
DEPT 07 7876 8686 8686 8768 6868 6868 6866

For example can I add and print up the occuring fields in each record, using the occurance as an index?.

Thanks
Ron Mascarenhas
 
Posts: 15
Joined: Mon Nov 03, 2008 2:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Variable Length Records

Postby Frank Yaeger » Wed Nov 05, 2008 1:52 am

1a. There's no built-in function to get a position based on the length of the record minus a value.

3. There's no built-in function to use the number of occurrences as an index. You could convert the VB records to FB records and pad the missing fields so you could identify them and do whatever you want with them. For your example, you could pad with C'0' characters so when you add the fields, the missing ones will be treated as zeros and you'll get the correct total.
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: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post