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

Dynamically allocating file with retention period.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amrita.chatterjee

New User


Joined: 27 Apr 2006
Posts: 48
Location: Bangalore, India

PostPosted: Wed Dec 30, 2009 11:44 am
Reply with quote

Hi -

I want to allocate one file using 'PUTENV' utility in cobol program but the requirement is to allocate the file with a retention period of 3 months. I have used the command as mentioned below.
01 WS-DYN-FILE.
05 FILLER PIC X(37) VALUE
'CPOUT=DSN(F6744DEV.ECAP.DYNAMIC.FILE)'.
05 FILLER PIC X(24) VALUE ' NEW TRACKS SPACE(90,90)'.
05 FILLER PIC X(13) VALUE ' UNIT(SYSDA) '.
05 FILLER PIC X(11) VALUE ' RETPD(90) '.
05 FILLER PIC X(07) VALUE 'CATALOG'.
but the program is getting compiled successfully but while running S0C4 is coming. The error message is "An invalid keyword RETPD was found in environment variable CPOUT while processing file DYN-FILE in program DYNPRG"
Could anybody please help me how could I allocate a file dynamically with a retention period?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Dec 30, 2009 1:13 pm
Reply with quote

You need to talk with your storage management people about the policies with regard to the retention and life cycle management of data. If your storage environment is correctly set up, then whatever you specify as a retention period or SMS class will be overridden by the policy values rather than the value specified by the whim of a programmer.

And anyway, why not use the JCL to attempt this rather than hiding it in a program.

So which is easiest to change, JCL or a COBOL program ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 30, 2009 1:29 pm
Reply with quote

oh, but it is soooooo coool to hide things in a program,
especially by someone with so little experience he can not solve his own problems.
Back to top
View user's profile Send private message
amrita.chatterjee

New User


Joined: 27 Apr 2006
Posts: 48
Location: Bangalore, India

PostPosted: Wed Dec 30, 2009 2:01 pm
Reply with quote

I don't want to hide anything in cobol. I am allocating the file dynamically as the current timestamp is one of the parameter in the file file. hence I can't allocate the file in the jcl.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Dec 30, 2009 3:37 pm
Reply with quote

Why oh why this need for a timestamp. Have you not considered the use of the good ol' GDG as an alternative.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Dec 30, 2009 4:44 pm
Reply with quote

What part of "invalid keyword RETPD" do you not understand? You cannot specify RETPD in your dynamic allocation, period.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Dec 30, 2009 5:00 pm
Reply with quote

icon_idea.gif, 'am away from Mainframes and ill...just a guess, Try using EXPDT instead of RETPD...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Dec 30, 2009 5:02 pm
Reply with quote

Oh Robert, then I believe EXPDT should not work also...icon_sad.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 30, 2009 5:24 pm
Reply with quote

Quote:
current timestamp is one of the parameter in the file file


I though the board language was english, not jibberish.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jan 07, 2010 4:01 pm
Reply with quote

@ amrita.chatterjee

>> I am allocating the file dynamically as the current timestamp is one of >> the parameter in the file


I think you mean: current TS is one part of the file-name.

You also could achive this by using variables of your sheduling system.
More easier than hiding it in a programm.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top