Ken Leidner at IBM Mainframe Discussion List <[email protected]> wrote
on 01/20/2012 06:21:08 AM:
> I have an input dataset that looks like the following.  Note the
> columns for the data are 2, 11, and, 56.  I use the sort control
> cards to remove the unwanted records and generate ALTER statements
> for IDCAMS to change the GDG bases with Noscratch to Scratch.  This
> works well, but it does lead me to one question that I wonder how
> other solve or if DFSORT has addressed the issue and I just don't
> know about it.
>
> Is there a way to "extract" a variable length field, like a dataset
> name, and build an output record with that extracted field and its
> variable length used rather than a fixed length?  The problem is to
> have other fields follow the variable length field without having to
> use a second pass to remove the extra spaces when a fixed length
> field is used.  If this is possible it does raise a second question
> as to how to do this and output a fixed length record as you would
> have to be able to calculate the size of the final "padding" blank
> field.  Maybe that problem could be overcome by first building the
> correct record length as all blanks and then using the overlay
> parameter to build the "real" record.
>
> Currently all I know how to do is build the varying length field into
> a fixed length field that is the maximum size for the field and then
> in a second past squeeze out the extra spaces between it and the
> following fields.
> ...

Extracting the variable field as a fixed field and squeezing
would be the right technique to use.

> In my case here I was able to use the TRAIL parameter to solve the
> problem, but in other cases the trailing data may be several fields
> from the original input record and the TRAIL parameter would not work.

If you show me an example of input and expected output for the
situation where TRAIL "would not work", I'll show you how to do
what you want with DFSORT another way.

Frank Yaeger - DFSORT Development Team (IBM) - [email protected]
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to