20 pts.
 CL/400
can any body give me answer to this question please? please give me code in cl with the folling specifications. 1.Accept 2 parameters-date and date type 2.If date type is J then convert date to *MDY format 3.If date type is M convert date to *JUL format 4. Send a program message with the value of converted date? Please give me the answer.Because im practicing in my house.Im taking trining on AS/400.

Software/Hardware used:
ASKED: November 10, 2008  5:36 AM
UPDATED: November 11, 2008  6:41 AM

Answer Wiki:
Hi Venkat, Here i am providing you the Cl code for the question you asked but from format i think we should give in specific format thats why i kept from format as *mdy for julian and *jul for *mdy i hope it helps to you if you still have any issues please feel free to ask 0001.00 PGM PARM(&DATE &DATETYP) 0002.00 DCL VAR(&DATE) TYPE(*CHAR) LEN(10) 0003.00 DCL VAR(&DATETYP) TYPE(*CHAR) LEN(1) 0004.00 DCL VAR(&newdate) TYPE(*CHAR) LEN(08) 0005.00 0006.00 IF COND(&DATETYP *EQ 'J') THEN(DO) 0007.00 CVTDAT DATE(&DATE) TOVAR(&NEWDATE) FROMFMT(*MDY) + 0008.00 TOFMT(*JUL) TOSEP(/) 0009.00 SNDPGMMSG MSG(&newdate) 0010.00 Enddo 0011.00 0012.00 IF COND(&DATETYP *EQ 'M') THEN(DO) 0013.00 CVTDAT DATE(&DATE) TOVAR(&NEWDATE) FROMFMT(*JUL) + 0014.00 TOFMT(*MDY) TOSEP(/) 0015.00 SNDPGMMSG MSG(&newdate) 0016.00 Enddo 0017.00 ENDPGM Example outputs: 1.For date conversion from *mdy to *jul Input = '08359' Output = '12/24/08' 2.For date conversion from *mdy to *jul Input = '122408' Output = ''08359' Thanks, Mohan K
Last Wiki Answer Submitted:  November 10, 2008  8:19 am  by  Mohan K   695 pts.
All Answer Wiki Contributors:  Mohan K   695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

As400venkatm if you’re taking training, as you say, then you should be coming up with the answers yourself. Please do not post any more requests for complete answers. If you run into a problem, then post the code and ask someone to help point out where you’re stuck. Do your own homework and ask for help when you’ve run into a problem. Thanks for your cooperation.

 6,565 pts.

 

you are right mr BrentSheets we should ask questions when we stuck up and no way to move ahead

 695 pts.