View previous topic :: View next topic
|
Author |
Message |
jagadish2005
New User
Joined: 08 Mar 2005 Posts: 20
|
|
|
|
Hi ,
I am doing cobol , db2 program . Ouput is a from program report file wthout header. but i need to have a header for that file using DFSORT
Input for program : db2 tables (no files)
report oupute file with header
can u help how to add header to ouput file using DFSORT
Thanks
Arunachalla |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
What does the header contain? Is the header going to remain constant? |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Hey
The simple solution to this is to add the logic to write the header in the program itself. |
|
Back to top |
|
|
jagadish2005
New User
Joined: 08 Mar 2005 Posts: 20
|
|
|
|
Hi murmohk1
My header is going remain constant ex:
Code: |
Name age
----------- -----
arunachalla 23
....
|
like this
Thanks
Jagadish Raju |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Here is the code:
Code: |
//step111 exec pgm=sort
//sysout dd sysout=*
//sortin dd dsn=your.input.file,disp=....
//sortout dd dsn=op.file,disp=....
//sysin dd *
sort fields=copy
OUTFIL REMOVECC,
header1=(c'name......', * put header here
/, * new line
80c'-' )
/* |
Assumed your OP file is 80 in lenght |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Arunachalla,
HEADER1 will give you ONE header at the beginning of the report. HEADER2 will give you a header at the beginning of each page. Which one you would use depends on which type of header you want.
Assuming you want a page header, the following DFSORT job will do what you asked for. If you want a report header, change HEADER2 to HEADER1. If you don't want ANSI carriage control characters (e.g. '1' for eject), specify REMOVECC on the OUTFIL statement.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
arunachalla 23
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL HEADER2=(1:'Name',22:'age',/,
1:11'-',22:5'-')
|
For more information on creating reports with DFSORT's OUTFIL, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.6.8?DT=20060615173822 |
|
Back to top |
|
|
jagadish2005
New User
Joined: 08 Mar 2005 Posts: 20
|
|
|
|
Hi Friends
I want to copy the data from one to another file
Input file : (length of input 169, DOES NOT contain any header)
Code: |
AAAA1234EEEE
BBBB1234EEEE
|
output file : (length of 200, header should be added)
Code: |
HEADER1 HEADER2 HEADER3
AAAA 1234 EEEE
BBBB 1234 EEEE
|
i need to do this using DFSORT. I tried it but itis not working , getting length error. How to solve this problem
Thanks
Arunachalla |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/169)
//SORTOUT DD DSN=... output file (FB/200)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(1:'HEADER1',13:'HEADER2',23:'HEADER3'),
BUILD=(1,4,13:5,4,23:9,4,200:X)
/*
|
|
|
Back to top |
|
|
|