I am trying to convert time in 24 hr format to 12 hr format
I've used %EDITC thousands of times before but some reason this is causing me to have a brain fart
I want to 1500 hrs to be converted to 3PM
CHRS is packed (4,0)
wkhrs is zoned(2,0)
wkpmhrs is char(2)
so it seems like
wkhrs = CHRS / 100;
wkpmhrs = %Editc((wkhrs - 12):'4') ;
Would produce ' 3' when CHRS = 1500
wkhrs = CHRS/100 = 15
15-12 = 3
wkpmhrs = %Editc((3):4') should be ' 3'
I must be missing something because debug gives wkpmhrs = *blanks
I've used %EDITC thousands of times before but some reason this is causing me to have a brain fart
I want to 1500 hrs to be converted to 3PM
CHRS is packed (4,0)
wkhrs is zoned(2,0)
wkpmhrs is char(2)
so it seems like
wkhrs = CHRS / 100;
wkpmhrs = %Editc((wkhrs - 12):'4') ;
Would produce ' 3' when CHRS = 1500
wkhrs = CHRS/100 = 15
15-12 = 3
wkpmhrs = %Editc((3):4') should be ' 3'
I must be missing something because debug gives wkpmhrs = *blanks




Comment