View previous topic :: View next topic
|
Author |
Message |
sagarnsydney
New User
Joined: 12 Dec 2008 Posts: 16 Location: sydney
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I need to give input numbers |
how do you plan on providing those input numbers? |
|
Back to top |
|
|
sagarnsydney
New User
Joined: 12 Dec 2008 Posts: 16 Location: sydney
|
|
|
|
Hi Dick,
Thank you for response.
I want to give these input numbers using one of input file.
Regards,
Sagar |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sagarnsydney
New User
Joined: 12 Dec 2008 Posts: 16 Location: sydney
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sagarnsydney,
What is the LRECL and RECFM of your Input file that you want to copy? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|