MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to copy last record from the flat file using sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Tue Oct 14, 2008 11:01 pm    Post subject: How to copy last record from the flat file using sort Reply with quote

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


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Wed Oct 15, 2008 1:24 am    Post subject: Reply with quote

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


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Oct 15, 2008 7:16 am    Post subject: Reply with quote

Hi Expat,

Thanks!!!

is it possible to set the MAXCC such it will terminate the flow abonormally

Thanks,
Siva
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Oct 15, 2008 1:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri Oct 17, 2008 10:00 pm    Post subject: Reply with quote

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


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Oct 17, 2008 11:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group