AutoSys Workload Automation

 View Only
  • 1.  Converting JIL to MS Excel format

    Posted Aug 25, 2023 12:32 PM

    I know I am probably not the first to ask this but I need to be able to convert jil file to excel format in column basis so that I can use the data for analysis on a project I am doing.  Thank you



  • 2.  RE: Converting JIL to MS Excel format

    Broadcom Employee
    Posted Aug 26, 2023 09:09 AM

    Hi Michael,

    I would first ask you what fields you are looking for?  Depending on the job types that you use, the number of columns could be quite large and that would be a bit tedious getting to the right column position.  If you are only looking for the common properties, say job name, machine and some run time info like run calendars. I would suggest using the SDK.  It's fairly easy to use and has examples to get you started.  There is a Java and C++ versions available.  Towards the middle of this links page it has the instructions on how to launch the SDK reference guide.

    I have a personal preference towards the Java since it works for any OS, but that is personal choice.  Here is a sample I lifted from the Java doc to get certain fields from all jobs:

     private void sample(AsApi appServer) {
         GetJobsWithFilterReq req = new GetJobsWithFilterReq();
         JobFilterString filter = 
             new JobFilterString(IJobFilterString.FLT_JOB_NAME, "sample%");
         int[] attributes = {
                 GetJobsWithFilterReq.ATTR_JOB_NAME,
                 GetJobsWithFilterReq.ATTR_APPLICATION,
                 GetJobsWithFilterReq.ATTR_JOB_TYPE,
                 GetJobsWithFilterReq.ATTR_GROUP
         };
         req.setRequest(filter, attributes);
     
         try {
             ApiResponseSet rspSet = (ApiResponseSet)req.execute(appServer);
     
             while(rspSet.hasNext()) {
                 System.out.println("----- Begin Response ----");
                 GetJobsWithFilterRsp rsp = (GetJobsWithFilterRsp)rspSet.next();
                 int[] rspAttributes = rsp.getAttributes();
                 String name, output;
     
                 for(int i=0; i<rspAttributes.length; i++) {
                     int type = rsp.getAttributeType(rspAttributes[i]);
                     switch(type) {
                         case IFilterRsp.TYPE_INT:
                             name = rsp.getAttributeName(rspAttributes[i]);
                             output = name + " = " + rsp.getInt(rspAttributes[i]);
                             System.out.println(output);
                             break;
                         case IFilterRsp.TYPE_STRING:
                             name = rsp.getAttributeName(rspAttributes[i]);
                             output = name + " = " + rsp.getString(rspAttributes[i]);
                             System.out.println(output);
                             break;
                         case IFilterRsp.TYPE_DATE:
                             name = rsp.getAttributeName(rspAttributes[i]);
                             output = name + " = " + Tools.getStringFromDate(rsp.getDate(rspAttributes[i]));
                             System.out.println(output);
                             break;
                         case IFilterRsp.TYPE_CHAR:
                             name = rsp.getAttributeName(rspAttributes[i]);
                             output = name + " = " + rsp.getChar(rspAttributes[i]);
                             System.out.println(output);
                             break;                          
                     }
                 }
                 System.out.println("-----  End Response  ----\n");
             }
         } catch (AsGeneralErrorException genEx) {
             System.out.println("AsGeneralErrorException: " + genEx.getMessage());
         } catch (AsNoAttributesException noAttrEx) {
             System.out.println("AsNoAttributesException: " + noAttrEx.getMessage());
         } catch (AsBadAttributesException badAttrEx) {
             System.out.println("AsBadAttributesException: " + badAttrEx.getMessage());
         } catch (AsBadFilterFieldsException badFiltEx) {
             System.out.println("AsBadFilterFieldsException: " + badFiltEx.getMessage());
         } catch (AsException ex) {
             System.out.println("AsException: " + ex.getMessage());
         }
     }

    There are many more attributes you can pull as well. They come out in the order in the attributes you request.

    Regards,
    Mike



  • 3.  RE: Converting JIL to MS Excel format

    Posted Aug 26, 2023 12:19 PM

    I purchased a license for "JIL File Parser" from "New Software Source". You can convert a jil file to a .csv and then to .xlsx. You can edit the jils in the .csv file and convert it back to a .txt file. It is a great tool. 




  • 4.  RE: Converting JIL to MS Excel format

    Broadcom Employee
    Posted Aug 28, 2023 03:16 AM

    As an Autosys implementation consultant, I frequently had to do the exact reverse of your scenario in this question, i.e. from Excel to JIL conversion, I used Microsoft word's mail merge feature, where in excel spreadsheet was the data source to provide all inputs to the templated JIL and that way on a click of a button I'd create multiple hundreds of job definitions, I would then copy paste it in a text editor and save it as .jil

    PS: Not an exact answer to your question however if this may give an idea. Cheers!