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 and updating particualr record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> FAQ & Off Topics
View previous topic :: :: View next topic  
Author Message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Mon Feb 16, 2009 9:26 pm    Post subject: how to read particular record out of several record everytim
Reply with quote

I have input file of LRECL=133 where I have got 65 records for every employee having diff information on each record.Out of 65th I need to check 7th record(or 7th line) 34th position of every employee and need to search whether I have same value in Second file .Second file has LRECL =80 but will contain only 4 digit value.If i found same value in 7th record of 1st file present in as that of second file I need to place N on 125th position in 7th record of the first file.I need to search second file because I dont know where the value will be may be at last


For Ex think following line is 7th record of 1st employee and have got 0830 value in 34th position now i need to search whether 0830 value present in second file.If yes I need to Place N in 125th column of same 7th record of an employee
34th Position 125th Position
11889 DOUGLAS DR 0830 0030 053 N


Please let me know code that can perform better?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Mon Feb 16, 2009 11:41 pm    Post subject:
Reply with quote

Quote:

Please let me know code that can perform better?
Code that can perform better than what? You haven't posted anything to say how you're solving the problem already, so there's nothing to compare against.
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Tue Feb 17, 2009 8:18 pm    Post subject:
Reply with quote

Robert,

Sorry I mean to say I want code in an effective way and I currently dont have any code.Please let me know your ideas on the same
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Tue Feb 17, 2009 9:20 pm    Post subject:
Reply with quote

I guess your first file is a VSAM . If not create it that way because the performance wil be too good. Create the key in such a way that for a particular employee u can identify all the 65 records independently.

Using the key read the first file and then perform your required operation...
It would be good if you could specify the second file as VSAM too.

REMEMBER to open our ur first file in I-O mode...and take file backups before running the programs
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Tue Feb 17, 2009 9:52 pm    Post subject: Reply to: how to read particular record out of several recor
Reply with quote

No Its not a vsam File kishore and its very difficult to have it as VSAM since each record of an employee is not having anything unique in all records.....
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Tue Feb 17, 2009 10:48 pm    Post subject:
Reply with quote

if that is the case how do u identify to which employee a particular record belongs if there is not anything common...

if its not a VSAM create a temp VSAM and load the flat file to that....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Feb 18, 2009 5:09 am    Post subject:
Reply with quote

Read all 65 records into an array, then use reference modification to identify the appropriate fields to access and change. You can then write all 65 array elements to your output file. I don't think you can do this without having an input file and an output file unless you change the file from sequential to VSAM.
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: Wed Feb 18, 2009 5:33 am    Post subject:
Reply with quote

Hello,

Quote:
I don't think you can do this without having an input file and an output file unless you change the file from sequential to VSAM.
Even if you could, you would be better off not. . . An abend could corrupt the input requiring it be rebuilt. If you write to a separate qsam file, there is no risk to the orginal input.
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Wed Feb 18, 2009 1:31 pm    Post subject: Reply to: how to read particular record out of several recor
Reply with quote

we can have a different approach.....using the VSAM itself...


1. Use VSAM in I/P mode
2. create the sequential O/P
3. REPRO to the VSAM(if required as ur i/p file is PS)

In this case the proceess is faster and VSAM rebuiliding is not required in case of an abend is not there.
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Fri Feb 20, 2009 9:23 pm    Post subject: How to rewrite the records or store the records in array
Reply with quote

I have input file of LRECL=133 where I have got 65 records for every employee having diff information on each record.Out of 65th I need to check 7th record(or 7th line) 34th position of every employee and need to search whether I have same value in Second file .Second file has LRECL =80 but will contain only 4 digit value.If i found same value in 7th record of 1st file present in as that of second file I need to place N on 125th position in 1st record of the first file.I need to search second file because I dont know where the value will be,it may be at last also.

Remember I need to update in First record based on values of 7th record and second file value


For Ex think following line is 7th record of 1st employee and have got 0830 value in 34th position now i need to search whether 0830 value present in second file.If yes I need to Place N in 125th column of 1st record of every employee(not in the same 7th records but 1st record)

11889 DOUGLAS DR 0830 0030 053 N
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Feb 20, 2009 9:25 pm    Post subject:
Reply with quote

Have you looked at this: http://www.ibmmainframes.com/viewtopic.php?t=38137&highlight=
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Fri Feb 20, 2009 9:37 pm    Post subject:
Reply with quote

Yes, But here requirement is changed and I want to update the 1st record and not 7th record.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Feb 20, 2009 11:49 pm    Post subject:
Reply with quote

First record, 7th record, 65th record ... it doesn't matter. The same basic method is used. Read all records into an array, do what you want using the array, then output all the array elements to your file.
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: Sat Feb 21, 2009 1:40 am    Post subject: Reply to: How to rewrite the records or store the records in
Reply with quote

Hello,

Any more discussion should be posted n the original topic (link above).

Changing which record is not a requirement change, , , It is just a duplicate post.

d
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Sat Feb 21, 2009 10:14 pm    Post subject:
Reply with quote

It will be more helpfull if i can get syntax for the following.

I want to read 65 records of lrecl 150 each from a input flat file until employee number changes and need to store it in an array.after storing I need to retrieve piece of data from 7th record and need to search in a table if same value present in table also i need to retreive 1st record from array and need to update 125th position and need to write full 65 records to output file and need to proceed with second 65 records for an second employee like wise till the end of first input file
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: Sat Feb 21, 2009 10:23 pm    Post subject:
Reply with quote

Hello,

Quote:
It will be more helpfull if i can get syntax for the following.
Actually, it will be more help for you to write the code and learn by so doing.

Your description says what you want to do, so you need to put the code in place:
Define the files and the array.
Write the code to read the file and put the records for an employee into the array.
Perform a routine to work with the employee in the array (don't forget to process the array one more time at eof so the last employee will be processed).
Once the array has been processed, write the updated array entries to a new output file.

If you get stuck, post what you have and your question. Someone will be able to help.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Feb 21, 2009 10:23 pm    Post subject:
Reply with quote

Quote:
It will be more helpfull if i can get syntax for the following.
And it will be more helpful if I get paid my daily rate to do your job for you. Read the manuals and write the program, or plan on paying somebody to write your code for you.
Back to top
View user's profile Send private message
gopinathmk

New User


Joined: 17 Nov 2006
Posts: 15

PostPosted: Sat Feb 21, 2009 10:26 pm    Post subject: searching and updating particualr record
Reply with quote

Can DFSORT help me in doing following:

1) Input file with LRECL=140 will have 65 records for each employee and can have several employees like wise and each employee with 65 records

2)second input file with lrecl=80 but got data only in first 4 columns(i.e Pic X(4))


Now i need to search 4 columns from 34th position of 7th record out of 65 records of each employee and I need to search whether same 4 digit value present in second input file.If Yes I need to update 125th position of 1st record of 65 records of every employee and need to write all 65 records to output file if value doesnt found in input file i need to write whole 65 records without updating any record. Like wise this should continue till last employee in input file
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Feb 21, 2009 10:32 pm    Post subject:
Reply with quote

Let's see -- you didn't get somebody to write your program for you in the COBOL forum, so now you're going to try in the SORT forum ... wanna bet it doesn't work here, either?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Feb 21, 2009 10:39 pm    Post subject: What do you want?
Reply with quote

You have asked the same general question three times.
First as a Syncsort question that got moved to COBOL, second as a COBOL question and third as a DFSort question.
Wht kind of solution are you looking for?
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 -> FAQ & Off Topics All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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