Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL: How to convert a PS file into a VSAM file?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL: How to convert a PS file into a VSAM file?
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    Post subject: Re: JCL: How to convert a PS file into a VSAM file?
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    Post subject: Re: JCL: How to convert a PS file into a VSAM file?
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us