|
Hello,
I want my Save 21 tapes are meant to have a label YYMMDD applied without
much manual information. I began to write a CL program like this:
DCL VAR(&TAPDRV) TYPE(*CHAR) LEN(5) VALUE(TAP01)
DCL VAR(&SYSYR) TYPE(*CHAR) LEN(2)
DCL VAR(&SYSMON) TYPE(*CHAR) LEN(2)
DCL VAR(&SYSDAY) TYPE(*CHAR) LEN(2)
DCL VAR(&TAPLBL) TYPE(*CHAR) LEN(6)
RTVSYSVAL SYSVAL(QYEAR) RTNVAR(&SYSYR)
RTVSYSVAL SYSVAL(QMONTH) RTNVAR(&SYSMON)
RTVSYSVAL SYSVAL(QDAY) RTNVAR(&SYSDAY)
CHGVAR VAR(&TAPLBL) VALUE(&SYSYR *CAT &SYSMON *CAT &SYSDAY)
Unfortunately, the system values aren't padded with 0's when single-digit
which creates ambiguity.
I could hard code 18 lines of "if day equals 1 then change variable to be
01", and so on. This seems to be pretty ugly. How would you solve this in
CL(LE)?
Thanks!
:wq! PoC
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.