View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Tue Oct 14, 2008 11:01 pm Post subject: How to copy last record from the flat file using sort |
|
|
Hi,
I have a requirement in which i need to copy last record from a file into other. In the next i need to comapre the new file from above to the existing to the existing file,based on return code of the compare step i.e. if zero delete 1st record form new file else abend the job.
Is there any way to abend the job using only return code from previous step.
Thanks,
Siva |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Wed Oct 15, 2008 1:24 am Post subject: |
|
|
Some places have a dodgy module which will always abend when it is executed, some shops use a SAS program to create an abend, some shops don't use anything like this.
Certainly one to ask your peers about. If they ddo have something like the above then yes it can be conditionally executed. If not, then you will need to think of some other way to terminate execution. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Wed Oct 15, 2008 7:16 am Post subject: |
|
|
Hi Expat,
Thanks!!!
is it possible to set the MAXCC such it will terminate the flow abonormally
Thanks,
Siva |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Oct 15, 2008 1:24 pm Post subject: |
|
|
You can always run a program that doesn't exist to create an abend like -
Code: | // IF PREVSTEP.RC > 0 THEN
// EXEC PGM=ABENDJOB
// ENDIF |
|
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Fri Oct 17, 2008 10:00 pm Post subject: |
|
|
Hi Dibakar,
Thanks for your reply.....
Is there any other way we can copy records backwards , i know one using file-aid.
Thanks,
Siva |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Oct 17, 2008 11:09 pm Post subject: |
|
|
sivafdms,
If you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can use the new SUBSET operator to keep/remove the header and trailer records. For example, TRAILER(4) or LAST(4) keeps or removes the last 4 records.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP LAST INPUT
/* |
For complete details on the new DATASORT and SUBSET functions and the other new functions available with PTF UK90013, see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|