Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Control Language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Sample code== The following is a sample of CL programming. The program interactively converts dates from Julian to MDY and vice versa. Results are displayed on line 24 of the terminal. It accepts two parameters. The <code>&IN</code> parameter which is the date string to be converted. If a Julian string it should be in the format YYNNN where YY is the year number and NNN is the day number of the year. If a MDY string it must be in the format MMDDYY. The second parameter is <code>&TYP</code> which is the type of date to be converted to. It must be 'J' (Julian) or 'M' (MDY). For example: the command <code>CALL PGM(ICVTDATC) PARM('04180' 'M')</code> will convert the Julian date 04180 to 062804 (June 28, 2004). <pre> PGM (&IN &TYP) DCL &IN *CHAR 6 DCL &OUT *CHAR 8 DCL &TYP *CHAR 1 IF (&TYP = J) + DO CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*MDY) + TOFMT(*JUL) TOSEP(*NONE) ENDDO ELSE IF (&TYP = M) + DO CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*JUL) + TOFMT(*MDY) TOSEP(*NONE) ENDDO SNDPGMMSG MSG('IN=' || &IN || ' OUT=' || &OUT) + MSGTYPE(*COMP) ENDPGM </pre>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)