Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 48
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
References
krisprems

Senior Member


Joined: 27 Nov 2006
Posts: 624
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: 4613
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: 48
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: 4613
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: 4613
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1