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
 
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: 6970
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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