Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Searching a Input File and need to store in Output File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Searching a Input File and need to store in Output File
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    Post subject:
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    Post subject: Re: Searching in a file
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    Post subject: Re: Searching ing a file
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    Post subject: cobol
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    Post subject: hiiii
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    Post subject:
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

Site Director


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

PostPosted: Tue Jan 30, 2007 11:32 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us