Page 1 of 3

cobol program

PostPosted: Fri Jan 06, 2012 4:05 pm
by jvinoth
Hi,

I have a request
I have a vsam file in that it has many records and one column is name field. my request is that i want find out the records which are the names starting letter is 'S' how to retrive only those records from a flat file. please give me the logic and if can the sample code also.

Re: cobol program

PostPosted: Fri Jan 06, 2012 4:25 pm
by Robert Sample
Your "requirement" is so poorly defined that nobody could possibly help you much. When you say "VSAM file", do you mean an ESDS or KSDS or RRDS or LDS VSAM file? If KSDS, is the name field the key? If not, you must read the entire file sequentially and find each record having the required letter in the required column. What does a "flat file" (I assume you mean a sequential file) have to do with the VSAM file -- the two are not related? Sequential files have to be read one record at a time, anyway.

Furthermore, be aware that asking for logic and program code on this forum is asking professionals for their work product. This typically requires that you pay them for their time and expertise -- and rates are typically 1000 U.S. dollars (or euros) per day, although there are occasional offers as low as 500 per day.

Re: cobol program

PostPosted: Fri Jan 06, 2012 5:49 pm
by jvinoth
sorry that is sequential file in that i need to retrive the records which has the name starting with 's' letter how to find out.

Re: cobol program

PostPosted: Fri Jan 06, 2012 5:52 pm
by BillyBoyo
Robert already answered this above. If the name is not a/the key, you have to read your data sequentially. With each record, you test the first character of the name (various ways to do that, I'd defining the data to aid the operation) to see if it equal to "S" and do whatever when it is, and read the next record when it isn't.

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:04 pm
by jvinoth
can you please give me one logic to perform this operation.

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:17 pm
by BillyBoyo
I don't know what you are asking. Robert already gave you the "logic" to do it. I basically repeated that because I thought you hadn't read Robert's post properly.

That is "the logic" to do it. You read a record. You test one byte, which happens to be defined as the first character of the name. If that is "S", do what you want when it is S, else read another record. Continue until end of file.

Have I got code for it? Take any sample program which reads a file. Copy that. Define your record, including one byte representing the first character of the name. Put the "logic" into the main body of the program. Compile/link/run.

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:37 pm
by jvinoth
i asked sample code as well if can please post ..

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:42 pm
by BillyBoyo
I know what you asked, but if you read through these fora here you'll know it was unrealistic of you to do so. Sometimes life is tough.

All you need is a program which reads a file and to write a few lines yourself (around six, depending on what you want to do when you find an "S"). If you can't manage that from books, manuals, google etc, then I don't know what to suggest.

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:52 pm
by Robert Sample
i asked sample code as well if can please post ..
Should we discuss arrangements for you to PAY for this code? If you are not willing to pay for the code, then do not ask for code. If you're willing to pay for the code, I'll even give you a flat rate discount -- $1000 (U.S.) for the program.

Re: cobol program

PostPosted: Fri Jan 06, 2012 6:55 pm
by jvinoth
ha ha ....great price i dont need your code at all thanks.... :D