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
 

 

COPY from 1 PS to another with some condition
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 12:55 am    Post subject: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 1:18 am    Post subject:
Reply with quote

Hello,

If you intend to use your sort product, read about INCLUDE in the documentation.
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 1:22 am    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Mar 23, 2010 1:25 am    Post subject:
Reply with quote

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:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 1:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Mar 23, 2010 1:45 am    Post subject:
Reply with quote

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
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 2:09 am    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Mar 23, 2010 2:15 am    Post subject:
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Mar 23, 2010 2:17 am    Post subject:
Reply with quote

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
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 2:28 am    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Mar 23, 2010 3:25 am    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

Just curious ... What is huge? A few million record for example is nothing to a mainframe box.
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 5:20 pm    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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. icon_smile.gif
Also its taking 3-4 mins to open that file in browse mode.
Regards,
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Mar 23, 2010 8:04 pm    Post subject: Re: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 8:23 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 23, 2010 8:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Mar 23, 2010 10:25 pm    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

Its not clear after reading that manual. Still finding the way to perform the above task icon_sad.gif
Regards,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 11:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Wed Mar 24, 2010 12:06 am    Post subject: Reply to: COPY from 1 PS to another with some condition
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Mar 24, 2010 12:35 am    Post subject:
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Mar 24, 2010 12:45 am    Post subject:
Reply with quote

Oops, I looked a little further, and it was clear to me after all. icon_redface.gif

Oh well, the solution should work for you anyways.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts How to copy Tape dataset to unix main... chaky All Other Mainframe Topics 4 Fri Jul 08, 2016 2:52 am


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