Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have a sequential file in which there are 50 records. Now
I want to copy all the 50 records in the reverse order into
a new file? The last record in the original file should be
the first record in the new file. How can I do it?

Answer Posted / avinashn17

The above soultion works only if records are in the sorted
order.

The below piece of code could be used for records which are
not sorted.
******************************************************
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT,
// DISP=SHR
//SORTOUT DD DSN=OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0),
// DATACLAS=PSFB
//SYSIN DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTREC BUILD=(1,80)
/*
*********************************************************
Record length of the above file is 80
INREC OVERLAY - places sequence number after 80.
Then it is sorted in descending order of sequence nummber.
OUTREC BUILD - removes sequence number and retains original
record.

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can a jobs execution priority be modified?

1159


How can an in-stream dataset be terminated?

1305


what happens in execution stage in job processing?

1101


what JCL Procedures?

1201


what is the use of JCL?

1118


List the different components of jcl statement?

1039


How does the jcl specify the job to os?

1109


In job processing, what happens in execution stage?

1151


What is the format of comment statement?

1141


List the various advantages of using jcl language?

1399


State the uses of syspring, sysin, sort fields, sum fields and dummy.

1032


How jcl work to handle various input output file operations?

1106


What dd statement is used to supply the name of a dataset?

1349


What do you understand by the term job time – out and how can you overcome that?

986


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

1243