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

Like parameter with GDG


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

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Wed Feb 18, 2009 10:52 am
Reply with quote

Hi,
I am trying to use the following JCL and procedure to run a simple program which writes into two files. It is throwing me the following error
Code:

IEF825I INVALID CHARACTER IN THE LIKE     FIELD


Can't we use gdgs in like parameters? Incase if I wish to point to the latest version of the previous file, how do i do that. Kindly help.

------
JCL
------
Code:

//G70377J JOB ,,NOTIFY=&SYSUID,CLASS=B,MSGLEVEL=(1,1),MSGCLASS=X
//JCLLIB   JCLLIB ORDER=(G70377.KRANTHI.PROC)                   
//SETVAR   SET REGION=CICS1,QUAL1=OUT1,QUAL2=OUT2,ID=G70377     
//STEP1 EXEC PROC=PROC2                                         


-------
PROC
-------
Code:

//G70377K PROC LOAD1=OPERN.&REGION..LOADLIB,                     
//             GENOUT=(+1),                                     
//             GENOUT=(0)                                       
//STEP1 EXEC PGM=DEMO2                                           
//STEPLIB DD DSN=&LOAD1,DISP=SHR                                 
//INP    DD DSN=&ID..SORT.INPUT.FILE,DISP=SHR                   
//OUT1   DD DSN=&ID..&QUAL1..FILE&GENOUT,DISP=(NEW,CATLG,DELETE),
//           SPACE=(CYL,(1,2)),                                 
//           LRECL=80,RECFM=FB                                   
//OUT2   DD DSN=&ID..&QUAL2..FILE&GENOUT,DISP=(NEW,CATLG,DELETE),
//           LIKE=&ID..&QUAL1..FILE&GENIN                       
//                                                             



Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 18, 2009 11:16 am
Reply with quote

Hello,

Are these files sms managed? I believe this option only works with sms managed data.

Quote:
Keyword, optional -- use this parameter only with SMS

Without SMS, use the DCB=dsname form of the DCB parameter described in topic 12.16.2.


In the PROC the GENOUT= has been defined 2 times. GENIN is in the proc, but not referenced.

Suggest you review the process and build it up one bit at a time.

Also suggest you become familiar with the link to "IBM Manuals" at the top of the page.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Feb 18, 2009 12:47 pm
Reply with quote

Hi,

I think the problem is you cannot use LIKE using the ralative GDG, if you specify the fully qualified name you will overcome the syntax error.




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

Global Moderator


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

PostPosted: Wed Feb 18, 2009 1:03 pm
Reply with quote

Or maybe it is because there is no value for GENIN being set but &GENIN is used in your PROC.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Wed Feb 18, 2009 1:20 pm
Reply with quote

That was just a copy paste error. I took the wrong version of the JCL Please ignore GENOUT/GENIN problem. I still have the same error even after changing it to GENIN.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 18, 2009 8:18 pm
Reply with quote

Hello,

Quote:
Are these files sms managed?
Have you verified if they are sms managed or not?

Quote:
Suggest you review the process and build it up one bit at a time.
Have you started a "new" set of jcl and gradually "grown" it?

Suggest you also post the actual jcl not some heavily edited "show" version.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 9:22 am
Reply with quote

Hi Dick sherrer,

As suggested , I started from the begnining of the JCL i.e. step by step and i found that it is working fine if i use the latest version of the gdg manually.
But if i replace G0002V00 with (0). It is throwing me error. Is there any way to point to the latest version of the GDG?

Code:

                                 
//STEP1 EXEC PGM=DEMO2                                       
//STEPLIB DD DSN=OPERN.CICS1.LOADLIB,DISP=SHR                 
//INP    DD DSN=&ID..SORT.INPUT.FILE,DISP=SHR                 
//OUT1   DD DSN=&ID..&QUAL1..FILE(+1),DISP=(NEW,CATLG,DELETE),
//           SPACE=(CYL,(1,2)),                               
//           LRECL=80,RECFM=FB                               
//OUT2   DD DSN=&ID..&QUAL2..FILE(+1),DISP=(NEW,CATLG,DELETE),
//           LIKE=&ID..&QUAL1..FILE.G0002V00                 
//                                                           
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2009 9:39 am
Reply with quote

Hello,

Quote:
Is there any way to point to the latest version of the GDG?
I suspect the +1 is not "the latest" while in the creating step . . . It has not been "finalized" and does not yet "exist" - it is still being created.

From the JCL manual (i added the bolding):
Quote:
Use the LIKE parameter to specify the allocation attributes of a new data set by copying the attributes of a model data set, which must be an existing cataloged data set and reside on a direct access volume.


You might try with (0) instead of +1 . . .
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 9:50 am
Reply with quote

Well, I tried using (0) only.

I tried using (+1) for creating a new generation dataset and for referring to the latest version of previous file, i used (0) in LIKE parameter. I dont see any problem with this. Correct me if i am wrong.

Also, we are using JES3. That means all the datasets are allocated before the job is scheduled. So a new version of the dataset OUT1 must be created already before the job is scheduled.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2009 10:23 am
Reply with quote

Hello,

Quote:
So a new version of the dataset OUT1 must be created already before the job is scheduled.
Allocating a dataset is not the same as "an existing cataloged data set ". Merely being allocated is not completely created.

It sounds like you are able to move forward with the testing icon_smile.gif
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 10:45 am
Reply with quote

Yes, I used sequential files instead of GDGs. icon_smile.gif
Back to top
View user's profile Send private message
vvrahul

New User


Joined: 18 Oct 2005
Posts: 3
Location: Mumbai, India

PostPosted: Thu Feb 19, 2009 3:26 pm
Reply with quote

Hi,

I would like to add to Dick. When new GDG version are being allocated, the catalog happens only when the job finishes.

//STEP01 EXEC PGM=IEFBR14
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=&ID.FILE.GDG(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,5),RLSE),
// UNIT=SYSDA
//DD02 DD DSN=&ID.FILE.GDG(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,5),RLSE),
// UNIT=SYSDA

Would allocate and catalog only one verion of the GDG.

If we do need two version one should use:

//STEP01 EXEC PGM=IEFBR14
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=&ID.FILE.GDG(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,5),RLSE),
// UNIT=SYSDA
//DD02 DD DSN=&ID.FILE.GDG(+2),
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,5),RLSE),
// UNIT=SYSDA

Similarly I used the Like function and it worked fine for me:

//STEP01 EXEC PGM=IEFBR14
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=&ID.FILE.GDG(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(1,5),RLSE),
// UNIT=SYSDA
//DD02 DD DSN=&ID.FILE.GDG(+2),
// DISP=(NEW,CATLG,DELETE),
// LIKE=&ID.FILE.GDG.G0001V00


Thanks,

Rahul.
Back to top
View user's profile Send private message
Peter Poole

New User


Joined: 07 Jan 2009
Posts: 50
Location: Scotland

PostPosted: Thu Feb 19, 2009 5:33 pm
Reply with quote

Correct. (+n) relative GDGs are used to work out what the explicit G**V* suffix will be, based on a look at the catalog when the job starts. (Though in the example above the OP is creating +1 of two different datasets)

If you can't get like to work with relative GDG and don't want the hassle of working out what the explicit DSN is, you could always dodge the bullet by setting up a spurious non-GDG file as ID..&QUAL1..MODEL and using that in the LIKE statement. icon_wink.gif

Cheers.
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Fri Feb 20, 2009 8:40 pm
Reply with quote

Quote:
When new GDG version are being allocated, the catalog happens only when the job finishes.


I guess this happens after the step in which the GDG is created. But accessing the new GDG created in the same job depends on sys parms... some places u can access only after the job has completed...others it could after the STEP has completed.....
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 Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top