Display Files Week 4
Write vs Exfmt Write displays the screen Exfmt displays the screen and gets the input
Indicators Don’t need a data structure but… Makes RPG more readable! Data type for an indicator is an N Fprjdspf CF E WORKSTN indds(indicators) Dindicators DS D F3 3 3N D F12 12 12N D F11 11 11N
Date Field Functions
%diff - Finding the Difference between Dates %DIFF(op1:op2:??) Where ?? Can be: *MSECONDS|*SECONDS|*MINUTES|*HOURS|*DAYS|*MONTHS|*YEARS Or %DIFF(op1:op2:*MS|*S|*MN|*H|*D|*M|*Y)
Changing a number to a date value %day(31) - will change 31 to a number of days %month(9) – will change 9 to a number of months %year(12) – will change 12 to a number of years So: newDate = oldDate + %day(15) will add 15 days to oldDate and store the result in NewDate
Updating Database Files Update record format name changes a record. The record must be read first Write record format name Appends a record to the file Delete record format name Deletes a record from the file Record must be read first