Page 2 of 2

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 5:53 pm
by praveen_4
Hi Robert,
I understand that every site has its own coding standards but end of the day logic remains the same.

I have a fare idea about the paging concepts but coding logic remains a bit of mystery for me....Please let me know if you could help me in any means...

Thanks & Regards
Praveen

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 5:57 pm
by NicC
And you should not tag your new question onto someone else's old post.

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 6:01 pm
by enrico-sorichetti
as I said somewhere else ...
it is easier to teach a puppy not to s*it on the rug
than teach somebody how to post properly ;)

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 6:08 pm
by Robert Sample
One of the issues is what kind of file are you reading -- VSAM KSDS? VSAM ESDS? VSAM RRDS? Something else? IF the file is VSAM KSDS, and the key is the account number, one way would be to store the first and last account numbers you are displaying in the map -- place them in DFHCOMMAREA so they are retained across transactions. If someone hits the PF8 key, then you take the last account number and start browsing the file from that key. You may make it the first line of the new map, or you may just read the next record and use it for the first line. If someone hits the PF7 key, then you take the first account number and start browsing from that key, then use READPREV to backfill the map lines.

Another way would be to build a TS queue and store the item number for the map lines in DFHCOMMAREA. There are other ways, of course.

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 6:24 pm
by praveen_4
Enrico,
I believe no one starts walkin as soon as they are born..we gradually tend to learn things.
Yeah it would be much better if you go ahead and teach your puppy if that gives you comfort.

Anywaz thanks for talking time out and replyin.

Regards
Praveen

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 6:38 pm
by enrico-sorichetti
I believe no one starts walkin as soon as they are born..we gradually tend to learn things.
Yeah it would be much better if you go ahead and teach your puppy if that gives you comfort.


if You had looked around and read the FAQ here
faq.php
You would have noticed the paragraph
NewTopic & Topic Title
Start a new topic to post your queries.Do not ask your doubts as a reply to another post. Posts are to be made in relevant category/Forum. Make your topic title meaningful and descriptive. Do not use words such as Urgent/ Please/ Help! or Important in your subject line. Never use the Forum name as your topic title.

very little to learn ... uhu ?

Re: Page Up and Page Down

PostPosted: Thu Nov 24, 2011 6:53 pm
by praveen_4
Hi Robert,
I am using Vsam name file where am taking the corporation number and account number as a key,displaying the account number greater then key and address: 5 records per screen.Would try the program with the above concept and keep you posted about my progress.

Appreciate you for taking time out and answering my query.

Regards
Praveen

Re: Page Up and Page Down

PostPosted: Fri Dec 09, 2011 12:14 pm
by praveen_4
Hi Robert,
With the concept given was successfull in getting page up and page down but there is a small bug which am tryin to fix.
The page up doesnt seem to end with the given corp number but it reads the file with other corp and starts dispalying.

Have tried the following code but it didnt work.could you please guide me in this....Thank you.
5000-PAGE-UP       SECTION.
 
     IF  WS-NA-CORP-NO-0  NOT = NA-CORP-NO-0
         M2EX2-CORP     = SPACES OR LOW-VALUES
          MOVE     -1                      TO    M2EX2-TRANID-L
          MOVE     WS-NO-PAGE              TO    M2EX2-MSG
         PERFORM  2000-SEND-MAP
         GO TO    5000-99-EXIT
     ELSE
         MOVE     WS-NA-CORP-NO-0         TO    NA-CORP-NO-0
         MOVE     WS-NA-ACCOUNT-NO-FIRST  TO    NA-ACCOUNT-NO-0
         MOVE     18                      TO    WS-LENGTH
     END-IF.
     PERFORM    0500-STARTBR-PARA
     PERFORM    1500-READ-PREV-PARA
       MOVE   5 TO WS-I
     PERFORM UNTIL   WS-I <    1
            PERFORM    1500-READ-PREV-PARA
     IF WS-I = 1
           MOVE NA-CORP-NO-0     TO WS-NA-CORP-NO-0
           MOVE NA-ACCOUNT-NO-0  TO WS-NA-ACCOUNT-NO-LAST
     ELSE
           MOVE NA-CORP-NO-0     TO WS-NA-CORP-NO-0
           MOVE NA-ACCOUNT-NO-0  TO WS-NA-ACCOUNT-NO-FIRST
     END-IF
     PERFORM 1600-MOVE-TO-MAPVARIABLES
     SUBTRACT 1 FROM WS-I
     END-PERFORM
         MOVE  5    TO WS-I
     END-IF.
     PERFORM       2000-SEND-MAP.
5000-99-EXIT.
    EXIT.

Re: Page Up and Page Down

PostPosted: Fri Dec 09, 2011 1:11 pm
by dick scherrer
Hello,

You need to use the "code" tag for alignment and readability.

You should never post "it didn't work" (which is the biggest waste of time and space on the forum). You need to post what happened and ahow what you wanted to happen instead. Why should someone who would help be required to wade thru code and not know what problem(s) you have?

Re: Page Up and Page Down

PostPosted: Fri Dec 09, 2011 1:45 pm
by praveen_4
Hi
You need to post what happened and ahow what you wanted to happen instead.....?
Hmmm thats what have been posted in my query above..
A Detailed explanation would be.In my map given in previous query I am reading a file with corp as key and displaying the records of that particular corp which I was able to do.
The problem here is I was trying to limit my records to only records pertaining to certain corp.And if some other corp cumes then it should stop.
Please let me know if you can help me in this.

Regards
Praveen