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 

Dynamic Move of Elements within PDS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Fri Aug 22, 2008 12:24 pm    Post subject: Dynamic Move of Elements within PDS Reply with quote

Hi,

I have a flat file with Element name and Type. I need to move the Element from a PDS to another PDS according to the element type dynamically during the execution of a JOB.

For Eg.

Contents of my File

Member1 COB
Member2 REST
Member3 JCL

So mem1 shud be copied from PDS.COBOL.MAIN to PDS.COBOL.NEXT
So mem2 shud be copied from PDS.RESTART.MAIN to PDS.RESTART.NEXT
So mem3 shud be copied from PDS.JCL.MAIN to PDS.JCL.NEXT

My logic is to create Dynamic PARMS and using those PARMS and AFOLIBR utility I can copy members.

Is there any better way to do it? Pls give an Idea.

Cheers
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Aug 22, 2008 1:20 pm    Post subject: Re: Dynamic Move of Elements within PDS Reply with quote

arvibala wrote:
My logic is to create Dynamic PARMS and using those PARMS and AFOLIBR utility I can copy members.


For the benefit of those reading this topic, AFOLIBR is the CA-Librarian utility.

Your logic makes sense to me.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 22, 2008 1:27 pm    Post subject: Reply with quote

arvibala,

How does the control cards fror AFOLIBR look like ? we can use DFSORT to create the control cards based on the type
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Fri Aug 22, 2008 2:38 pm    Post subject: Reply with quote

Hi Kolusu,

Code:

//STEP1   EXEC PGM=AFOLIBR,PARM='NJTA,NRJS'
//*
//MASTER   DD  DSN=PDS.COBOL.MAIN, 
//             DISP=SHR                   
//OSJOB    DD  DSN=PDS.COBOL.NEXT, 
//             DISP=SHR                   
//SYSIN DD DSN=PDS.TPROD.PARMLIB(PARM1),
//         DISP=SHR                           


PDS.TPROD.PARMLIB(PARM1) - Contents
Code:

 -SEL MEM1,EXEC
 -END             


I will be creating PDS.TPROD.PARMLIB(PARM1) dynamically using a cobol program as we have 16 different type of members to be moved.

Can you share me your DFSORT idea?

Cheers,
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 22, 2008 5:08 pm    Post subject: Reply with quote

arvibala,

The following JCL will give you the desired results. It will create 3 files based on the type.

Code:

//STEP0100 EXEC PGM=ICEMAN           
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                       
MEMBER1 COB                           
MEMBER2 REST                         
MEMBER3 JCL                           
MEMBER4 COB                           
MEMBER5 REST                         
MEMBER6 JCL                           
//COB      DD DSN=&&COB,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//JCL      DD DSN=&&JCL,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//REST     DD DSN=&&REST,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//SYSIN    DD *                       
  SORT FIELDS=COPY                   
                                     
  OUTFIL FNAMES=COB,REMOVECC,         
  INCLUDE=(9,3,CH,EQ,C'COB'),         
  BUILD=(2:C'-SEL ',1,8,80:X),       
  TRAILER1=(2:'-END')                 
                                     
  OUTFIL FNAMES=JCL,REMOVECC,         
  INCLUDE=(9,3,CH,EQ,C'JCL'),         
  BUILD=(2:C'-SEL ',1,8,80:X),       
  TRAILER1=(2:'-END')                 
                                     
  OUTFIL FNAMES=REST,REMOVECC,       
  INCLUDE=(9,4,CH,EQ,C'REST'),       
  BUILD=(2:C'-SEL ',1,8,80:X),       
  TRAILER1=(2:'-END')                 
/*

The output from this job looks like this
File COB:
Code:

 -SEL MEMBER1
 -SEL MEMBER4
 -END         


File JCL:
Code:

 -SEL MEMBER3
 -SEL MEMBER6
 -END         


File REST:
Code:

 -SEL MEMBER2
 -SEL MEMBER5
 -END         


You can use the above created control cards as SYSIN for the pgm AFOLIBR

Code:

/STEP0200  EXEC PGM=AFOLIBR,PARM='NJTA,NRJS'
//*
//MASTER   DD  DSN=PDS.COBOL.MAIN,
//             DISP=SHR                   
//OSJOB    DD  DSN=PDS.COBOL.NEXT,
//             DISP=SHR             
//SYSIN    DD  DSN=&&COB,
//             DISP=SHR   


Hope this helps....

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


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Mon Aug 25, 2008 8:13 am    Post subject: Reply with quote

Thanks Kolusu ... I got to learn more on SORT ...
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Mon Aug 25, 2008 10:32 am    Post subject: Reply with quote

Hi all,

There seems to be a problem here. MASTER file needs to be a VB or V format. Can anyone help me here to use AFOLIBR for FB format?

Cheers,
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Mon Aug 25, 2008 11:45 am    Post subject: Reply with quote

As far as I know CA Librarian doesn't use a PDS it has it's own format that it uses.
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 -> Job Control Language(JCL) 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