0

I have a vb file length of 2504. I need to sort the field (234,7) Field declaration- S9(13) comp-3. Since it is a vb file I did like below.

  //Sysin dd*
     Sort fields= (238,7,pd,A)
  /*

But it's not sorting properly . Pls help .. Thank you!!

  • The first **4 bytes** in a record in a **VB** file are the RDW (basically record Length). You need to add 4 bytes to starting positions when sorting. If you did not allow for the 4 bytes try `Sort fields=(2427,pd,A)` – Bruce Martin Aug 17 '21 at 23:34
  • Thanks Bruce..my field real length is 234..Have already added 4 and tried – user13766556 Aug 18 '21 at 03:46
  • from memory it is position followed by length – Bruce Martin Aug 18 '21 at 05:40
  • I assume there are some typos in your sort statement, because DFSORT would not accept neither the space after `fields=`, nor would it accept lower case. If DFSORT did not complain, `FIELDS=(238,7,PD,A)` would definitely sort a packed decimal field. Would you please show at least one input record's data in hexdecimal notation? – phunsoft Aug 18 '21 at 18:32
  • Please remoce the `JCL`tag. This has nothing to do with `JCL` whatsoever. – phunsoft Aug 18 '21 at 18:32

0 Answers0