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: 8056
Location: East Dubuque, Illinois, USA

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: 995
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: 995
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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