| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
Anand78
Joined: 06 Mar 2006
Posts: 48
Location: PUNE
|
| Posted: Fri Jul 04, 2008 6:08 pm Post subject: To copy only last |
|
|
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 |
|
krisprems
Joined: 27 Nov 2006
Posts: 624
Location: India
|
| Posted: Fri Jul 04, 2008 6:15 pm Post subject: |
|
|
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 |
|
Frank Yaeger
Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA
|
| Posted: Fri Jul 04, 2008 8:47 pm Post subject: |
|
|
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 |
|
Anand78
Joined: 06 Mar 2006
Posts: 48
Location: PUNE
|
| Posted: Mon Jul 07, 2008 1:29 pm Post subject: To read only last rcord |
|
|
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 |
|
Frank Yaeger
Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA
|
| Posted: Mon Jul 07, 2008 9:03 pm Post subject: |
|
|
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 |
|
Frank Yaeger
Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA
|
| Posted: Wed Jul 30, 2008 1:50 am Post subject: |
|
|
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 |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|