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
 

 

copying sequential file into KSDS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Thu Jul 14, 2005 1:42 am    Post subject: copying sequential file into KSDS file
Reply with quote

How can I copy a sequential file into a KSDS file ?

Pls assume : RECFM=FB, LRECL=80

Thank you,

H?seyin
Back to top
View user's profile Send private message

jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Thu Jul 14, 2005 4:46 am    Post subject:
Reply with quote

You can use IDCAMS repro command. This will work as long as you don't have duplicate keys.
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Thu Jul 14, 2005 10:59 pm    Post subject: I did but...
Reply with quote

Thanks TheRexxGuy,

It worked partially. But,

What can I do if there are some duplicate keys/records in the sequential file ?
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Thu Jul 21, 2005 1:14 pm    Post subject:
Reply with quote

in first step you sort the file


sort fields=copy
sum fields=none

it eliminates duplicate records

the using idcams repro you can copy flat file into vsam ksds
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: Sat Jul 23, 2005 5:45 am    Post subject:
Reply with quote

thanooz,

You can't use SUM FIELDS=NONE with SORT FIELDS=COPY. You must sort the file in order to use SUM. You also don't need to use two steps.
You can SORT the file, eliminate duplicates with SUM and load the KSDS in one DFSORT step.

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   sequential input file
//SORTOUT DD DSN=...  VSAM KSDS output file
//SYSIN DD *
  SORT FIELDS=(p,m,BI,A)
  SUM FIELDS=NONE
/*


p is the starting position of the key and m is its length.

You can also do the same thing with DFSORT's ICETOOL as follows:

Code:

//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  sequential input file
//OUT DD DSN=...  VSAM KSDS output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(p,m,BI) FIRST
/*
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Sat Jul 23, 2005 10:39 pm    Post subject:
Reply with quote

Check the following link. Which discussed a similar problem using IDCAMS.

http://ibmmainframes.com/viewtopic.php?t=2456&highlight=error+limit

Regds
-Som
Back to top
View user's profile Send private message
logaas

New User


Joined: 19 Feb 2005
Posts: 25
Location: chennai

PostPosted: Tue Jul 26, 2005 2:33 pm    Post subject: Re: copying sequential file into KSDS file
Reply with quote

use repro command in your jcl pgm
//SYSPRINT DD SYSOUT=*
//SEQ DD DSN=(your sequential file path),DISP=OLD
//IND DD DSN=(index file),DISP=SHR
//SYSIN DD *
REPRO INFILE(SEQ) OUTFILE(IND)
/*
you can copy ps to ps,ksds to ps as well
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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