Doubt in IDCAMS



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Doubt in IDCAMS

Postby Bala1 » Fri Jun 18, 2010 11:28 pm

Hi ,
I am trying to pass a parameter for the creation of GDG base through a JCL but the jobs are failing.
//PROCLIB JCLLIB ORDER=(TST.TST905.PROCLIB)                             
//   SET DEPT=KIDS                                                     
//*                                                                     
//*  THIS JOB WOULD COPY THE SRO BACKUP FILES FROM SP02 TO SP01         
//*                                                                     
//STEP0010 EXEC PGM=IDCAMS,REGION=17M                                   
//SYSPRINT DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  DEFINE GDG(NAME(TST.PROD.&DEPT..TEST.SAP.FTS.BKUP) LIMIT(30) SCRATCH)
//*                                                                     

Is it possible to pass a symolic parameter for the creation of GDG base????

IDC3203I ITEM 'TST.PROD.&DEPT..TEST' DOES NOT ADHERE TO RESTRICTIONS     
IDC3202I ABOVE TEXT BYPASSED UNTIL NEXT COMMAND. CONDITION CODE IS 12     
                                                                         


It would be of great help if anyone can suggest creation using GDG by passing parameter in SYSIN??
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in IDCAMS

 

Re: Doubt in IDCAMS

Postby Robert Sample » Fri Jun 18, 2010 11:30 pm

It is not possible to pass a parameter into SYSIN for IDCAMS or any other program as you are attempting. You could build a job stream (using SORT, a program, or other method) with the parameter as part of the job and submit this by copying to the internal reader. However, what you want to do with SYSIN just does not work that way.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Doubt in IDCAMS

Postby MrSpock » Fri Jun 18, 2010 11:38 pm

Bala, unfortunately, after all these years, there is still no standard utility program provided by IBM that can take a JCL variable such as the one you created, &DEPT, allow it to be passed through a PARM= statement (i.e. //STEPnn EXEC PGM=X,PARM='&DEPT'), and write out the resolved value. You'll always have to use your own in-house provided method.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Doubt in IDCAMS

Postby Bala1 » Tue Jun 22, 2010 11:45 pm

Hi Spock and Robert,

Thanks a lot for your information. I created a rexx code which would get this symbolic variable and passing the same to a template JCL and submit the job. :-)
_____________________
Cheers,
Bala
Bala1
 
Posts: 15
Joined: Tue Apr 06, 2010 7:07 pm
Location: London, United Kingdom
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in IDCAMS

Postby jmmehler » Fri Aug 19, 2011 7:05 pm

Did you know that you can call IDCAMS from a cobol program? In the JCL, add a //SYSIN DD SPACE=(80,(10,10),RLSE) statement (no DSN, DCB, DISP, etc).
Then;
1) Pass all the symbolics (ie &ENV.&APL.&CPYBK) to your program via the PARM statement. Be sure to include the Aperstand.
2) Have your program Open output the SYSSIN 80 byte record
3) Read your 'symbolsized' IDCAMS Parm records, parsing them for your symbolics and replace the symbolics with the resolved values.
4) write your resolved symbolic IDCAMS Parm records to the SYSIN
5) At end of file, close the SYSIN and 'CALL IDCAMS' (note, no using statement)

IDCAMS will then read the SYSIN and process your IDCAMS. I use my utility with Generic Delete/Define/Repros, Massive Renames, and Backups.
jmmehler
 
Posts: 2
Joined: Thu Apr 21, 2011 1:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in IDCAMS

Postby Frank Yaeger » Fri Aug 19, 2011 11:48 pm

unfortunately, after all these years, there is still no standard utility program provided by IBM that can take a JCL variable such as the one you created, &DEPT, allow it to be passed through a PARM= statement (i.e. //STEPnn EXEC PGM=X,PARM='&DEPT'), and write out the resolved value. You'll always have to use your own in-house provided method.


Actually, DFSORT does have a capability like that using JPn symbols. For complete details, see "SET and PROC Symbols in control statements" in my paper available at:

http://www.ibm.com/support/docview.wss? ... g3T7000242
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Doubt in IDCAMS

Postby Peter_Mann » Fri Aug 19, 2011 11:52 pm

jmmehler wrote:Did you know that you can call IDCAMS from a cobol program? In the JCL, add a //SYSIN DD SPACE=(80,(10,10),RLSE) statement (no DSN, DCB, DISP, etc).
Then;
1) Pass all the symbolics (ie &ENV.&APL.&CPYBK) to your program via the PARM statement. Be sure to include the Aperstand.
2) Have your program Open output the SYSSIN 80 byte record
3) Read your 'symbolsized' IDCAMS Parm records, parsing them for your symbolics and replace the symbolics with the resolved values.
4) write your resolved symbolic IDCAMS Parm records to the SYSIN
5) At end of file, close the SYSIN and 'CALL IDCAMS' (note, no using statement)

IDCAMS will then read the SYSIN and process your IDCAMS. I use my utility with Generic Delete/Define/Repros, Massive Renames, and Backups.

--------------------------------------------------------------
If you have SAS you can call IDCAMS also
allocate your SAS code VIA SASIN and pass your output to SYSIN
DATA DATASETS;                   
    INPUT NAMES $;               
    DATALINES;                   
 LISTC LVL(sysdsn) ALL           
RUN;                             
PROC IDCAMS DATA=DATASETS;       


RUN;                             
Peter
Peter_Mann
 
Posts: 139
Joined: Fri Jun 24, 2011 7:37 pm
Location: Lowell,AR
Has thanked: 14 times
Been thanked: 3 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post