View previous topic :: View next topic
|
Author |
Message |
chandu_b007
New User
Joined: 25 Apr 2005 Posts: 6
|
|
|
|
how to print the records of a flat-file(sequential file) in reverse order
can any one suggest me
advance thanks
Chandu |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi Chandu,
You can add SEQ NUM to every rec & then you can SORT the file DESCENDING on SEQ NUM.
I remember this query discussed earlier too.....Please make a search for more solutions.
Regards,
Priyesh. |
|
Back to top |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
u can first sort the file aand use sysprint =p(ur local printer).the resord will get printed |
|
Back to top |
|
|
Doubts_ask
New User
Joined: 04 Oct 2005 Posts: 9
|
|
|
|
Hi Priyesh,
Is SEQ NUM any keyword?? if its a keyword how to add it? can you explain in detail??
Thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Chandu,
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
* Add seqnum after end of records.
INREC OVERLAY=(81:SEQNUM,8,ZD)
* Sort descending on seqnum.
SORT FIELDS=(81,8,ZD,D)
* Remove seqnum.
OUTREC BUILD=(1,80)
/*
|
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 |
|
|
|