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

how to format records in 2 different ways using dfsort


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

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Wed Dec 14, 2005 4:48 pm
Reply with quote

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

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Dec 14, 2005 6:05 pm
Reply with quote

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

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Wed Dec 14, 2005 6:50 pm
Reply with quote

Partha,

Show us what you mean by reformat details & the trailer. How do you want your records look like ?

Alain
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Wed Dec 14, 2005 7:25 pm
Reply with quote

Hi,

It would be better if you give some example records.As of now
refer this link to get some clue on manipulating last record.

http://ibmmainframes.com/viewtopic.php?t=4603&start=0&postdays=0&postorder=asc&highlight=count

If you give some example,we can figure out your exact problem and
will be easy to give you some solution.
Back to top
View user's profile Send private message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Wed Dec 14, 2005 7:49 pm
Reply with quote

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

DFSORT Developer


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

PostPosted: Wed Dec 14, 2005 9:24 pm
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top