Hi Gurus,
i am working on COBOL to DS conversion project , i am facing problem with generating a code for the cobol code
COMPUTE CLAT-CLMT-DSBLTY-DRTN(WS-CLAT-IDX) =
(FUNCTION INTEGER-OF-DATE (WS-VLTN-DT-YYYYMMDD) -
FUNCTION INTEGER-OF-DATE (WS-ONSETDT-YYYYMMDD) + 1)
/ 30.4375
END-COMPUTE
above two are dates , find the days b/w two dats and the divide by 30.4375
please send me equivalent ds code
equalent datastage transaformer code
Moderators: chulett, rschirm, roy
equalent datastage transaformer code
Venkat Sandu
vsandu.cg@gmail.com
vsandu.cg@gmail.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 34
- Joined: Tue Feb 26, 2013 9:36 am
- Location: Chicago
COMPUTE is a "wrapper" that permits complex arithmetic functions formerly restricted to other COBOL keywords like ADD, SUBTRACT, MULTIPLY, etc. If you want to maintain coding integrity in your conversion, I suggest rewriting the COMPUTE on the older standard.
Convert WS-VLTN-DT-YYYYMMDD and WS-ONSETDT-YYYYMMDD to integers in working storage fields defined for them. How you do that is dependent on what the integer values should look like. Julian dates might work best.
SUBTRACT first ws field FROM the other other ws field GIVING yet another ws field.
ADD 1 TO the last ws field.
Finally: DIVIDE [last ws field] BY 30.4376 GIVING CLAT-CLMT-DSBLTY-DRTN.
You will find it relatively easy to convert each step to a similar coding within the transformer, using stage variables in place of the working storage fields.
Convert WS-VLTN-DT-YYYYMMDD and WS-ONSETDT-YYYYMMDD to integers in working storage fields defined for them. How you do that is dependent on what the integer values should look like. Julian dates might work best.
SUBTRACT first ws field FROM the other other ws field GIVING yet another ws field.
ADD 1 TO the last ws field.
Finally: DIVIDE [last ws field] BY 30.4376 GIVING CLAT-CLMT-DSBLTY-DRTN.
You will find it relatively easy to convert each step to a similar coding within the transformer, using stage variables in place of the working storage fields.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872