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

selecting specific records from the input file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sagarnsydney

New User


Joined: 12 Dec 2008
Posts: 16
Location: sydney

PostPosted: Thu Jun 25, 2009 4:03 pm
Reply with quote

Hi All,

Could you please help me on below requirement.

Requirement : I have input file of 100 records and I need to give input numbers and I have to copy only those records to the output file.

Eg:- If I give 5,45,79 means 5th,45th and 79th records should be copied to the output file.
Like wise,
If I give 7,24,56,67 means 7th,24th,56th and 67th records should be copied to the output file.

May I know whether this can be done using SORT....If yes....Could you please let me know the how to do this.


Thanks a lot in advance.

Regards,
Sagar
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 25, 2009 5:00 pm
Reply with quote

Quote:
I need to give input numbers


how do you plan on providing those input numbers?
Back to top
View user's profile Send private message
sagarnsydney

New User


Joined: 12 Dec 2008
Posts: 16
Location: sydney

PostPosted: Thu Jun 25, 2009 5:09 pm
Reply with quote

Hi Dick,

Thank you for response.

I want to give these input numbers using one of input file.

Regards,
Sagar
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 Jun 25, 2009 9:25 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *   Number file
2
8
12
/*
//SORTOUT DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=('  SUBSET FROM(IN) KEEP INPUT -'),
    BUILD=(C'  RRN(',1,3,UFF,TO=ZD,LENGTH=3,C') -',80:X),
    TRAILER1=('  TO(OUT) ')
/*
//S2    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD DSN=&&T1,DISP=(OLD,PASS)
Back to top
View user's profile Send private message
sagarnsydney

New User


Joined: 12 Dec 2008
Posts: 16
Location: sydney

PostPosted: Fri Jun 26, 2009 6:11 am
Reply with quote

Hi Frank,

Thanks for prompt responce.

But, I got below error.

SUBSET FROM(IN) KEEP INPUT -
$
ICE614A 0 INVALID OPERATOR

I think the environment dont have "z/OS DFSORT V1R5 PTF UK90013"

May I know whether Is there any alternative solution for this.

Regards,
Sagar.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 26, 2009 6:44 am
Reply with quote

sagarnsydney,

What is the LRECL and RECFM of your Input file that you want to copy?
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 Jun 26, 2009 9:08 pm
Reply with quote

Quote:
May I know whether Is there any alternative solution for this.


Yes, but it's quite a bit more involved than the SUBSET solution. Can you ask your System Programmer to install the PTF (it's free)? If not, give the LRECL and RECFM of your input file as Kolusu asked, and also show what you want the numbers input file to look like, and he or I will give you the more involved solution.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic 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 9
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top