View previous topic :: View next topic
|
Author |
Message |
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
How can I copy a sequential file into a KSDS file ?
Pls assume : RECFM=FB, LRECL=80
Thank you,
H?seyin |
|
Back to top |
|
|
jon_s_rice
Active User
Joined: 24 Mar 2005 Posts: 102 Location: Douglasville, GA USA
|
|
|
|
You can use IDCAMS repro command. This will work as long as you don't have duplicate keys. |
|
Back to top |
|
|
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
Thanks TheRexxGuy,
It worked partially. But,
What can I do if there are some duplicate keys/records in the sequential file ? |
|
Back to top |
|
|
thanooz
New User
Joined: 28 Jun 2005 Posts: 99
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
somasundaran_k
Active User
Joined: 03 Jun 2003 Posts: 134
|
|
Back to top |
|
|
logaas
New User
Joined: 19 Feb 2005 Posts: 25 Location: chennai
|
|
|
|
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 |
|
|
|