IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy content from a file and allocate same attributes


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 20, 2013 10:22 pm
Reply with quote

Hi All,

Am trying to copy a PS file into another PS file. While copying want the new file to be created with exactly the same attributes of the from dataset - RECFM, RECLEN, BLKSIZE, SPACE - Unit, Primary Quantity, Secondary Quantity and the EXPDT. Is this possible ?

I tried different JCLs - using SORT, IEBGENER, .... - with LIKE, REFDD parameters. But as the manual says - the SPACE and EXPDT are not considered.

The result am currently achieving - the content is getting copied to the new file with same RECFM and RECLEN. But the BLKSIZE, SPACE and EXPDT looks to be different.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Feb 20, 2013 10:29 pm
Reply with quote

Quote:
But the BLKSIZE, SPACE and EXPDT looks to be different.


What the hell is that, are they different or not?!?
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 20, 2013 10:36 pm
Reply with quote

PeterHolland wrote:
Quote:
But the BLKSIZE, SPACE and EXPDT looks to be different.


What the hell is that, are they different or not?!?
Yes, Peter.. They are different...

To explain a little better
From dataset attributes...
Code:
General Data                                 Current Allocation                 
    Management class . . :    **None**              Allocated tracks  . :    175       
    Storage class  . . . :    **None**              Allocated extents . :    1         
     Volume serial . . . :    TSTS01                                                      
     Device type . . . . :    3390                                                    
    Data class . . . . . :    **None**                                                
     Organization  . . . :    PS                   Current Utilization                 
     Record format . . . :    VB                    Used tracks . . . . :    10       
     Record length . . . :    6104                  Used extents  . . . :    1         
     Block size  . . . . :    6108                                                     
     1st extent tracks . :    175                                                  
     Secondary tracks  . :    0                 Dates                               
     Data set name type  :                          Creation date . . . :    1993/07/08
     SMS Compressible. . :    NO                    Referenced date . . :    2013/02/20
                                                    Expiration date . . :    ***Perm***


To dataset attributes after copy...
Code:
General Data                                 Current Allocation                 
    Management class . . :    TES                   Allocated kilobytes :    929       
    Storage class  . . . :    TES                   Allocated extents . :    1         
     Volume serial . . . :    OLT001                                                      
     Device type . . . . :    3390                                                    
    Data class . . . . . :    TES                                                     
     Organization  . . . :    PS                   Current Utilization                 
     Record format . . . :    VB                    Used kilobytes  . . :    902       
     Record length . . . :    6104                  Used extents  . . . :    1         
     Block size  . . . . :    27998                                                    
     1st extent kilobytes:    929                                                  
     Secondary kilobytes :    500               Dates                               
     Data set name type  :                          Creation date . . . :    2013/02/20
     SMS Compressible. . :    NO                    Referenced date . . :    2013/02/20
                                                    Expiration date . . :    ***None***
As can be seen, the Block Size, 1st extent, Secondary extent, Expiry date are all different but I would like to have it same as the old dataset after the copy.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Feb 20, 2013 10:52 pm
Reply with quote

Probably you left it to the OS to determine BLKSIZE, space etc.
But what is your problem? The dataset is copied, what do you want more?
Ask your SMS people or whatever.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 20, 2013 11:11 pm
Reply with quote

PeterHolland wrote:
Probably you left it to the OS to determine BLKSIZE, space etc.
Yes Peter... I have at this point of time...
I am trying to figure out how I can tell the OS that 'while copying please take the BLKSIZE and SPACE and EXPDT' also into consideration'... At this point I am not able to find an option for that. As a result I was asking in my initial post - Is this possible ?

PeterHolland wrote:
But what is your problem? The dataset is copied, what do you want more?
icon_neutral.gif .. I am not sure what I am missing here.. but are you suggesting that the other attributes are not important ?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Wed Feb 20, 2013 11:20 pm
Reply with quote

Binop B wrote:
Am trying to copy a PS file into another PS file. While copying want the new file to be created with exactly the same attributes of the from dataset - RECFM, RECLEN, BLKSIZE, SPACE - Unit, Primary Quantity, Secondary Quantity and the EXPDT. Is this possible ?

I tried different JCLs - using SORT, IEBGENER, .... - with LIKE, REFDD parameters. But as the manual says - the SPACE and EXPDT are not considered.

The result am currently achieving - the content is getting copied to the new file with same RECFM and RECLEN. But the BLKSIZE, SPACE and EXPDT looks to be different.

Consider having the JCL tailored from a Rexx script using ISPF services.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Wed Feb 20, 2013 11:30 pm
Reply with quote

Since this is a JCL topic, can you show us your JCL output DD?

Does your output DD (i.e. IEBGENER) look something like this?
Code:
//SYSUT2   DD DSN=xxx, 
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,               <-guessing for your shop
//            VOL=SER=TES,              <-guessing for your shop
//            LABEL=EXPDT=99000,        <-not sure for "PERM".  "PERM" sounds like a Prod setup, not Test.
//            SPACE=(TRK,(175,10),RLSE),
//            DCB=(RECFM=VB,LRECL=6104,BLKSIZE=6108) <-looks like you used BLKSIZE=0 ?

I see both datasets are on 3390's but the VolSer is different so results will never be exact.
Again, see your SMS/DASD space person.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 20, 2013 11:45 pm
Reply with quote

Akatsukami wrote:
Consider having the JCL tailored from a Rexx script using ISPF services.
icon_redface.gif .. Apologize ... I have never tried REXX in my short career so far...
Were you suggesting something like using REXX to get the attributes of the source dataset and create a dynamic copy JCL based on the source dataset attributes. Did I get that right ?
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 20, 2013 11:48 pm
Reply with quote

Gary McDowell wrote:
Since this is a JCL topic, can you show us your JCL output DD?

Does your output DD (i.e. IEBGENER) look something like this?
Code:
//SYSUT2   DD DSN=xxx, 
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,               <-guessing for your shop
//            VOL=SER=TES,              <-guessing for your shop
//            LABEL=EXPDT=99000,        <-not sure for "PERM".  "PERM" sounds like a Prod setup, not Test.
//            SPACE=(TRK,(175,10),RLSE),
//            DCB=(RECFM=VB,LRECL=6104,BLKSIZE=6108) <-looks like you used BLKSIZE=0 ?

I see both datasets are on 3390's but the VolSer is different so results will never be exact.
Again, see your SMS/DASD space person.
icon_redface.gif ... I should have posted the JCL before... Apologize again...
Below are some of the basic options I have tried out ....
Code:
//STEP095  EXEC PGM=SORT                       
//SORTIN   DD  DSN=source dataset,DISP=SHR
//SORTOUT  DD  DSN=target dataset,
//  DISP=(NEW,CATLG),UNIT=SYSDA                 
//SYSOUT   DD  SYSOUT=*                         
//SYSIN    DD  *                               
  OPTION COPY                                   
//*                                             
Code:
//STEP095  EXEC PGM=IEBGENER                             
//SYSUT1   DD  DSN=source dataset,DISP=SHR         
//SYSUT2   DD  DSN=target dataset,         
//  DISP=(NEW,CATLG),UNIT=SYSDA,LIKE=source dataset
Code:
//STEP095  EXEC PGM=IEBGENER                   
//SYSUT1   DD  DSN=source dataset,DISP=SHR
//SYSUT2   DD  DSN=target dataset,
//  DISP=(NEW,CATLG),UNIT=SYSDA,REFDD=*.SYSUT1 

I have not tried to copy the VOLSER attribute as the source is in UAT region and the target file is intended for System Test region...


Quote:
not sure for "PERM". "PERM" sounds like a Prod setup, not Test.
Agree with the idea... but for my case here would like to have the (System) test file as PERM as of now.



Quote:
Ask your SMS people or whatever.
Quote:
Again, see your SMS/DASD space person.
Sure... Will do that... Initially I thought there might be some simple JCL to perform this function... Will check..
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Feb 21, 2013 12:03 am
Reply with quote

Binop B wrote:
Akatsukami wrote:
Consider having the JCL tailored from a Rexx script using ISPF services.
icon_redface.gif .. Apologize ... I have never tried REXX in my short career so far...

Don't worry; happens to the best of us icon_wink.gif I think that I had nine years' experience in this field before I saw Rexx.
Quote:
Were you suggesting something like using REXX to get the attributes of the source dataset and create a dynamic copy JCL based on the source dataset attributes. Did I get that right ?
Essentially, although until you already have jobs set up in a library, I'd suggest going with the ISPF file-tailoring services.

Two things: without meaning disrespect to Mr. McDowell, I believe that EXPDT=99000 only has meaning to certain tape management systems. If you wish to create a permanent data set on DASD, you might be better served to use EXPDT=99366. Also, I think that you will need to take the SMS data storage and data classes into account. Mynheer Holland's advice to speak to your SMS workgroup is sound; what you seek to do may not be possible on your machine (e.g., I cannot create a non-volatile data set with my TSO ID as HLQ in my shop).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 21, 2013 12:16 am
Reply with quote

Quote:
Initially I thought there might be some simple JCL to perform this function
Unfortunately, you've wandered into an area where the site-specific parameters will impact what can -- and cannot -- be accomplished. Block size does not tend to be a signficant value these days, especially for a variable blocked file, so 6108 versus 27998 is not something to worry about. The PERM expiry date, however, may be restricted by site policy to the storage management group, in which case NOTHING you do will allow you to copy a data set with PERM expiry date and preserve that setting.

Unless and until you talk to your site support people, there is no way that you will be able to find out for sure which parameters can be duplicated. Certainly no "simple JCL" will do what you want.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Feb 21, 2013 3:05 am
Reply with quote

Akatsukami wrote:
Essentially, although until you already have jobs set up in a library, I'd suggest going with the ISPF file-tailoring services.
New concept for me again... I tried to get some information from the below links but at this point its a bit greek and latin for me ... icon_razz.gif
Defining file-tailoring skeletons
Using the file-tailoring services
Will need to spent a little more time to get this into my head... icon_cool.gif

Checked with my site support people - but there aint anything as of now to help the cause. At this point we have decided to go with the default values of Block Size and mark the datasets as permanent as of now. Thanks a lot everybody for your help .. icon_smile.gif

Robert Sample wrote:
Block size does not tend to be a significant value these days, ...
Agreed... Its just that when I was having the knowledge transfer for the application I am working on now - he had mentioned that there are some files which is being referenced by some very old program which is expecting it to be in the same Block Size and if altered it would create some issues... My bad... that I didn't note down the program or the file name at that point of time and that is the reason I was trying to make sure of having the same attributes to play safe...

Thanks again everybody ... icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 5:40 am
Reply with quote

You could look at AMBLIST to attempt to identify "old" programs, and then look at them. Perhaps your source-management system might also help. You could try a source scan for the specification of blocksizes.

If they are Cobol, and there are "too many", investigate COBANAL from the "CBT tape". I think it lists blocksizes where specified in the program.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Feb 21, 2013 2:50 pm
Reply with quote

What Gary has suggested might take you most close to what you're looking for and with a "simple JCL". OTOH, if you're doing this in 'TEST LPAR' chances of getting PERM in test are very less, possibly they just don't allow this in test. The better choice is, get in touch with your site-support group*, as other have mentioned about it.

*: And I'd like to hear back what they say!
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Feb 21, 2013 9:13 pm
Reply with quote

Bill Woodger wrote:
You could look at AMBLIST to attempt to identify "old" programs, and then look at them.
Thanks Bill... some time late yday evening I did some search in our JCL library and did find the program based on the comments... icon_razz.gif
Had a quick check into the program and while the file definition has
Code:
BLOCK CONTAINS 0 RECORDS
, there are other statements in the PROCEDURE DIVISION which has some block size calculation. At this point I would I need to analyze this further to understand what exactly this program is doing...
At some point of time I think I might have to apply what I have learnt from here to remove the block size dependency.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Feb 21, 2013 9:14 pm
Reply with quote

Anuj Dhawan wrote:
if you're doing this in 'TEST LPAR' chances of getting PERM in test are very less, possibly they just don't allow this in test. The better choice is, get in touch with your site-support group*, as other have mentioned about it.
*: And I'd like to hear back what they say!
Here having a permanent file in test is not advised but have got the blessings to create a permanent files as of now. As mentioned before, going ahead with creating files with the block sizes allocated default by OS and with EXPDT=99366.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Feb 22, 2013 5:41 am
Reply with quote

BLOCK CONTAINS 0 and then some blocksize calculation? That sounds odd, and horrible, potentially.

I'd try running the program in test with a big blocksize and see what happens. If it "seems" to work, make sure it is excessively well tested.

If it doesn't work, you need to find out why "something" needs a specific blocksize, and what it is which requires it to be done in such a terrible way.

You know what to do if you have questions on it :-)
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Feb 22, 2013 9:18 pm
Reply with quote

Bill Woodger wrote:
You know what to do if you have questions on it icon_smile.gif
Yes... I sure do Bill... Thanks again for the guidance.. icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Use Copy Utility DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top