Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Like parameter with GDG

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

Active User


Joined: 02 Jan 2009
Posts: 114
Location: Hyderabad

PostPosted: Wed Feb 18, 2009 10:52 am    Post subject: Like parameter with GDG
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

Site Director


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

PostPosted: Wed Feb 18, 2009 11:16 am    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Feb 18, 2009 12:47 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Feb 18, 2009 1:03 pm    Post subject:
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: 114
Location: Hyderabad

PostPosted: Wed Feb 18, 2009 1:20 pm    Post subject:
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

Site Director


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

PostPosted: Wed Feb 18, 2009 8:18 pm    Post subject:
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: 114
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 9:22 am    Post subject:
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

Site Director


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

PostPosted: Thu Feb 19, 2009 9:39 am    Post subject:
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: 114
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 9:50 am    Post subject:
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

Site Director


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

PostPosted: Thu Feb 19, 2009 10:23 am    Post subject:
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: 114
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 10:45 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us