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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Select and Copy a few Records from a KSDS to O/P KSDS file
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: 7931
Location: Bellevue, IA

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

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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Feb 11, 2009 6:36 pm    Post subject:
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    Post subject: Reply to: Select and Copy a few Records from a KSDS to O/P K
Reply with quote

Key1 9(3)
Key2 X(19)

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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Feb 11, 2009 8:18 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Feb 11, 2009 8:21 pm    Post subject:
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 Moderator


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

PostPosted: Wed Feb 11, 2009 10:53 pm    Post subject:
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    Post subject:
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    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 HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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