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

To find if a GDG has any generations, RC4


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

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Mon Apr 19, 2010 5:16 pm
Reply with quote

Hi expat,
I tried to run the JCL from How to find in JCL, whether a GDG has any generations? but each time i am facing the same retun code RC=4. Here my Input GDG base name is OPERA.TEST1.BKUP generations exist which are associated with this GDG base name :

Code:
 Command - Enter "/" to select action                  Message           Volume
 -------------------------------------------------------------------------------
          OPERA.TEST1.BKUP                                               ??????
          OPERA.TEST1.BKUP.G0001V00                                      TSO913
          OPERA.TEST1.BKUP.G0002V00                                      TSO904
 ***************************** End of Data Set list ****************************


and INCLUDE condition i gave as:
INCLUDE COND=(36,2,CH,EQ,C'.G',AND,42,3,CH,EQ,C'V00').

I am not getting why it is giving RC=04. Please tell me if i am making any mistake?

Thanks
Gagan
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 19, 2010 5:30 pm
Reply with quote

How did you work out that the include should start 1n position 36
Code:
Your GDG     OPERA.TEST1.BKUP.GnnnnV00
My GDG       XX.TEST.GDG01.GnnnnV00
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Mon Apr 19, 2010 6:04 pm
Reply with quote

Instead of using the temporary dataset, i used a PS file in which i collected the LISTCAT information. and this PS file i provided as the input.
From this PS file, i come to know about include condition.
Sorry, earlier i gave wrong file names as i had typed the file names, volume etc manually. sorry for inconvenience. Please find below the contents of the PS file:
Code:

 Command ===>                                                  Scroll ===> CSR 
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001 1IDCAMS  SYSTEM SERVICES                                           TIME:
 000002 0                                                                       
 000003   LISTCAT ENT('OPERA12.TEST1.BKUP') GDG ALL                             
 000004 0GDG BASE ------ OPERA12.TEST1.BKUP                                     
 000005       IN-CAT --- CATALOG.HBCPLX02.TSO                                   
 000006       HISTORY                                                           
 000007         DATASET-OWNER-----(NULL)     CREATION--------2010.078           
 000008         RELEASE----------------2     LAST ALTER------2010.078           
 000009       ATTRIBUTES                                                       
 000010         LIMIT----------------255     SCRATCH            EMPTY           
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 000011       ASSOCIATIONS                                                     
 000012         NONVSAM--OPERA12.TEST1.BKUP.G0001V00                           
 000013         NONVSAM--OPERA12.TEST1.BKUP.G0002V00                           
 000014 1IDCAMS  SYSTEM SERVICES                                           TIME:
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 19, 2010 6:24 pm
Reply with quote

And what is the RECFM of the file ?
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Mon Apr 19, 2010 6:49 pm
Reply with quote

RECFM is VBA and LRECL is 200.
Actually RECFM is changing after executing the IDCAMS step. Before submitting the JCL, I gave the PS file in IDCAMS step to collect LISTCAT information with LRECL=200 and RECFM=FB.
but after executing the JCL, THis PS file is found to be having the RECFM=VBA. I mean, it is changing after executing the JCL from FB to VBA.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Mon Apr 19, 2010 7:53 pm
Reply with quote

Gagan - In an IDCAMS step SYSPRINT DD is IDCAMS Messages file and is RECFM=VBA. If you check, LRECL should be 125. That's the leagcy of IDCAMS and you can't change it, whatever is happening is normal.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 19, 2010 7:57 pm
Reply with quote

Because the file is VB you need to add 4 to the positions specified to account for the RDW. So pos 36 becomes pos 40.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Mon Apr 19, 2010 8:20 pm
Reply with quote

I just went through the entire thread, it was quite lengthy to read... just thinking, in the JCL from expat, what if you check the RC from IDCAMS step, if it is RC=0004 don't execute SORT step else execute it - shouldn't this suffice for the original request. Though, I might miss something, as I said it was a lengthy-read.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 19, 2010 8:25 pm
Reply with quote

Unfortunately if the GDG base exists then the LISTCAT RC will be 0.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Mon Apr 19, 2010 8:37 pm
Reply with quote

oh Martin, looks like Beer you offered me is still showing its effect icon_smile.gif. However, if what if we use
Code:
LISTCAT LVL(some.gdg.base.without.generation) ALL
, RC=0004 could be handy for this thread?
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Tue Apr 20, 2010 8:59 am
Reply with quote

Hi Expat/Anuj,
Thanks a lot. It is working now. Solution provided by Anuj is aloso handling the RC=4 for GDGs having no generations associated with it.
Thanks all.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Apr 20, 2010 5:51 pm
Reply with quote

GaganGarg wrote:
Thanks a lot. It is working now.
You're welcome, but what did you change to make it working, can you please share?
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Tue Apr 20, 2010 5:57 pm
Reply with quote

Hi Anuj,
RECFM was VBA and i was not considering the 4 additional bytes for VBA format. I added 4 to the starting positions whatever i gave in include cond first i.e. I gave INCLUDE COND=(40,2,CH,EQ,C'.G',AND,46,3,CH,EQ,C'V00'). And i also used solution provided by you incase if there is no generation associated with GDG base. ( i.e. I used LISTCAT LVL(some.gdg.base.without.generation) ALL instead of LISTCAT ENT('OPERA12.TEST1.BKUP') GDG ALL ) icon_biggrin.gif
Thanks
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Tue Apr 20, 2010 6:16 pm
Reply with quote

or i thought it is better to use INCLUDE COND=(13,7,CH,EQ,C'NONVSAM') as it adds the flexibility to the JCL regardless of changing the INCLUDE COND everytime if GDG base name changes. I mean another GDG base name may by of different length. icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Apr 20, 2010 6:45 pm
Reply with quote

Good, thanks for the follow up.
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 Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Need to find a specific STRING COBOL Programming 11
No new posts How can I find the DDname of a file u... CICS 10
No new posts Find missing sequence for every key DFSORT/ICETOOL 3
Search our Forums:

Back to Top