View previous topic :: View next topic
|
Author |
Message |
tushar_study
New User
Joined: 01 Feb 2007 Posts: 30 Location: Mumbai
|
|
|
|
I have a scenario wherein I need to write an INSERT to a table using a control card in JCL.The values to be inserted into the table columns may vary so i want to pass them through the job card.How do i do it.
Please help.
Thanks in advance |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You cannot directly issue SQL commands in JCL.
Values cannot be passed on the JOB statement. . .
I'd suggest you talk with someone in your project and see which utility/method is used for this kind of requirement on your system. |
|
Back to top |
|
|
tushar_study
New User
Joined: 01 Feb 2007 Posts: 30 Location: Mumbai
|
|
|
|
I am sorry that I goofed up my xplaination.I meant that the SQL will receive the value to inserted throug the PROC.The SQL will be written in the SYSIN DD *(Equivalent to a control card).Please help me with a short example.
Regards |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
search for SPUFI in batch. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Did you find some batch SPUFI example(s)?
Quote: |
The SQL will be written in the SYSIN DD *(Equivalent to a control card).Please help me with a short example. |
I suspect that your batch SPUFI execution will use a SYSIN DD DSN= rather than a DD * (if you have a PROCedure for your process.
Once you have your jcl and control statements, post them here if there are questions. |
|
Back to top |
|
|
tushar_study
New User
Joined: 01 Feb 2007 Posts: 30 Location: Mumbai
|
|
|
|
Hi ,
I tried a SELECT in my control card
Select * from MYTABLE
where SOME_DATE=&PARM1;
I was passing the PARM1 from my Job.It shows an error msg that PARM1
not used in PROC.Please suggest an alternative.
Regards |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
tushar_study wrote: |
Hi ,
I tried a SELECT in my control card
Select * from MYTABLE
where SOME_DATE=&PARM1;
I was passing the PARM1 from my Job.It shows an error msg that PARM1
not used in PROC.Please suggest an alternative.
Regards |
Control cards and other such cards are not JCL and there is no symbolic substitution for them. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Try this, but it's a bit involved:
1. set up a file with your SQL as a template, with place-holding names like YYYY-MM-DD
2. write a program (SAS, COBOL, etc.) to take a PARM populated in JCL with your symbolic and copy the template to another file (e.g., &&SQL), replacing YYYY-MM-DD with the parm
3. pass &&SQL to the SPUFI's SYSIN |
|
Back to top |
|
|
tushar_study
New User
Joined: 01 Feb 2007 Posts: 30 Location: Mumbai
|
|
|
|
Hi Folks,
Thats great .I will write a Cobol program |
|
Back to top |
|
|
lenin
New User
Joined: 12 Oct 2007 Posts: 11 Location: Chennai
|
|
|
|
HI tushar,
I could partly help for your requirement.
1. I agree we can not pass a parm value inside a JCL control card. We have search for some thing else.
2.But we can execute SQL as Control card though a JCL. The pgm is IKJEFT01
pls find the below piece of JCL.
//STEP01 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//LISTING DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD DUMMY
//SYSREC00 DD DSN=<Output PS>,DISP=SHR
//SYSTSIN DD *
DSN SYSTEM(DBBG)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIBSP) -
LIB('SYSD.DBBG.RUNLIB.LOAD')
END
/*
//SYSIN DD DSN=<Query stored in PS or PDS>,DISP=SHR
Thanks,
Lenin |
|
Back to top |
|
|
|