* :--------------------------------------- * ------------------------: Copybook for API-UPPERCASE * : API-LOWERCASE * : See the documentation for details. * :--------------------------------------- * : NOTE: The conversion is locale * : sensitive, and converts according to * : the locale alphabet settings as set * : up in the Windows Control panel. * : Therefore, it properly handles non * : english alphabets. * : * : Client/Server: This API normally runs * : on the client, which means data will * : be sent to the client for conversion. * : * : If the Client has a different language * : than the server, the data will be * : converted according to the client's * : launguage settings. * : * NOTE >>>>>>> : Sending small amounts of data to the * : client can be expensive in terms of * : performance, so if language is not * : an issue, select the option to run * : the api on the server: * : SET WIN32API-EXECUTE-API-ON-SERVER * : TO TRUE. * To use: * * COPY WIN32API. * COPY GSUPLOW. * . * . * : Set the length of data you want to * : force to upper or lower case * SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE * MOVE LENGTH OF ws-my-data-field to GSUL-DATA-LENGTH * MOVE ws-my-data-field TO GSUL-DATA-TO-CONVERT * * ------------------------: Call the API to get the directory. * * SET API-UPPERCASE TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * GSUL-DATA-LENGTH * GSUL-DATA-TO-CONVERT * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : do what ever.... * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to is necessary * ELSE * MOVE GSUL-DATA-TO-CONVERT TO ws-my-data-field * * * * ---------------------------------------------------------------- * SPECIAL NOTE: * 1) This routine converts the data in place, and will change * what ever data appears in the second argument. * * 2) If you need a longer data element than is in this copybook * you may substitute any data element for the second argument * in the call statement. * * Example: * CALL 'GSWINAPI' USING WIN32API-PARMS * GSUL-DATA-LENGTH * ws-my-data-field <<< your data * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * This will change the content of ws-my-data-field. There is * only one field, not an input and output field, so you are * responsible to make sure you have a backup if needed. * * The LENGTH IS IMPORTANT, because if you fail to set the length * properly, the conversion performed may include following * fields, and may cause data corruption. * * This API calls the windows native apis, and they are rather * dumb, and will blindly convert data high-values to x'9F' and * other oddities. * * * ---------------------------------------------------------------- 01 GSUL-DATA-LENGTH PIC S9(9) COMP-5. 01 GSUL-DATA-TO-CONVERT PIC X(500).