Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy all except last record

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kumara.kranthi

New User


Joined: 03 Nov 2006
Posts: 21

PostPosted: Thu Jul 31, 2008 6:02 pm    Post subject: If i want to skip last record
Reply with quote

Hello All,

Please help me my file contain N records , i want to copy N-1 records and skip Last records,Please give Sort Card for this.

Thanks,
KK
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jul 31, 2008 7:22 pm    Post subject:
Reply with quote

kumara.kranthi

Please do not start a new topic in an existing thread.

Topic split.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu Jul 31, 2008 8:18 pm    Post subject:
Reply with quote

You can use the folowing code.

Code:

//STEP1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//INDD DD DSN= INPUT FILE
//OUTDD DD DISP=OUTPUT FILE
//TOOLIN DD *
   SUBSET FROM (INDD) TO (OUTDD) REMOVE INPUT LAST
/*
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: Thu Jul 31, 2008 8:58 pm    Post subject:
Reply with quote

KK,

Note that you will need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) in order to use the new SUBSET operator. Ask your System Programmer to install that PTF (it's free). For complete details on all of the new functions available with that PTF, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

In the meantime, you can use the technique described in the "Keep the last n records" Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
kumara.kranthi

New User


Joined: 03 Nov 2006
Posts: 21

PostPosted: Fri Aug 01, 2008 10:49 am    Post subject:
Reply with quote

Frank,

Thanks for yours help!!

Example: My file contain 1000 records or N records (include header and trailer),now i want to do Skip 1st and last record and copy all the records.


Could you please help me for Sort card on this.

Thanks,
KK
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 Aug 01, 2008 8:32 pm    Post subject:
Reply with quote

Again, you can use the new SUBSET operator as follows if you have 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 DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) REMOVE INPUT HEADER TRAILER
/*


I can show you a more complex way to do this without SUBSET, but I need to know the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
kumara.kranthi

New User


Joined: 03 Nov 2006
Posts: 21

PostPosted: Mon Aug 04, 2008 12:12 pm    Post subject:
Reply with quote

Thanks for yours quick response.

LRECL=210 and RECFM=FB
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Aug 04, 2008 5:03 pm    Post subject:
Reply with quote

Frank,

Just I want to ask a question on version of DFSORT.

How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not?

When I am executing SORT, getting the following.

Quote:

CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.


Is this updated version to execute newly included options like SUBSET?
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 Aug 04, 2008 9:05 pm    Post subject:
Reply with quote

Quote:
How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not?


Run a DFSORT job and look at the ICE201I message. If it has an F after ICE201I, you have PTF UK90013.

ICE201I F RECORD TYPE ...

If it has an E after ICE201I, you don't have PTF UK90013.

Note that your System Programmer must install PTF UK90013 in order to make it available.

Quote:
When I am executing SORT, getting the following.

CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.

Is this updated version to execute newly included options like SUBSET?


That message just tells you you're using z/OS DFSORT V1R5 ... it doesn't tell you which PTFs are installed. You need PTF UK90013 to use SUBSET (see ICE201I to determine if you have that PTF).
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 Aug 04, 2008 9:23 pm    Post subject:
Reply with quote

kumara.kranthi,

Here's a DFSORT job that will do what you asked for without PTF UK90013:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/210)
//C1 DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=C1,REMOVECC,NODETAIL,
    BUILD=(80X),
    TRAILER1=(' OPTION COPY,SKIPREC=1,',
     'STOPAFT=',COUNT-2=(M11,LENGTH=8))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/210)
//SORTOUT DD DSN=...  output file (FB/210)
//SYSIN DD DSN=&&C1,DISP=(OLD,PASS)
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 215
Location: India

PostPosted: Wed Aug 06, 2008 4:15 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
Quote:
How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not?


Run a DFSORT job and look at the ICE201I message. If it has an F after ICE201I, you have PTF UK90013.

ICE201I F RECORD TYPE ...

If it has an E after ICE201I, you don't have PTF UK90013.

Note that your System Programmer must install PTF UK90013 in order to make it available.

Quote:
When I am executing SORT, getting the following.

CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.

Is this updated version to execute newly included options like SUBSET?


That message just tells you you're using z/OS DFSORT V1R5 ... it doesn't tell you which PTFs are installed. You need PTF UK90013 to use SUBSET (see ICE201I to determine if you have that PTF).


Hi Frank i found this :
Code:

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1


Does this mean that PTFs are installed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 06, 2008 9:10 pm    Post subject:
Reply with quote

Hello,

Look at your message and Frank's info.

Your message has an E following ICE201I - which is not PTF UK90013 (which is an F).
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 215
Location: India

PostPosted: Thu Aug 07, 2008 9:46 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Look at your message and Frank's info.

Your message has an E following ICE201I - which is not PTF UK90013 (which is an F).


Little confused earlier..Now Got it..Thank you dick..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Aug 07, 2008 7:22 pm    Post subject: Reply to: Copy all except last record
Reply with quote

You're welcome icon_smile.gif

Quote:
Little confused earlier..
Not to worry, we all get there sometimes icon_wink.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us