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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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