View previous topic :: View next topic
|
Author |
Message |
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
Hi Friends,
I have a file with some thousands records. All are detail records except the last one. There is no field to distinguish the trailor record except that its the last one. Now, I want to reformat the detail records and the trailor record in two different ways using DFSORT. Could you please let me know how to do that?
Thank you,
Partha |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
hi,
i think u know what exactly is the data in the trailor record
like 'this is the trailor record'
you can use the include cond feature with 'this' as ur value base.
ex : INCLUDE COND=(1,4,CH,EQ,C'this') or some thing similar to this.
pls correct me if am wrong.
Regards, |
|
Back to top |
|
|
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Partha,
Show us what you mean by reformat details & the trailer. How do you want your records look like ?
Alain |
|
Back to top |
|
|
pushpagiri
New User
Joined: 07 Jul 2005 Posts: 51
|
|
Back to top |
|
|
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
The file is FB=80 and will remain the same after formatting. I have the records as below..
00000000005131100020318020121205000000006070047755540
00000000005131100020318070121205000000019381046440755
00000000005131100020318110121205000000862266055565565
00000000005131100020318120121205000000249401055565566
00000000005131100020318150121205000000106207041244513
00000000005131199999999900000310000282777933
The last one is a trailer record while all other are data records. Any number of data records could be there.
I need to reformat the fields in the records like increasing length of a field by adding zeros, inserting spaces in between fields etc..
The formatting would be the same for all data records but different for the last record.
I plan to use OUTREC for formatting. But not sure how to seperate out the tarilor record and do a different OUTREC.
The trailor record has spaces in 45-53 while data records have numeric values.
hope these will assist you..
Thanks a lot guys,
Partha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
The trailor record has spaces in 45-53 while data records have numeric values. |
So the trailer record is identifiable. You can use a DFSORT job like this to do what you want. Just use the first BUILD for the data records and the second BUILD for the trailer record (BUILD has the same syntax as OUTREC).
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Reformat data records
INREC IFTHEN=(WHEN=(45,9,CH,NE,C' '),
BUILD=(...)),
* Reformat trailer record
IFTHEN=(WHEN=NONE,
BUILD=(...))
/*
|
You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|