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

How to find the COMP-3 field value in a file.


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

New User


Joined: 23 Dec 2005
Posts: 2
Location: bangalore

PostPosted: Wed Jul 30, 2008 5:15 pm
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
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 30, 2008 5:20 pm
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: 25
Location: chennai

PostPosted: Wed Jul 30, 2008 5:21 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 30, 2008 5:28 pm
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: 1512
Location: Virginia, USA

PostPosted: Wed Jul 30, 2008 5:32 pm
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 Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jul 30, 2008 5:49 pm
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

JCL Moderator


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

PostPosted: Wed Jul 30, 2008 7:02 pm
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
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

JCL Moderator


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

PostPosted: Wed Jul 30, 2008 9:41 pm
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

Moderator Emeritus


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

PostPosted: Wed Jul 30, 2008 11:26 pm
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
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top