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

Searching a Input File and need to store in Output File


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
premraj_joshi

New User


Joined: 15 Mar 2005
Posts: 3

PostPosted: Mon Mar 21, 2005 11:00 am
Reply with quote

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

New User


Joined: 11 Mar 2005
Posts: 7

PostPosted: Mon Mar 21, 2005 12:05 pm
Reply with quote

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

New User


Joined: 15 Mar 2005
Posts: 3

PostPosted: Mon Mar 21, 2005 12:33 pm
Reply with quote

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

New User


Joined: 20 Mar 2005
Posts: 8
Location: Bangalore

PostPosted: Mon Mar 21, 2005 1:46 pm
Reply with quote

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

New User


Joined: 14 Mar 2005
Posts: 1
Location: Bangalore

PostPosted: Mon Mar 21, 2005 1:56 pm
Reply with quote

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

New User


Joined: 21 Mar 2005
Posts: 1
Location: bangalore

PostPosted: Mon Mar 21, 2005 2:00 pm
Reply with quote

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
View user's profile Send private message
ravisan
Warnings : 1

New User


Joined: 13 Sep 2005
Posts: 13
Location: chennai

PostPosted: Tue Jan 30, 2007 3:26 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jan 30, 2007 11:32 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top