Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sample Program to display all odd integers betweem 1 to 100

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
srini_gunja
Currently Banned

New User


Joined: 24 Aug 2005
Posts: 7

PostPosted: Mon Sep 11, 2006 12:03 pm    Post subject: Sample Program to display all odd integers betweem 1 to 100
Reply with quote

Hi all,
I am new to cobol and I m in learning phase.
Please do the needfull in writing the cobol programs.


1) Program to display all odd integers betweem 1 to 100


2) Program to count number of records in the inputfile

Thanks,
Srini.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Sep 11, 2006 12:25 pm    Post subject:
Reply with quote

PERFORM VARYING I FROM 1 BY 1 UNTIL I>101
DIVIDE I BY 2 GIVING J REMAINDER K
IF K EQ 0
DISPLAY I
END-IF
END-PERFORM.


2.

to count number of record in i/p file u can do it by ICETOOL
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Sep 11, 2006 12:27 pm    Post subject:
Reply with quote

I recommend to start by reading the fine manual. After reading it, let us know if you need more help.

O.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Sep 12, 2006 4:19 am    Post subject: Re: Sample Program to display all odd integers betweem 1 to
Reply with quote

Srini wrote:

1) Program to display all odd integers betweem 1 to 100


Code:

PERFORM VARYING SUB FROM 1 BY 2 UNTIL SUB > 100
    DISPLAY SUB
END-PERFORM


Dave
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us