Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
how to print the records of a sequential file in Reverse

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
chandu_b007

New User


Joined: 25 Apr 2005
Posts: 6

PostPosted: Mon Oct 10, 2005 6:55 pm    Post subject: how to print the records of a sequential file in Reverse
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
References
priyesh.agrawal

Global Moderator


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

PostPosted: Mon Oct 10, 2005 7:42 pm    Post subject: Re: flat-file printing
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: 185

PostPosted: Tue Oct 11, 2005 12:52 am    Post subject: hi
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: 10

PostPosted: Thu Oct 13, 2005 2:52 pm    Post subject: SEQ NUM
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 Moderator


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

PostPosted: Thu Oct 13, 2005 8:45 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1