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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

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

Global Moderator


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

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: 1512
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 Dhawan

Senior Member


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

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

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
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

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
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

Site Director


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

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
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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