IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy all except last record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Jul 31, 2008 7:22 pm
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: 355
Location: New York

PostPosted: Thu Jul 31, 2008 8:18 pm
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 Developer


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

PostPosted: Thu Jul 31, 2008 8:58 pm
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:

Use [URL] BBCode for External Links

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

Use [URL] BBCode for External Links
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
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 Developer


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

PostPosted: Fri Aug 01, 2008 8:32 pm
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
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: 355
Location: New York

PostPosted: Mon Aug 04, 2008 5:03 pm
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 Developer


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

PostPosted: Mon Aug 04, 2008 9:05 pm
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 Developer


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

PostPosted: Mon Aug 04, 2008 9:23 pm
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: 218
Location: India

PostPosted: Wed Aug 06, 2008 4:15 pm
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

Moderator Emeritus


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

PostPosted: Wed Aug 06, 2008 9:10 pm
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: 218
Location: India

PostPosted: Thu Aug 07, 2008 9:46 am
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

Moderator Emeritus


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

PostPosted: Thu Aug 07, 2008 7:22 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top