Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Producing ouput file with header using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jagadish2005

New User


Joined: 08 Mar 2005
Posts: 20

PostPosted: Thu Mar 15, 2007 3:45 pm    Post subject: Producing ouput file with header using DFSORT
Reply with quote

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
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 3:50 pm    Post subject:
Reply with quote

What does the header contain? Is the header going to remain constant?
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Thu Mar 15, 2007 4:06 pm    Post subject:
Reply with quote

Hey

The simple solution to this is to add the logic to write the header in the program itself.
Back to top
View user's profile Send private message
jagadish2005

New User


Joined: 08 Mar 2005
Posts: 20

PostPosted: Thu Mar 15, 2007 4:54 pm    Post subject: Re: ouput file with header
Reply with quote

Hi murmohk1

My header is going remain constant ex:

Code:

Name                 age
-----------          -----
arunachalla          23
....


like this

Thanks
Jagadish Raju
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 5:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 15, 2007 8:46 pm    Post subject:
Reply with quote

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:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.6.8?DT=20060615173822
Back to top
View user's profile Send private message
jagadish2005

New User


Joined: 08 Mar 2005
Posts: 20

PostPosted: Fri Mar 16, 2007 8:52 pm    Post subject: Re: Producing ouput file with header using DFSORT
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Mar 16, 2007 9:23 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us