I am attempting to print some output using XPRNT in my program. We are using very basic/old assemler assist program and mvs batch to code everything.

My code basically reads in a employee number, hourly wage (in cents), hours worked, bonus (in cents), and deduction amount (in cents). I store these using XDECI into registers. Then do a simple IF statement to check if the hours worked is greater than 40, if it is, i have to take: (40 * wage) + (hours_worked - 40) * (wage * 2) = overtime pay...
ELSE
hours_worked * wage = pay

I then add the bonus, and subtract the deduction to get the NET pay.

I store the initial pay (gross pay) and then NET pay into registers.

I then want to print them like this:

Emp. Hourly Hours gross net
num wage worked bonus deductions pay pay

123456 3600 40 12000 11300 144000 144700
xxxx xxxx xxx xxxx xxxx xxxx xxxxx

But i cant seem to align my printing out correctly. If someone could take a look at my code, and see where i might be going wrong... first off here is my ouput:

PAYROLL REPORT -- JOHN JONES WIDGET COMPNAY EMPLOYEE
EMPLOYEE HOURLY HOURS GROSS NET N
NUMBER WAGE WORKED BONUS DEDUCTIONS PAY PAY
123456 0 72656 12000 11300 72656 40
841817 0 326499 1500 21400 306439 81
578382 0 346814 10500 12000 253157 25
328947 0 -762545 9500 9735 -925695 45
829030 0 -324174 1850 5580 -421251 30

And here is the code that does it:
calling line to print:

XPRNT     PLINE,70       prints each data line

And print section:

PLINE    DC        C' '          start of line data
         DC        CL1' '
EMPNUM   DS        CL1          emp number
         DC        CL6' '       spaces x 5
WAGE     DS        CL6          wage hourly
         DC        CL4' '       space x 5
NETPAY   DS        CL6          hours worked  
         DC        CL4' '       space x 5
BONUS    DS        CL6          bonus  
         DC        CL6' '       space x 5
DEDUCT   DS        CL6          deductions
         DC        CL4' '       space x 5
GROSSPAY DS        CL6          gross pay  
         DC        CL4' '       space x 5
HOURS    DS        CL6          net pay

Anyone got any ideas how i could edit this code to print nicely....

Thank you... in the meantime, im going to attempt to get it figuring out the correct net and gross pay!

Thanks all

Recommended Answers

All 3 Replies

You didn't post any code.
Just the call to the output function, and the 'format' of the output string.

You need to look at the functions which write to your 'string', at say DEDUCT
Look at the length of the space available, and whether you're justifying to the left/right as appropriate.

in c pointer if the output is the x
xxx
xxxxx
what will be the input of c pointer.

in c pointer if the output is the x
xxx
xxxxx
what will be the input of c pointer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.