MAINFRAME - TIP OF THE DAY :
Q. If there is a situation, where we need to code more than 255 steps in a JOB?
A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.
Programmers Voted for below topics. Please Vote for good Posts.
Thank You! for your feedback. Connecting to the server. Please Wait...
Joined: 27 Mar 2007 Posts: 65 Location: Troy, MI USA
Posted: Thu Dec 27, 2007 2:00 am Post subject:
Unfortunately, what Dick posted is just about as simple as it can get, and makes the assumption that you possess the basic programming skill set to understand the post, and fill in some basic blanks.
There are some other methods to get the same result, but
let?s stick with what Dick posted first.
I do this much like Dick does, and would have the same basic naming structure, however, ?BASIC-TABLE? is not a table, or if you prefer an array......Yet. What it is at this point a list of the month Names. If ?BASIC-TABLE? were to start in memory location 1, then the month name for calendar month 1 ?January? would occupy memory locations 1-10 with 3 training spaces, because it was defined as a field of 10 characters, Calendar month 2 ?February? would occupy memory locations 11-20 with 2 training spaces, and so on for each calendar month name. You cannot access the month names with subscript yet.
The next statement ?MONTH-TAB REDEFINES BASIC-TABLE? redefines the same memory locations as ?BASIC-TABLE? occupies, with a different structure, this time as a table with the each table item called ?MONTH-ITEM? and a variable length of 10 bytes.. So now, using subscripts, calendar month 1 ?MONTH-ITEM(1)? occupying memory locations 1-10 would contain ?JANUARY...? with the ?.? representing spaces, and MONTH-ITEM(5) occupying memory locations 51-60 containing ?MAY.......?.
Now the next statement defines areas for your input date and the new formatted date. First is your ?INPUT-DATE?, you shouldn?t have any problems with that. And the formatted ?OUTPUT-DATE?. Since you specifically asked about how to convert the MM (Month) to it?s literal name, the assumption was that you knew how to do the rest.
?MOVE INPUT-YEAR to OUTPUT-YEAR?
?MOVE INPUT-DAY to OUTPUT-DAY?
and move the month literal name to the output format.
?MOVE MONTH-ITEM(INPUT-MONTH) TO OUTPUT-MONTH? where table item
?MONTH-ITEM? for month 4 occupying memory locations 41-50 would contain ?APRIL.....?
And, now, the total formatter date would be ?APRIL.....08,2004?.
If you want the day portion of the date to float one space after the literal month name there is another whole level of complexity that needs to be added.
Another way of converting would not use the table method, but would still require the INPUT-DATE, OUTPUT-DATE, and the moves of the Year and Day.
WHEN 1 MOVE ?JANUARY? to OUTPUT-MONTH
WHEN 2 MOVE ?FERBUARY? to OUTPUT-MONTH
WHEN 3 MOVE ?MARCH? to OUTPUT-MONTH
WHEN 12 MOVE ?DECEMBER? to OUTPUT-MONTH
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum