View previous topic :: View next topic
|
Author |
Message |
lee_issc
New User
Joined: 11 Dec 2008 Posts: 33 Location: China
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
lee_issc
New User
Joined: 11 Dec 2008 Posts: 33 Location: China
|
|
|
|
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 |
|
|
lee_issc
New User
Joined: 11 Dec 2008 Posts: 33 Location: China
|
|
|
|
Frank,
What does the 'outfil=removecc' means?Is it use to remove the '0' and '1' the generated by using header? |
|
Back to top |
|
|
lee_issc
New User
Joined: 11 Dec 2008 Posts: 33 Location: China
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I found the answer in 'z/OS DFSORT Getting Started' |
Good. |
|
Back to top |
|
|
|