IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Add a record to output use DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Tue Dec 23, 2008 3:08 pm
Reply with quote

Hi,

Is there anyway to add a record to a output file using DFSORT? Here I have a file with length 140,FB,I want to add this text in the first and second record:

Code:

                                  Rcms use report           
name                 address             age             wage                       


Use DFSORT please.thx.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Dec 23, 2008 10:18 pm
Reply with quote

DFSORT allows you to add header and trailer records of various types. HEADER1 is the report header, HEADER2 is the page header and HEADER3 is the section header. Likewise for TRAILERx. In your case, since you want to add the records at the beginning of the file, you could use HEADER1 like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/140)
//SORTOUT DD DS=...  output file (FB/140)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=(35:'Rcms use report',/,
     1:'name',22:'address',42:'age',58:'wage')
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Wed Dec 24, 2008 6:37 am
Reply with quote

To Frank Yaeger:

Yes,thanks!As you advise it works now!

BTW,Can u tell me when I use 'lines=100', why there is some '1' and '0' chars in the first row?
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Wed Dec 24, 2008 6:44 am
Reply with quote

Frank,

What does the 'outfil=removecc' means?Is it use to remove the '0' and '1' the generated by using header?
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Wed Dec 24, 2008 6:51 am
Reply with quote

Thanks Frank,

I found the answer in 'z/OS DFSORT Getting Started':

For reports, OUTFIL places an ANSI carriage control character in the first byte of each output line to tell a printer what action to take for that line. The ’1’ for Data line 01 and Data line 11 tells the printer that these lines each start on a new page. This is the way DFSORT translates LINES=10 into 10 lines per page for the printer. Other ANSI carriage control characters that DFSORT uses for OUTFIL reports are: blank for single space (no blank lines before the output line), ’0’ for double space (one blank line before the output line), and ’-’ for triple space (two blank lines before the output line).

When you view a report on your display, the ANSI carriage control is not meaningful, and is usually not displayed even though it’s actually in the record. If you don’t want ANSI carriage control characters in your output records, you can use OUTFIL’s REMOVECC parameter to remove them (more on this later).


Thanks a lot,next time before ask I will find in this book first!I don't want to waste your time.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Dec 24, 2008 8:49 pm
Reply with quote

Quote:
I found the answer in 'z/OS DFSORT Getting Started'


Good.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top