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

JCL: How to convert a PS file into a VSAM file?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Mon Jun 05, 2006 11:32 am
Reply with quote

Hi, anybody could help me on this? Thank you so much!

PS layout:
field 1 (will be the key of vsam)
field 2
...
field n

VSAM layout:
field 1 (the key)
field 2
...
field n
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jun 06, 2006 12:42 am
Reply with quote

What is the record length, and what is the definition of the Key field?

Dave
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jun 06, 2006 12:43 am
Reply with quote

And the location of the Key field in the record
Back to top
View user's profile Send private message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Tue Jun 06, 2006 6:49 am
Reply with quote

Appriciate your reply, thank you!

01 RMRELN-REC.
05 OUT7-CUSTNUMB PIC 9(09).
05 OUT7-RELN-NUMB PIC 9(09).
05 OUT7-PP-ACCTNUMB PIC X(20).
05 OUT7-PP-PRODTYPE PIC X(05).

OUT7-CUSTNUMB is the key. Total length is 43.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Jun 06, 2006 12:22 pm
Reply with quote

Hi,

You can use IDCAMS to convert (rather copy) a sequential file to VSAM KSDS cluster.

One way to do that is to write DELETE, DEFINE CLUSTER and REPRO steps in your JCL.

1. delete if cluster exists.
2. Define a new cluster with record length and keys information.
3. copy from PS file to newly defined KSDS cluster in 2nd step.

Thanks,
Parikshit
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Tue Jun 06, 2006 4:06 pm
Reply with quote

Supply you job card, file name and PS file name in the following JCL and execute., let me know if you have any problem.

SUPPLY YOUR JOBCARD HERE
//DDACTMST EXEC PGM=IDCAMS
//SYSIN DD *
DELETE FILE NAME SCRATCH
SET MAXCC=00
DEFINE CLUSTER-
(NAME(FILE NAME)-
FREESPACE(0 5)-
INDEXED-
KEYS(9 0)-
RECORDSIZE(43 43)-
SPEED-
DATACLAS(VSAMNOCP) -
SHAREOPTIONS(2 3)-
CYL (5 5)-
NONSPANNED)-
DATA-
(NAME(FILE NAME.DATA)-
CONTROLINTERVALSIZE(4096))-
INDEX-
(NAME(FILE NAME.INDEX)-
CONTROLINTERVALSIZE(1024))
/*

//REPRO1 EXEC PGM=IDCAMS
//SYSUT1 DD DSN=PS NAME,DISP=SHR
//SYSUT2 DD DSN=FILE NAME,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(SYSUT1) OUTFILE(SYSUT2)
/*
Back to top
View user's profile Send private message
rdr

New User


Joined: 26 May 2006
Posts: 35
Location: india

PostPosted: Thu Jul 06, 2006 11:52 am
Reply with quote

Hi,

We can use SORT utility to achive the same.
In sort input is flat file,
output is vsam file,
Options are --

Copy,
Sum feilds = none, to eliminate the duplicate, if any....

Correct me if I am wrong...
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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
Search our Forums:

Back to Top