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?

Answers were Sorted based on User's Feedback



I have a sequential file in which there are 50 records. Now I want to copy all the 50 records in t..

Answer / 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

I have a sequential file in which there are 50 records. Now I want to copy all the 50 records in t..

Answer / sanju

use sort card:
//SYSIN DD *
COPYBACK OUT=50
/*

Is This Answer Correct ?    4 Yes 0 No

I have a sequential file in which there are 50 records. Now I want to copy all the 50 records in t..

Answer / shammi

But COPYBACK option can be used using File aid only...

Is This Answer Correct ?    3 Yes 0 No

I have a sequential file in which there are 50 records. Now I want to copy all the 50 records in t..

Answer / avinash n

The file could be sorted in the descending order.

Synatx:

SORT FIELDS=(1:Y,CH,D)
where Y = record length.

The output would be in the reverse order!

Is This Answer Correct ?    0 Yes 13 No

Post New Answer

More JCL Interview Questions

what is the purpose of coding class parameter in job statement?

0 Answers   IBM,


How jcl is used for testing batch programs?

0 Answers  


which are the parameters mandatory in job card ?

4 Answers   Accenture,


what is the difference between return code and maxcc?

2 Answers   iGate,


How to delete generations of gdg without deleting gdg base?

3 Answers  


What is the purpose of the PARM keyword in the EXEC statement?

3 Answers  


Suppose a proc step has a DD statement like //ABC DD DSN=TEST.FILE1,DISP=SHR DSN=TEST.FILE2,DISP=SHR and the above DD name is overridden from the JCL as given below //procstepname.ABC DD DSN=TEST.FILE3 - Will the DD statement now have just TEST.FILE3 or it will be TEST.FILE3 and TEST.FILE2? Suppose if it is overridden twice like //procstepname.ABC DD DSN=TEST.FILE3 //procstepname.ABC DD DSN=TEST.FILE4 Will this give a JCL error? If not, what will be final output?

2 Answers  


whats the difference between empty and noempty of GDG?

4 Answers   Patni,


Explain about LMMLIST�list a library's members

1 Answers  


if the submitter of a job wants to inform another user about the job completion, how can it be done?

0 Answers   IBM,


can u execute a proc from another proc?

5 Answers   Logica CMG,


what operation is performed by job statement?

0 Answers   IBM,


Categories