Page 1 of 1

Add the header to the all output file in sort

PostPosted: Sat Jun 06, 2009 9:32 am
by varadhu
HI all


i need to spilit a file and have to add the header to the all output file as a current timestamp..... can any one help me in that....

Re: header in sort

PostPosted: Sat Jun 06, 2009 9:50 am
by dick scherrer
Hello and welcome to the forum,

From what you posted, no one can help. . . You have provided no info to work with.

Post some sample input and the output(s) you want from that input.

Explain any rules for getting from the input to the output(s) you want. Explain what you mean by "split".

Mention the recfm and lrecl of each file as well as the relevant data positions.

Re: Add the header to the all output file in sort

PostPosted: Sat Jun 06, 2009 7:51 pm
by Frank Yaeger
varadhu,

Dick is right that you haven't given enough information. But the general way to do what you want would be to use an OUTFIL statement with a HEADER1 operand for each output file, e.g.

   OPTION COPY
   OUTFIL FNAMES=OUT1,REMOVECC,
      INCLUDE=(condition),
      HEADER1=(DATE=(4MD/))
   OUTFIL FNAMES=OUT2,REMOVECC,
      SAVE,
      HEADER1=(DATE=(4MD/))


INCLUDE and SAVE are one way to split a file. There are many others depending on how you want to split it.

For more information, see the "Five ways to split a data set" Smart DFSORT Trick at:

http://www.ibm.com/systems/support/stor ... vs/tricks/

The REMOVECC operand removes the ANSI carriage control characters (e.g. '1' for eject). If you want them, don't use REMOVECC.