IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Select and Copy a few Records from a KSDS to O/P KSDS file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nivasaya

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Wed Feb 11, 2009 5:49 pm
Reply with quote

Dear Buddies,

I need to select and copy a few Records from a KSDS file to another KSDS file.
Records to be copied – Header (000), Trailer(999) and Partial KEY ‘123’ records.

Currently I am it is done in 2 steps:
STEP 1 - SORT ing the I/P KSDS file to a FLAT file,
STEP 2 - IDCAMS to copy the FLAT file to new O/P KSDS file.

Can we have any other way to have only ONE step to do this.

Thanks & Regards,
Nivasaya
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 11, 2009 5:52 pm
Reply with quote

IDCAMS REPRO FROMKEY( ) TOKEY( )
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Feb 11, 2009 6:36 pm
Reply with quote

What do you mean by
Quote:
and Partial KEY ‘123’ records.



You need to give more information on your input records and what you expect in output. Is the key 3 bytes? Is it character? Is '123' a key or part of a key? If part, is it a generic the start of key(s)? If it's a full key, are you looking to extract only part of the data for that key?

Garry.
Back to top
View user's profile Send private message
nivasaya

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Wed Feb 11, 2009 7:23 pm
Reply with quote

Key1 9(3)
Key2 X(19)

Key1 - 123
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Feb 11, 2009 8:18 pm
Reply with quote

I still don't know what you want. We're not clairvoyants. What does
Quote:
Key1 9(3)
Key2 X(19)

Key1 - 123
mean? and how does it relate to your requirements?

Garry.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Feb 11, 2009 8:21 pm
Reply with quote

What is the actual key length of the KSDS, is it 3, 19 or 22.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Feb 11, 2009 10:53 pm
Reply with quote

Nivasaya,

Assuming that the 3 characters of interest are in the first three bytes of the records, I would think that a DFSORT job like this would do what you want:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... VSAM input KSDS
//SORTOUT DD DSN=... VSAM output KSDS
//SYSIN    DD    *
  OPTION COPY
  RECORD TYPE=V
  INCLUDE FORMAT=ZD,
    COND=(5,3,EQ,0,OR,5,3,EQ,123,OR,5,3,EQ,999)
/*
Back to top
View user's profile Send private message
nivasaya

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Thu Feb 12, 2009 7:31 pm
Reply with quote

Thanks a lot Frank, Gary and Robert for your kind response.

I am very sorry to give only a few info, 'cause of the of the crunchy delivery.

Thanks Frank, i shall test the same, i was looking for the similar one.

our earlier plan was
1) Select a few records from the KSDS file to FLAT file using COBOL pgm based on few criteria.
2) Sort the FLAT file based on the key1,FLd1,Key2
3) use the SORTed file to O/P to the other FLAT report file.

Thanks & Regards,
Nivasaya
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top