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
 

 

Employees working in a company starting with the name 'A'

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dhivakarram

New User


Joined: 27 Jul 2006
Posts: 5
Location: chennai

PostPosted: Fri Aug 04, 2006 3:39 pm    Post subject: Employees working in a company starting with the name 'A'
Reply with quote

how to retrive, how many of the employees working in a company starting with the name A (eg:-arun,aakash likewise) from a emolyee file using mvs cobol. without using any sql or jcl its should be done with pure cobol.
:( anybody plz help me :(
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Fri Aug 04, 2006 3:51 pm    Post subject: Re: help me
Reply with quote

hi,
Suppose if the ws-name is PIC X(9) redefine it as ws-initial as PIC X(1) and ws-remainder PIC X(8) .So in the cobol program compare
ws-initial='A' .
Hence the names with starting letter 'A' could be retreived.

Issues if any please let me know,

Thanks,
Muthuvel.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Aug 04, 2006 7:14 pm    Post subject: Re: Employees working in a company starting with the name 'A
Reply with quote

Another Way...

Code:
READ INPUT FILE INTO WS-EMP-REC.

PERFORM PROCESS UNTIL END-OF-FILE.

PROCESS.
   IF WS-EMP-NAME(1:1) = 'A'
      WRITE OUTPUT.
      ADD 1 TO OUT-A-COUNTER.
   ELSE
      ADD 1 TO NON-A-COUNTER.
   END-IF.
EXIT.
   DISPLAY 'TOTAL EMPLOYEES WITH NAME STARTING FROM A' OUT-A-COUNTER.
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
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts SCRNAME not working on my mainframe? mrsidhu12 TSO/ISPF 7 Thu Sep 01, 2016 2:17 pm
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
No new posts 2 same CLIST pgm but with different n... boyti ko CLIST & REXX 5 Fri Jun 03, 2016 4:55 pm
No new posts REXX Screen not working due to LINKED... sundarkudos CLIST & REXX 1 Mon May 09, 2016 1:44 pm


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