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

how to print the records of a sequential file in Reverse


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

New User


Joined: 25 Apr 2005
Posts: 6

PostPosted: Mon Oct 10, 2005 6:55 pm
Reply with quote

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

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Oct 10, 2005 7:42 pm
Reply with quote

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

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Tue Oct 11, 2005 12:52 am
Reply with quote

u can first sort the file aand use sysprint =p(ur local printer).the resord will get printed
Back to top
View user's profile Send private message
Doubts_ask

New User


Joined: 04 Oct 2005
Posts: 9

PostPosted: Thu Oct 13, 2005 2:52 pm
Reply with quote

Hi Priyesh,
Is SEQ NUM any keyword?? if its a keyword how to add it? can you explain in detail??

Thanks
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: Thu Oct 13, 2005 8:45 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts Sort SMF records? SYNCSORT 6
Search our Forums:


Back to Top