Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
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: 998
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: 998
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us