Page 1 of 1

Doubt in IDCAMS

PostPosted: Fri Jun 18, 2010 11:28 pm
by Bala1
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??

Re: Doubt in IDCAMS

PostPosted: Fri Jun 18, 2010 11:30 pm
by Robert Sample
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.

Re: Doubt in IDCAMS

PostPosted: Fri Jun 18, 2010 11:38 pm
by MrSpock
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.

Re: Doubt in IDCAMS

PostPosted: Tue Jun 22, 2010 11:45 pm
by Bala1
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. :-)

Re: Doubt in IDCAMS

PostPosted: Fri Aug 19, 2011 7:05 pm
by jmmehler
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.

Re: Doubt in IDCAMS

PostPosted: Fri Aug 19, 2011 11:48 pm
by Frank Yaeger
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

Re: Doubt in IDCAMS

PostPosted: Fri Aug 19, 2011 11:52 pm
by Peter_Mann
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;