IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem with replacing of data from input files.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dubasir

New User


Joined: 05 Jun 2006
Posts: 19

PostPosted: Wed Apr 01, 2009 5:57 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Apr 01, 2009 6:14 pm
Reply with quote

What field do you want to replace with what?
can you be a bit clear?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Apr 01, 2009 9:03 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top