Page 1 of 1

how to change a PD to ZD including date using sort

PostPosted: Wed Aug 04, 2010 7:03 pm
by erameshkumarkgm
Hi ,
please see my below record format and help in changing from PD to ZD.
PIC X(08).
PIC X(09).
SEQ-NUM PIC S9(03) COMP-3.
PIC X(03).
PIC 9(04).
PIC X(03).
DATE PIC S9(09) COMP-3.
TIME PIC S9(09) COMP-3.
PIC X(02).
PIC X(03).
DATE-New PIC S9(09) COMP-3.
TIME-New PIC S9(09) COMP-3.
PIC X(02).
PIC X(01).
FILLER PIC X(143).
PIC X(50).

Total record length is 250.

Re: how to change a PD to ZD including date using sort

PostPosted: Wed Aug 04, 2010 10:52 pm
by skolusu
erameshkumarkgm ,

ok what is the expected OUTPUT layout?

Re: how to change a PD to ZD including date using sort

PostPosted: Thu Aug 05, 2010 10:39 am
by erameshkumarkgm
skolusu wrote:erameshkumarkgm ,

ok what is the expected OUTPUT layout?



I want the comp3 variabales to be converted to ZD . Layout
PIC X(08).
PIC X(09).
SEQ-NUM PIC 9(04).
PIC X(03).
PIC 9(04).
PIC X(03).
DATE PIC 9(10).
TIME PIC 9(10) .
PIC X(02).
PIC X(03).
DATE-New PIC 9(10).
TIME-New PIC 9(10).
PIC X(02).
PIC X(01).
FILLER PIC X(143).
PIC X(50).

Total record length is 272.
The Packed data should be convert in to normal numeric data.

Re: how to change a PD to ZD including date using sort

PostPosted: Thu Aug 05, 2010 5:05 pm
by NicC
you have 10 characters for the date so presumably you want a format like ccyy-mm-dd or is it dd-mm-ccyy? or do you want spaces or / instead of -?
And what about the format of the time?

Re: how to change a PD to ZD including date using sort

PostPosted: Thu Aug 05, 2010 11:44 pm
by dick scherrer
Hello,

If the values are to be converted to zd, there will be no spaces, '/'s, or '-'s. . .

There will only be digits. . . Probably with one or more leading zeros in the "output".

Re: how to change a PD to ZD including date using sort

PostPosted: Fri Aug 06, 2010 1:40 am
by Frank Yaeger
erameshkumarkgm,

Assuming that by "normal numeric data", you mean ZD, I believe these DFSORT statements will do what you asked for:

  OPTION COPY
  INREC BUILD=(1,8,
    9,9,
    18,3,PD,TO=ZD,LENGTH=4,
    21,3,
    24,4,
    27,3,
    30,5,PD,LENGTH=10,
    35,5,PD,LENGTH=10,
    40,2,
    42,3,
    45,5,PD,TO=ZD,LENGTH=10,
    50,5,PD,TO=ZD,LENGTH=10,
    55,2,
    57,1,
    58,143,
    201,50)

Re: how to change a PD to ZD including date using sort

PostPosted: Mon Aug 09, 2010 11:30 am
by erameshkumarkgm
Thanks Frank it worked fine..