CL/400
15 pts.
0
Q:
CL/400
I have taken 2 parameters(like date and date types). A. If suppose date type is j,Now i want to convert date to *MDY format B. if date type is M,now i want to convert date to *JUL format C. sending a Program message with the value of converted date.(With use of CVTDAT in cl coding)Please give me with simple coding completly?
ASKED: Sep 17 2008  11:40 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
RELATED QUESTIONS
0
15 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Last Answered: Sep 17 2008  11:40 AM GMT by Thara   15 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

WoodEngineer   2280 pts.  |   Sep 18 2008  3:45PM GMT

Here is a sample of code from an old RPG program we still use that accomplishes what you request. We call it from the CL. It returns the results to the CL program.
This section of code gives you an idea of how this can be done:

C *MDY0 TEST (D) DAT_C6 51 (*IN51 On if date test failed)
C IF NOT *IN51 (Date is in MMDDYY format)
C do something here
C GOTO @TAG01
C ENDIF
*
C *CYMD0 TEST (D) DAT_C7 51 (test for CYYMMDD format without separator)
C IF NOT *IN51 (Date is in CYYMMDD format)
C do something here
C GOTO @TAG01
C ENDIF

C *YMD0 TEST(D) DAT_C6 51 (test of YYMMDD format without separator)
C IF NOT *IN51 (Date is in YYMMDD format)
C do something here
C GOTO @TAG01
C ENDIF

This code makes a lot more sense when its rendered in fixed font. Notice how the various date formats are tested. If the test fails, it tests a different format looking for one that is valid. Just code a date test for every format you think the program will encounter. If all tests fail, its an invalid date.

I warned you . . . this is really old code but it works.
You can do the same thing in free form RPG and it looks a lot better.

 
0