Need help with practice assignment!!



High Level Assembler(HLASM) for MVS & VM & VSE

Re: Need help with practice assignment!!

Postby Robert Sample » Mon Apr 06, 2015 8:48 am

You are not getting column names out because you didn't put that in your program. Between line 173 and 174, insert this code
         XPRNT PLINE,97
         MVI   PLINE,C' '
         MVC   PLINE+1(96),PLINE
In line 183, change
MVC PRICOUT(4),=XL3'4020214B2020' 
to
MVC PRICOUT+5(6),=X'4020214B2020'
and you really should use EDMK instead of ED on line 184 for inserting the currency symbol. Similar changes to the edit masks are needed on lines 189, 192, 195. Lines 186 and 187 are flat-out wrong -- you cannot move a packed decimal data field to the print line and expect anything printable to result. You used edit masks for the other packed decimal fields, why did you not use them for these two fields? Those weird looking characters you see in your output lines are the data -- it doesn't look right because you did not properly use your edit masks and truncated them.

I would change line 218 from
PLINE   DC CL1' '             PRINT LINE
TO
PLINE   DS    0CL121
DC    CL1' '             PRINT LINE
to clearly indicate that the next 121 bytes are all part of PLINE.

can you clarify regarding line 77 (i chose it that way cause the teacher gave us the DSECT values and also the values that we are supposed to pack).
This is a very important lesson to learn: teachers are human, too. They make mistakes. Your teacher didn't compare the card layout to the input statements and hence missed that the 4 needs to be a 3. Or, your teacher could have deliberately inserted that error to see if you could fix it yourself.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Re: Need help with practice assignment!!

 

Re: Need help with practice assignment!!

Postby pintu1228 » Mon Apr 06, 2015 8:50 am

HERE IS THE UPDATED FILE, I KEEP GARBAGE IN MY TABLE. LIKE AFTER TOTAL COLUMN NAME, IN THE DATA I GET JUNK FROM PRICE ON.


tHANKS
You do not have the required permissions to view the files attached to this post.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with practice assignment!!

Postby pintu1228 » Mon Apr 06, 2015 8:52 am

DISREGARD PAST POST DIDN'T SEE THE ONE YOU COMMENTED ON.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with practice assignment!!

Postby pintu1228 » Mon Apr 06, 2015 9:10 am

OK I MADE ALL THE CHANGES YOU SAID BUT AFTER MY PRODUCT ID THERE IS NOTHING PRINTED, AND ALSO MY COLUMN NAMES ARE MISSING (SHIPPING AMOUNT, DISCOUNT, TOTAL)

i HAVE ATTACHED THE FILE
You do not have the required permissions to view the files attached to this post.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with practice assignment!!

Postby enrico-sorichetti » Mon Apr 06, 2015 11:18 am

do not use all capitals when posting ...
it' s like shouting and You do not have any reason to shout.

to find out the reason for not getting the expected output
review and meditate on the code snippets posted with examples of the ED constructs
and compare them to the ED constructs used in Your program

everything You need has already been explained in the answers You received
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Need help with practice assignment!!

Postby Robert Sample » Mon Apr 06, 2015 4:36 pm

In line 174 you print 97 bytes of column headers. But you have changed your column headers and hence you need to change your XPRNT in line 174. I would use XPRNT PLINE,121 as the Assist output line is typically 121 bytes -- BUT YOU MUST MAKE SURE THE NEXT 121 BYTES AFTER PLINE ALL DEFINE YOUR PRINT LINE. As it stands, you have 117 bytes after PLINE and then your register save area. So printing 121 characters will give you 4 bytes of non-printing characters at the end of each line (namely, the value of register 0 that you saved). You are very inconsistent in your print lines -- you need to get used to using a standard length (121 or 133 being most common) and make every print line have that number of characters. Otherwise you will run into buffer issues and unexpected output will show up.

Why are you putting lengths on your ED instructions? Try removing them to see what prints.

And you say nothing has printed, but you have output for each record along with the column header line. Since you used lengths (and wrong lengths at that) on the ED instructions, of course your output is not normal printing characters.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Need help with practice assignment!!

Postby enrico-sorichetti » Mon Apr 06, 2015 7:15 pm

the real problem is that the TS
moves the edit mask to some place with some length
and invokes the ED instruction pointing to a different place with a different length
for example ...
MVC PRICOUT+5(6),=X'4020214B2020'       
ED PRICOUT(4),$TPRICE                   


all the other ED instructions look the same

Robert how many credits will You get by doing the TS assignment ?
( You are more than helping, You are spoon-feeding him ) ;)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Need help with practice assignment!!

Postby pintu1228 » Mon Apr 06, 2015 10:53 pm

Ok I understand what you said about the length were not matching but quick questions.

When it prints the table in PRICE EACH the digits print as 650. but I want 6.50 instead so how do I move the decimal place?

The number ordered field add an extra digit and in the row with Customer ID F9685 the number should be 110 instead of 103.

The date ordered format is off, its missing the year 2015 and how do I put in the /(backslash) between the date,month, and year?

The Shipping, Discount and Totals fields don't print any date, is it because my MVC/ED format is wrong?


Looks to be some issue at MAIN (BR R14)---causing abend.


Thanks
You do not have the required permissions to view the files attached to this post.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with practice assignment!!

Postby Robert Sample » Tue Apr 07, 2015 3:15 am

1. The price problem is simple -- you defined, in your edit mask, 5 digits before the decimal point. Since your price is PL3 there are only 5 digits total so they all get placed in front of the decimal point.
2. I have told you -- more than once -- what your problem with the quantity is. Since you insist on using what your teacher gave you, even though it is wrong, there is nothing more I can do to help you with this field.
3. The edit mask allows you to insert characters at fixed positions -- including decimal points, commas, and slashes. Change your edit mask for the date to include slashes at the appropriate locations.
4. Several of your moves of edit masks are too small -- the date edit mask, for example, has 11 characters yet you only allow 7 characters in the receiving field.
5. Edit masks do not handle floating characters (such as the currency symbol for the price); the way to handle floating currency signs is through the EDMK instructions.
6. The shipping, discount, and totals fields may not be printing because your edit mask is too long for the values -- I would try reducing them to fit the actual data.
7. You may need to learn more about the significance character in edit masks and why it is important before you get finished with your code.
8. The first character of each customer id is not as input because of an issue I have told you about in the past, so again you can fix it or not -- your choice.

You really need to continue to dump your data after CMPUTE is done until PRINT handles each field correctly -- debugging is easier when you know what the values should be on the output line.

The ABEND is due to storage being overwritten. When you restore the registers from your save area, you are putting garbage data into the registers and hence the BR14 does not work.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Need help with practice assignment!!

Postby pintu1228 » Tue Apr 07, 2015 5:42 am

Ok thanks, can you help me in TOTALS subroutine....so what I don't understand is how do I counter the number of sales and number of sales with no shipping? Am I suppose to reset a counter variable and have it count in the loop every until last entry?

How do I do it for the when the shipping is 0 (and not for all the entries)?

Also what kinda of code am I supposed to put to find the largest value of 1 sale?


Thanks
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

PreviousNext

Return to Assembler