Page 1 of 2

Attributes of name of PS file in a PS file

PostPosted: Mon Mar 05, 2018 10:01 pm
by szvemana79
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

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

PostPosted: Mon Mar 05, 2018 10:17 pm
by Robert Sample
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.

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

PostPosted: Tue Mar 06, 2018 12:41 pm
by expat
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

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

PostPosted: Tue Mar 06, 2018 12:51 pm
by willy jensen
Maybe the JCL LIKE parameter can do the trick?

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

PostPosted: Tue Mar 06, 2018 10:49 pm
by szvemana79
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

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

PostPosted: Wed Mar 07, 2018 2:41 am
by NicC
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.

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

PostPosted: Wed Mar 07, 2018 12:32 pm
by expat
It was line 4 of the JCL that caused the problem

Psychic day rules OK

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

PostPosted: Wed Mar 07, 2018 2:32 pm
by willy jensen
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.

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

PostPosted: Wed Mar 07, 2018 4:03 pm
by expat
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
           ))
/*
//
 

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

PostPosted: Wed Mar 07, 2018 4:14 pm
by expat
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.