MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copying KSDS and RRDS in to a Sequential Dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Tue May 31, 2005 6:09 pm    Post subject: Copying KSDS and RRDS in to a Sequential Dataset Reply with quote

Hi,
I have three VSAM files A, B and C. Out of which A and B are KSDS and C is a RRDS. I want to copy all these three files in to a sequential file and ftp it to a server, from which I will load it in to a Oracle database. The combiantion of A, B and C is like a multi dimensional database. A will have a key with which we can go to B and fetch the data. For some data in B we will have values in C. The file C will have the values in bit format. But my output sequential files should be a coma(,) separated one. I knew that we can use REPRO, but in order to get coma(,) separated Iam not sure. Also I'm not sure how the RRDS will work for REPRO. Please come up with some ideas.

Thanks & Regards
Vasudeep
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue May 31, 2005 6:12 pm    Post subject: Reply with quote

emdaya9,

We need more details. what is the LRECL RECFM of the vsam clusters. Also please post a sample input and desired output

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Tue May 31, 2005 6:35 pm    Post subject: Reply with quote

For A:

Device type: 3390
Organization: KSDS EXTENDED
KSDS key length: 8
KSDS key location: 0
Average record size: 100
Maximum record size: 32000



For B:

Device type: 3390
Organization: KSDS EXTENDED
KSDS key length: 7
KSDS key location: 0
Average record size: 100
Maximum record size: 12500

C is

Device type: 3390
Organization: RRDS
KSDS key length: 0
KSDS key location: 0
Average record size: 1016
Maximum record size: 1016


So I need all these three files to be copied in to three Sequential files from which I need to upload to a Oracal Database.

I'm unable to give you sample input and output. But I Can say I need to copy all these 3 VSAMS in to a sequential file and need not be a comma separated one.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue May 31, 2005 6:57 pm    Post subject: Reply with quote

Quote:

I Can say I need to copy all these 3 VSAMS in to a sequential file and need not be a comma separated one.


emdaya9,

It is a very easy task and IDCAMS REPRO can do that for you. try this JCL

Code:

//STEP0100 EXEC PGM=IDCAMS                               
//*                                                       
//SYSPRINT DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD DSN=YOUR INPUT VSAM CLUSTER A,
//            DISP=SHR
//IN2      DD DSN=YOUR INPUT VSAM CLUSTER B,
//            DISP=SHR
//IN3      DD DSN=YOUR INPUT VSAM CLUSTER C,
//            DISP=SHR
//OUT1     DD DSN=YOUR OUTPUT SEQ FILE A,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//OUT2     DD DSN=YOUR OUTPUT SEQ FILE B,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//OUT3     DD DSN=YOUR OUTPUT SEQ FILE C,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *                                     
  REPRO INFILE(IN1) OUTFILE(OUT1)
  REPRO INFILE(IN2) OUTFILE(OUT2)
  REPRO INFILE(IN3) OUTFILE(OUT3)
/*


Or you can use even sort to copy a vsam cluster to a sequential file as shown below.

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR VSAM CLUSTER A,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR FLAT FILE COPY OF A,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR VSAM CLUSTER B,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR FLAT FILE COPY OF B,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
/*
//STEP0300 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR VSAM CLUSTER C,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR FLAT FILE COPY OF C,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Tue May 31, 2005 7:34 pm    Post subject: Reply with quote

Thanks very much for the help, and what should I do If I need a comma delimiter in the out???
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jun 01, 2005 9:02 am    Post subject: Reply with quote

Quote:

Thanks very much for the help, and what should I do If I need a comma delimiter in the out???


emdaya9,

Very easy task. You need to find out the layout for the vsam cluster fields and then code a comma in between them using sort.

ex:

If the vsam cluster layout is as follows
Code:

01 EMP-RECORD.
   05 EMPNO                PIC X(6).
   05 FIRSTNAME            PIC X(20).
   05 MIDINIT              PIC X(1).
   05 LASTNAME             PIC X(20).
   05 WORKDEPT             PIC X(3).
   05 HIREDATE             PIC X(10).


The following sort control cards will put a comma between each field.
Code:

 SORT FIELDS=COPY
 OUTREC FIELDS=(01,06,
                C';',
                07,20,
                C';',
                27,1,
                C';',
                28,20,
                C';',
                48,3,
                C';',
                51,10)


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Wed Jun 01, 2005 10:38 am    Post subject: Reply with quote

I have already done this, thanks for your help. whats the best way to read this data from Unix and laod it in to Oracle, whats the best readable format to do this. My ultimate goal is to ftp these file son to UNIX and then write some procedures to load it in to a Oracle. Please share some ideas on this. I think there are some common utilities on the mainframe side to compress this and send it to UNix and then uncompress it over there......any help on this??????
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jun 01, 2005 11:12 am    Post subject: Reply with quote

emdaya9,

Why not use SQL*Loader (Oracle
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Wed Jun 01, 2005 11:46 am    Post subject: Reply with quote

Kolusu,
My Vsams are not in readable format. If we open the VSAM file through file aid we may not be able to read the data. Even coma separated cannot be done. Is there any way to convert these file sin to binary format(compressing) and uncompressing at the server side, some utilities on both server side and mainframe side.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jun 01, 2005 12:11 pm    Post subject: Reply with quote

Quote:

Kolusu,
My Vsams are not in readable format.

emdaya9,

What exactly do you mean by not a readable format? Are they dumps from ADRDSSU?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
emdaya9
Beginner


Joined: 31 May 2005
Posts: 7
Topics: 2

PostPosted: Wed Jun 01, 2005 1:49 pm    Post subject: Reply with quote

........c.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group