View previous topic :: View next topic
|
Author |
Message |
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Hello All,
I am looking for some way to copy some record from a PS to another on the basic of criteria.
Like Record(1:8) = 'TESTGPK '
Record is the record of the PS.
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you intend to use your sort product, read about INCLUDE in the documentation. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
That process i am aware.. but let me introduce one condition,
The input file is tooooo huge.
I need to copy the content of one record which satisfy the above condition.
Looking for the best efficient way!!!
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Assuming that you want to write input records that have 'TESTGPK' in positions 1-8 to an output dat set, you can use a DFSORT job like the following:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB)
//SORTOUT DD DSN=... output file (FB)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,8,CH,EQ,C'TESTGPK')
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but let me introduce one condition,
The input file is tooooo huge.
I need to copy the content of one record which satisfy the above condition.
Looking for the best efficient way!!! |
There is no way to randomly process this file so that only the desired record(s) are read. . .
The entire file must be read and the INCLUDEd record(s) copied to the output. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you want to copy only the FIRST record that satisfies the condition, you can change the job I showed to have:
Code: |
OPTION COPY,STOPAFT=1
INCLUDE COND=(1,8,CH,EQ,C'TESTGPK')
|
That will tell DFSORT to stop reading the input records as soon as the target record is found which can be more efficient than reading all of the records (depending of course on how close to the top the target record is). |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
But this condition will also treverse all the previous records.
@DICK: I agree that there is no way to get random records in a PS.
but is it possible with VSAM Dataset.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I don't understand what you're asking for. If you don't know where the record with the target string is in the file, how can you expect to only access that record?
Are you talking specifically about the "key" of a VSAM KSDS? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
If your VSAM file is a KSDS file, and
If the Primary key field is 1 thru 8 in your case....
Then you could use IDCAMS to REPRO the record into another file.
This would be a faster option.
Lots of IFs here. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Actually we just came to know from different group about the input file, my group dosnt handle that file, but due to some requirements we need to access that file. As that file is too huge, i was a bit worried so i was looking for some alternatives. now we can ask them to provide the data in according to our requirement. that will work, otherwise we have to use lots of resources. Anyways thanks all for your advices and suggestions.
Regards, |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Just curious ... What is huge? A few million record for example is nothing to a mainframe box. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
That File contains the backup of ACF2, All the ids with some details.
And there are millions of millions of Ids in system. Hope this ends your curiosity.
Also its taking 3-4 mins to open that file in browse mode.
Regards, |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
GauravKudesiya wrote: |
Also its taking 3-4 mins to open that file in browse mode. |
So why are you accessing it in TSO rather than in a batch job? |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
What will be the SYSIN if i use IDCAMS.
Code: |
//STEP001 EXEC PGM=IDCAMS
//SYSIN DD *
REPRO INFILE(FILE01) OUTFILE(FILE02)
/*
//FILE01 DD DSN=PROD.FILE1.INPUT,DISP=SHR
//FILE02 DD DSN=PROD.FILE2.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(TRK,(100,10),RLSE),
// DCB=(RECFM=FB,BLKSIZE=4000,LRECL=4000)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=* |
There must be some more parameters in REPRO.
for Using KEY = 'TESTGPKb' (b=> Blank)
Regards, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Just to reiterate what has already been said.
Yes, there are. And this is a classic request for a RTFM response.
Is the input file a KSDS.
Is the value that you wish to extract the primary VSAM key.
If so, click the "IBM Manuals" button at the top of the page and find the IDCAMS manual. Then read it.
VSAM services for DFsms is the book that you MUST read for yourself. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Its not clear after reading that manual. Still finding the way to perform the above task
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What did you read concerning FROMKEY and TOKEY?
More basic, which manual did you look in?
From the "IBM Manuals" link you want "VSAM Services for DFSMS" |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Hi Dick,
First of all i look into the same manual.
Secondly,
I have to select only one record, so i think cannot use FROMKEY and TOKEY.
Also i know the value of the key not the key number.
What i will do in this case?
Regards, |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I too looked in the manual, and I admit, it is not really clear.
So, the FROMKEY is the value so your good with that (make sure the length matches exactly with regard to leading or trailing spaces).
leave the TOKEY off, and add COUNT(1).
That should do it. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Oops, I looked a little further, and it was clear to me after all.
Oh well, the solution should work for you anyways. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
As the OP has said that the input is a PS file, it looks as though using SORT may be the best / only option. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
That is the way he started. But then the usual flip-flop to:
Quote: |
but is it possible with VSAM Dataset..
|
So we started down this road.
I guess an actual commitment to a specification would be need for this thread to continue. |
|
Back to top |
|
|
|