IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

copying sequential file into KSDS file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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 Developer


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

PostPosted: Sat Jul 23, 2005 5:45 am
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
Reply with quote

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

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top