Attributes of name of PS file in a PS file



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Attributes of name of PS file in a PS file

Postby szvemana79 » Mon Mar 05, 2018 10:01 pm

Hi all,

I have a requirement where the name of PS file A will be present in another PS file B. My requirement is to take the backup of PS FILE A into a GDG base by reading the data in PS FIle B. I am able to meet the above requirement.

THe issue /query is the attributes of PS file A changes on a daily basis. So, while creating the PROC, how do i get the DCB attributes of the PS FileA? if we can get the PS file A attributes dynamically then we can create a generalised PROC for the same

Thank you all in advance
szvemana79
 
Posts: 5
Joined: Tue Nov 14, 2017 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Attributes of name of PS file in a PS file

Postby Robert Sample » Mon Mar 05, 2018 10:17 pm

If the RECFM is variable, you don't have an issue -- just use a long record length for the LRECL (VB,27994,27998 for the DCB would work) since variable length records are okay as long as there are no records with record length larger than the LRECL.

If the RECFM is fixed but changes daily, you have two major issues -- first, there will be no way to have a PROC with the LRECL in it (although you could pass the DCB parameters as PROC parms), and second, a program retrieving generations will have to know -- FOR EACH GENERATION -- what the LRECL is and handle it separately.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Attributes of name of PS file in a PS file

Postby expat » Tue Mar 06, 2018 12:41 pm

Depends on the product that you use to create the backup
In some cases the RECFM / LRECL of the input dataset is irrelevant - DF/dss being one said product
ICEGENER can be used without specification of the RECFM / LRECL
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Attributes of name of PS file in a PS file

Postby willy jensen » Tue Mar 06, 2018 12:51 pm

Maybe the JCL LIKE parameter can do the trick?
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: Attributes of name of PS file in a PS file

Postby szvemana79 » Tue Mar 06, 2018 10:49 pm

Thankyou all for the quick reply and solutions. I tried with ICEGENER but that didnt work and LIKE parameter will take the attributes that of PS FILEB but not PS FILEA
szvemana79
 
Posts: 5
Joined: Tue Nov 14, 2017 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Attributes of name of PS file in a PS file

Postby NicC » Wed Mar 07, 2018 2:41 am

but that didnt work

is a meaningless phrase unless you specify how it did not work.

LIKE parameter will take the attributes that of PS FILEB but not PS FILEA

only if you specify the DDNAME of FiLEB - I presume you mean data set B.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Attributes of name of PS file in a PS file

Postby expat » Wed Mar 07, 2018 12:32 pm

It was line 4 of the JCL that caused the problem

Psychic day rules OK
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Attributes of name of PS file in a PS file

Postby willy jensen » Wed Mar 07, 2018 2:32 pm

If the name of dataset B could be in a member and be in the JCL SET format, like // SET DSB='name.of.b', then it could be done like in this sample:
//*                                                          
//  JCLLIB ORDER=WJ.REF.LIB                                  
//*                                                          
//P1       PROC DS=,REFM=                                    
//         INCLUDE MEMBER=&REFM                              
//G1       EXEC PGM=IEBGENER                                  
//SYSPRINT DD SYSOUT=*                                        
//SYSIN    DD DUMMY                                          
//SYSUT1   DD DISP=SHR,DSN=&DS                                
//SYSUT2   DD DISP=(,PASS),SPACE=(CYL,(1,40)),LIKE=&REFNAME  
//         PEND                                              
//*                                                          
//DSA      EXEC P1,DS=WJ.TEST.DS1,REFM=NAMEA                  
//DSB      EXEC P1,DS=WJ.TEST.DS2,REFM=NAMEB                  

WJ.REF.LIB(NAMEA)
// SET REFNAME='WJ.TEST.DS1'  

A preceeding IEBGENER could put the sequential dataset into a pds member, but the format must still be a JCL SET.
If this is still not satisfactory, then I think you need start looking at a programmable solution.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: Attributes of name of PS file in a PS file

Postby expat » Wed Mar 07, 2018 4:03 pm

Or maybe this would work too


//BACKUP   EXEC PGM=ADRDSSU
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//BACKUP   DD DSN=WOOO.HOOO(+1),
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=KSET
//SYSIN    DD   *
  DUMP     OUTDD(BACKUP)                                             -
           DATASET(INCLUDE(                                          -
//         DD DSN=WHATEVER,DISP=SHR
           ))
/*
//
 
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Attributes of name of PS file in a PS file

Postby expat » Wed Mar 07, 2018 4:14 pm

A quick change to the SYSUT2 definition

willy jensen wrote:If the name of dataset B could be in a member and be in the JCL SET format, like // SET DSB='name.of.b', then it could be done like in this sample:
//*                                                          
//  JCLLIB ORDER=WJ.REF.LIB                                  
//*                                                          
//P1       PROC DS=,REFM=                                    
//         INCLUDE MEMBER=&REFM                              
//G1       EXEC PGM=IEBGENER                                  
//SYSPRINT DD SYSOUT=*                                        
//SYSIN    DD DUMMY                                          
//SYSUT1   DD DISP=SHR,DSN=&DS                                
//SYSUT2   DD DISP=(,PASS),SPACE=(CYL,(1,40)),DCB=*.SYSUT1
//         PEND                                              
//*                                                          
//DSA      EXEC P1,DS=WJ.TEST.DS1,REFM=NAMEA                  
//DSB      EXEC P1,DS=WJ.TEST.DS2,REFM=NAMEB                  

WJ.REF.LIB(NAMEA)
// SET REFNAME='WJ.TEST.DS1'  

A preceeding IEBGENER could put the sequential dataset into a pds member, but the format must still be a JCL SET.
If this is still not satisfactory, then I think you need start looking at a programmable solution.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post