Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To copy only last

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Jul 04, 2008 6:08 pm    Post subject: To copy only last
Reply with quote

I have one extract file. It's holding work of date in the last record and some information. I need to copy only the last record into some other file for further process.

Please advise me how to achieve this task using DFSORT.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 04, 2008 6:15 pm    Post subject:
Reply with quote

check this example
Code:
//OMIT     EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
 HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
/*                                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  OPTION COPY                                         
  OUTFIL REMOVECC,NODETAIL,                           
      TRAILER1=(1,80)                                 
/*                                                   
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Jul 04, 2008 8:47 pm    Post subject:
Reply with quote

Krisprems,

Your solution assumes that the OP's input file has RECFM=FB and LRECL=80. That may or may not be the case, but you should have mentioned it.

Anand78,

If you need more help with this, show an example of your input records. Is there anything unique about the "last" record that can be used to identify it? What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Mon Jul 07, 2008 1:29 pm    Post subject: To read only last rcord
Reply with quote

Hi ,

The last record is having only date,time and count.
LRECL = 80
RECFM = FB

I copy paste the last record

...................................07/01/2008 200000 14:30

Thanks
Anand
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Jul 07, 2008 9:03 pm    Post subject:
Reply with quote

Anand,

Since your input file does have RECFM=FB and LRECL=80, you can use the DFSORT job Krisprems showed (I'm surprised you didn't just try it).
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Jul 30, 2008 1:50 am    Post subject:
Reply with quote

You can do this kind of thing quite easily without worrying about the RECFM or LRECL using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DISP=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT KEEP LAST
/*


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

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

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us