View previous topic :: View next topic
|
Author |
Message |
premraj_joshi
New User
Joined: 15 Mar 2005 Posts: 3
|
|
|
|
HI all,
I have an input file. I am getting one field value of the input file from a table. Now, I have to scan the fields of the input file to see if that value in the field exists and depending on that ,I have to write to an output file.
How do I do this?
Regards,
Prem |
|
Back to top |
|
|
abirami
New User
Joined: 11 Mar 2005 Posts: 7
|
|
|
|
write a patch of code which checks the existance of that particular field... (eg.if the field is a char, check for null and space)
if the dats is there write into the output file...
Hope this helps... |
|
Back to top |
|
|
premraj_joshi
New User
Joined: 15 Mar 2005 Posts: 3
|
|
|
|
hi abirami,
I think my question was not clear.
I have a field in an input file containing more than 10000 records and I have a value.
Now, I have to check whether that value exists in that field for those 10000 records.
How do I search the file and locate the record?
Thanks and Regards,
Prem |
|
Back to top |
|
|
vinayakaa
New User
Joined: 20 Mar 2005 Posts: 8 Location: Bangalore
|
|
|
|
hi
i suggest you can sort the file based on that field which you are using for comparision and then put a small logic to find the record containing that record. just do a read, compare and if you find a hit you can write it. this way you can reduce overhead.
Thanks,
V |
|
Back to top |
|
|
sunil1405
New User
Joined: 14 Mar 2005 Posts: 1 Location: Bangalore
|
|
|
|
hii all,
In cobol am accepting a input like 'name', i want that name to be displayed in the output in vertical order, how can we do that? |
|
Back to top |
|
|
rajesh.c
New User
Joined: 21 Mar 2005 Posts: 1 Location: bangalore
|
|
|
|
hii
u can go for search option with getting fields from tables(say a field of name from table), and the value in variable.
if it found to be many appeareance , increase the index and carry on for search, with saving tha last index vakue for furthur reference.
here the index pay role.
if u have any ans mail me |
|
Back to top |
|
|
ravisan Warnings : 1 New User
Joined: 13 Sep 2005 Posts: 13 Location: chennai
|
|
|
|
By using File-Aid we can find whether that filed has specific value or not in the input file.
with regards,
ravisan |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
For Sunil1405 - your question needs to start a new topic. It does not follow with this thread.
For Prem - do you need to do this only once or will this be part of an ongoing job? If it is only one-time you might do it online in tso and/or file-aid. If it is ongoing, you could write a small COBOL program, use the sort, or run batch tso/file-aid.
If you look in the JCL and DFSORT forums you will find multiple answers that should work for you. |
|
Back to top |
|
|
|