Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting the Latest GDG generation name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Nov 12, 2010 8:58 pm    Post subject: Getting the Latest GDG generation name
Reply with quote

Hi,

I have a following control file structure which will be generated at the same JCL step in which the main data file gdg generation will be generated.

The record structure of the control file is given below. But I am not sure how to get the master file's latest gdg full name that was created and populate in my control file record element and write it. Same with the 'Data Effective Date' --- how to get the date of the (-1) and populate in my COBOL (ENTCOBOL) program. 'File Creation Date' I will populate from the 'Current Date' function but Need HELP on the others.

'Record Element' | 'Logic' | 'Attribute' |

'Master filename' | 'PPM.MASTERFILE.<GDG>' | 'Text'


'Data Effective Date' | 'Back-up file Creation Date - 1 day' | 'Datetime'

'File Creation Date' | 'The date the master GDG file set was created' | 'Datetime'
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Fri Nov 12, 2010 9:14 pm    Post subject: Re: Getting the Latest GDG generation name
Reply with quote

ksouren007 wrote:
But I am not sure how to get the master file's latest gdg full name that was created and populate in my control file record element and write it. Same with the 'Data Effective Date' --- how to get the date of the (-1) and populate in my COBOL (ENTCOBOL) program.


What did you try? Did running an IDCAMS LISTCAT command not give you enough details to use? There are too many other topics that show how to resolve a GDG relative name into the actual dataset name, in COBOL, REXX, SAS, and I'm sure probably CLIST and Assember as well.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Nov 16, 2010 9:23 pm    Post subject: Reply to: Getting the Latest GDG generation name
Reply with quote

Thanks for the advice Superk...but I am not that much familiar with the IDCAMS LISTCAT functionalities...and not being able to figure out on how to update my control file record's first column and last cols with the full gdg name and date where my middle fields in the file will be already populated from the program.

Could you please advice on how to do it with LISTCAT.

Because I dont only want to get a listcat history report, what i want is to update my existing control record with the above information. Is it possible please advice.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Nov 17, 2010 12:34 am    Post subject: Re: Reply to: Getting the Latest GDG generation name
Reply with quote

ksouren007 wrote:
Could you please advice on how to do it with LISTCAT.

Because I dont only want to get a listcat history report, what i want is to update my existing control record with the above information. Is it possible please advice.

Master of the Universe, of course it is possible! Software development isn't theurgic Qabalah.

Try something like the following:
Code:
dsinfo.0 = 0                                         
x = outtrap('dsinfo.')                               
"LISTCAT LEVEL('" || dsn  || "')"                   
x = outtrap('OFF')                                   
                                                     
do i = 1 to dsinfo.0                                 
  parse var dsinfo.i type . dsname .                 
                                                     
  if (type="NONVSAM") then do
  /* whatever your heart desires */
  end
end
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Thu Nov 18, 2010 11:24 pm    Post subject:
Reply with quote

Hi,

Thanks for the suggestion. But if you elaborate the code a bit it would be helpful for me...as i am not so much conversant in REXX...

I have the first file as below: FB/115 with first 44 bytes empty.

Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001                               |+000005500000|+000000016527.50|0000000000
 000002                               |+000003575000|+000000007859.92|0000000000
 ****** **************************** Bottom of Data ****************************



And the second file which i got using listcat : FB/44

Code:
=COLS> ----+----1----+----2----+----3----+----4----
 ****** ***************************** Top of Data ***
 000001 TTA.TAI23.VRS.CESSDATA.G0028V00               
 000002 TTA.TAI23.VRS.POLMSTR.G0016V00               
  ****** **************************** Bottom of Data *



And the op file will be a concatenated one like below: FB/115..LRECLs are now now a bit jeoperdised now but i will adjust them later...


Code:
  =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001 TTA.TAI23.VRS.CESSDATA.G0028V00  |+000005500000|+000000016527.50|0000000000
 000002  TA.TAI23.VRS.POLMSTR.G0016V00       |+000003575000|+000000007859.92|0000000000
 ****** **************************** Bottom of Data ****************************


I could not get all the required data for my control file from the program (the gdg version names) that y kept the first field empty. Then by idcams listcat i got their names in a different file which now I want to populate in the empty fields of my control file...no other manipulation or combination just simple concatenation.

as you mentioned it can be done in a single step by REXX...a more elaboration on where to implement the snippet would help me out...
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Nov 19, 2010 12:24 am    Post subject:
Reply with quote

icon_rolleyes.gif You realize that the data that you show does not appear to correspond to the description given in your original post...or, in fact, in the very post that shows it?

No matter; these days no one bothers with real requirements, or design, or anything but diving in without checking the depth of the water. Here is some code; it contains about as many assumptions as needed with the little information you gave:
Code:
/* Rexx */                                   
  trace i                                     
  "ALLOC DA(FOO) FI(FILE1) SHR REUS"         
  "ALLOC DA(BAR) FI(FILE2) SHR REUS"         
  "ALLOC DA(PDQ) FI(FILE3) OLD"               
                                             
  "EXECIO * DISKR FILE1 (STEM DSN. FINIS"     
  i = 1                                       
  "EXECIO 1 DISKR FILE2"                     
                                             
  do while (rc=0)                             
    pull record                               
    record = dsn.i || substr(record,32,71)   
    push record                               
    "EXECIO 1 DISKW FILE3"                   
    i = i + 1                                 
    "EXECIO 1 DISKR FILE2"                   
  end                                         
                                             
  "EXECIO 0 DISKR FILE2 (FINIS"               
  "EXECIO 0 DISKW FILE3 (FINIS"               
                                             
  "FREE FI(FILE1)"                           
  "FREE FI(FILE2)"                           
  "FREE FI(FILE3)"                           
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts alphanumeric sequence generation sivaprasad.gadhi COBOL Programming 6 Wed Mar 30, 2016 3:03 am
No new posts alphanumeric sequence generation sivaprasad.gadhi DFSORT/ICETOOL 8 Mon Mar 21, 2016 1:09 am
No new posts SORT input file based on latest record maxsubrat DFSORT/ICETOOL 16 Wed Dec 02, 2015 8:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us