View previous topic :: View next topic
|
Author |
Message |
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Hi All,
I have an input file1 which has got the only date value in the below format.
Input File1 Data :
2009-04-01
I have one more file which has got a simple query like
Input File2 Data :
select * from
TABLE1
where date > &tempdate
Now, I want the &tempdate of file2 data to be replaced with date value contained in file2.
To be more clear the Required Output should be:
select * from
TABLE1
where date > 2009-04-01
Please let me know how can we resolve this.
Dubasi |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
What field do you want to replace with what?
can you be a bit clear? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
dubasir,
If your intention is to generate the query for a unload or something , you really don't have to do any thing. Simply concatenate both files together and you should be all set
Code: |
//STEP0100 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*,DCB=BLKSIZE=121
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(xxx)
RUN PROGRAM(DSNTIAUL) -
PLAN(DSNTIAUL) -
PARMS('SQL') -
LIB('xxxx.RUNLIB.LOAD')
//SYSREC00 DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//SYSIN DD DSN=Your 80 byte query file,DISP=SHR
// DD DSN=your 80 byte date file,DISP=SHR
//* |
That sysin would be translated as follows
Code: |
//SYSIN DD *
SELECT *
FROM table1
WHERE date >
// DD *
2009-04-01;
|
|
|
Back to top |
|
|
|