L : is this the length of the input field or output field ?
L refers to the input length but for X:Y,L it will also be used as the output length, so if you want a different output length then the input length, you need to truncate or pad accordingly. For something like X:Y,L,F,TO=ZD,LENGTH=N, L is the input length and N is the output length.
as in input file if some field like NAME which starts from 10th position and length 12 whereas same field starts at 15th position in the output field but layout shows it has max length of 8 bytes.
will put input positions 10-21 in output positions 15-26.
will put input positions 10-17 in output positions 15-22.
10:5X would give you spaces in output positions 10-14.
10:5Z would give you binary zeros in output positions 10-14.
10:X'000000000C' would give you a PD 0 in positions 10-14
10:+0,TO=PD,LENGTH=5 would also give you a PD 0 in positions 10-14.
Temporarily i have kept zeros at 41st position in the output file for length zeros, now similar problem occured while copying from 445th position [S9(13)V99 COMP-3] into the 46th position in the output having S9(13) COMP-3.
Help needs in both the scenarios:
1. copying from 9(8) to S9(9) COMP-3 field
2. copying from S9(13)V99 COMP-3 to S9(13) COMP-3.
OK. In the example Frank used, a literal became a packed decimal. Now you want "something" to become packed decimal, but DFSORT needs to know what the "something" is to start with, and if it is numbers, presumably it is Zoned Decimal.
If you try
then DFSORT will know what it is turning into a packed field, so it will be able to do it.