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

Help me with the logic


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Surekha Kareti

New User


Joined: 26 May 2009
Posts: 3
Location: Bangalore

PostPosted: Thu Oct 21, 2010 4:36 am
Reply with quote

Hi, Please find my requirement and help me coding in program.

1) Program A calls my pgm using two parameters. They are
a) I1 - x(01) values are O, W, H (Header), L (line) , C
b) I2 - X(60)
Program A moves as below:
MOVE WS-NAME TO I2
MOVE 'H' TO I1
Calls my program

after that again it moves student id and calls like this it calls.

2) My program receives I1 & I2 and should write an output file which is of length 256. This file should have header and line items.

Could some one please help me in writing the logic.

Thanks
SR
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: Thu Oct 21, 2010 5:15 am
Reply with quote

Your basic problem is that your requirements are not clear. If the requirements are adequately stated, usually the program becomes a fairly simple translation process. Examples of issues with your post:

1. Where did this come from -- the only mention in your post of "student id"?
Quote:
after that again it moves student id and calls like this it calls.

2. Why is the output file 256 bytes long -- shouldn't it be a multiple of 60?

3. Will you only have one header?

4. How many detail lines can you have?

5. How do the O, W, C values figure in your program?

6. Why do you need a subprogram for this anyway -- shouldn't you just do it all in program A?

7. Will program A call your program to signal the end of the processing? If not, how will your program be able to write out the last record?

8. Are you supposed to be accumulating the detail lines into a single output record -- or should each detail be written as a line? If so, what do the extra 206 bytes consist of in the record?

9. Will the I2 variable always have 60 bytes of data?

and that's a start at helping you come up with the logic.
Back to top
View user's profile Send private message
Surekha Kareti

New User


Joined: 26 May 2009
Posts: 3
Location: Bangalore

PostPosted: Thu Oct 21, 2010 7:53 am
Reply with quote

Thanks for your reply. I am answering for all your questions in sequence also attaching the output format how it should look like.

1) I just mentioned Student ID as an example there are many fields.

2) Output is not a multiple of 60, the length is 256. When program A reads input file it moves student id, name etc etc to I2 and calls my program to write output file.

3) Only one header

4) Lines should not be morethan 22

5) O - File to open, W- to write file, C - close a file

6) Its Client req thats why writing a module

7) Program A signals that my pgm is end of process

8) Please see attached

9) I2 is 60 bytes field but student id or name or etc is moving into it may not be 60bytes.

Please let me know the thoughts
Thanks
SR
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Oct 21, 2010 1:39 pm
Reply with quote

(1) do not post attachments, (2) do not post screen shots,
(1) not everybody can see them
(2) is just a waste of resource, the same info can be conveyed with a text cut and paste and the code tags

if You want help it would be wiser to learn to describe clearly the requirements
how does the screen shot relate to Your issue ?
Back to top
View user's profile Send private message
Surekha Kareti

New User


Joined: 26 May 2009
Posts: 3
Location: Bangalore

PostPosted: Thu Oct 21, 2010 8:17 pm
Reply with quote

I am sorry, I am new. Thanks
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: Thu Oct 21, 2010 10:51 pm
Reply with quote

Hello and welcome to the forum,

Quote:
I am sorry
Not to worry - someone will let you know when you post astray. . . icon_smile.gif

Quote:
I am new.
Which makes being clear quite important.

Quote:
Thanks
You're welcome.

Suggest you start over and post some sample input data. Then show the exact output you want from the sample input. Use copy/paste and the "Code" tag to preserve alignment and improve readability. There is a Preview function so you can see your post as it will appear to the forum rather than how it looks in the Reply Editor. Once the appearance is as you want, Submit. If you copy/paste screen text, you should not manually change the spacing (this will corrupt the alignment).

Post the rules for getting from the input to the output. The sample data should contain data that demonstrates each rule.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
This topic is locked: you cannot edit posts or make replies. Need assistance in job scheduling logic. Mainframe Interview Questions 2
No new posts Rexx Logic error while adding seperat... CLIST & REXX 3
No new posts PL/1 Callback address logic in z/OS C... PL/I & Assembler 1
No new posts Sync logic between VSAM files and DB2... COBOL Programming 9
Search our Forums:

Back to Top