View previous topic :: View next topic |
Author |
Message |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Tue Mar 01, 2011 3:33 pm Post subject: |
|
|
Suggest you show some realistic sample input data and the output you want when this is processed. _________________ All the best,
di |
|
Back to top |
|
 |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Tue Mar 01, 2011 10:44 pm Post subject: |
|
|
Papadi,
Here is the sample input data....
123AAA
345BBB
567CCC
789EEE
now i have to check my input file if 'DDD' is present.( where AAA,BBB,CCC,DDD are the keys)
If its not present , I need to insert it....
now my output looks like
123AAA
345BBB
567CCC
123DDD
789EEE
The below code works only when a matching record is present
//SYSIN DD *
OPTION COPY
OUTFIL IFTHEN=(WHEN=(3,3,CH,EQ,C'DDD'),
BUILD=(1,6,/,1:1,3,4:C'DDD'))
//*
instead of giving EQ if i specify WHEN=NONE ...it will insert multiple records
But my requirement is to insert if its not present.
We have ICETOOL in our shop........ |
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Tue Mar 01, 2011 11:34 pm Post subject: |
|
|
Is the input going to contain only 4 or 5 records (as shown)? I suspect that this is not a very representative set of sample data. . .
When the DDD record is inserted, how was the 123 chosen - why not 321 or whatever?
It may help if you explain the file content and what is to be accomplished by inserting the DDD record. _________________ All the best,
di |
|
Back to top |
|
 |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Wed Mar 02, 2011 2:09 am Post subject: |
|
|
Papadi,
INput file contains around 3000 records with 200 LRECL
my requirement is to build and insert a new record if its not found (key is not found) ......
I can take care of the Building part .... I need help in the IFTHEN=(WHEN) part.....
how do you code the condition???
Thanks,
Mahesh |
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Wed Mar 02, 2011 1:25 pm Post subject: |
|
|
You did not answer all the questions - how is "123" chosen?
If the file can contain thousands of records, the sample input posted is not enough to work with. SHow a more reasonable set of input and the output you want from the new sample input. Clearly explain the rules that control creation of the output. _________________ All the best,
di |
|
Back to top |
|
 |
|
|