Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to find the COMP-3 field value in a file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
mf_raghuram

New User


Joined: 23 Dec 2005
Posts: 2
Location: bangalore

PostPosted: Wed Jul 30, 2008 5:15 pm    Post subject: How to find the COMP-3 field value in a file.
Reply with quote

Hi,

If a file have million records with key ws-empno which is comp-3 field.

Now I open a file at 3.4 option and want to find a record where ws-empno value is 1234.

How can I achieve this since the value in file will be like junk.

Regards,
Ram.
Back to top
View user's profile Send private message
References
Robert Sample

Senior Member


Joined: 06 Jun 2008
Posts: 941
Location: Atlanta, GA

PostPosted: Wed Jul 30, 2008 5:20 pm    Post subject:
Reply with quote

Assuming you're using VIEW or BROWSE mode, the command
Code:
FIND '01234C'X
should work fine. You may need to put column start and end values between the FIND and the value, though -- depending on what the data in the file looks like other than the key.
Back to top
View user's profile Send private message
sudhakar84

New User


Joined: 20 Jun 2008
Posts: 21
Location: chennai

PostPosted: Wed Jul 30, 2008 5:21 pm    Post subject: Reply to: How to find the COMP-3 field value in a file.
Reply with quote

Usualy we used to look the record with a layout in the FILE-AID.
or else move the variable of type numeric and write it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1639
Location: germany

PostPosted: Wed Jul 30, 2008 5:28 pm    Post subject:
Reply with quote

Quote:

... since the value in file will be like junk


only to the blind.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1001
Location: Virginia, USA

PostPosted: Wed Jul 30, 2008 5:32 pm    Post subject: Re: Reply to: How to find the COMP-3 field value in a file.
Reply with quote

sudhakar84 wrote:

or else move the variable of type numeric and write it.


COMP-3 IS DEFINITELY A NUMERIC TYPE. If you are a mainframe programmer and you can't handle COMP-3 you are in the wrong profession.
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2222
Location: Phoenix, AZ

PostPosted: Wed Jul 30, 2008 5:49 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
only to the blind.
Your comments just blows me away.. icon_smile.gif
Back to top
View user's profile Send private message
Terry Heinze

Active User


Joined: 14 Jul 2008
Posts: 176
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 7:02 pm    Post subject:
Reply with quote

[quote="dbzTHEdinosauer"]
Quote:
only to the blind.

icon_lol.gif
Back to top
View user's profile Send private message
kespra
Currently Banned

New User


Joined: 03 Jun 2008
Posts: 24
Location: bangalore

PostPosted: Wed Jul 30, 2008 8:11 pm    Post subject:
Reply with quote

Put HEX ON in command prompt, then you see the value of Comp3
Back to top
View user's profile Send private message
Terry Heinze

Active User


Joined: 14 Jul 2008
Posts: 176
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 9:41 pm    Post subject:
Reply with quote

Also, don't forget the HEX DATA command (horizontal hex instead of vertical hex). Easier to read for people who are half blind, Dick. icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8729
Location: 221 B Baker St

PostPosted: Wed Jul 30, 2008 11:26 pm    Post subject:
Reply with quote

Hello,

Quote:
If a file have million records with key ws-empno which is comp-3 field.

Now I open a file at 3.4 option and want to find a record where ws-empno value is 1234.
Suggest you do what you need in batch rather than online. . .

Trying to work with a million records in the editor makes little sense and wastes a lot of resources. . .

You could create a file of selected records (using your sort product) and use the subset in the editor.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1