Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

selecting specific records from the input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: selecting specific records from the input file
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: 6967
Location: porcelain throne

PostPosted: Thu Jun 25, 2009 5:00 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Jun 25, 2009 9:25 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: selecting specific records from the input file
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 Moderator


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

PostPosted: Fri Jun 26, 2009 9:08 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us