Automic Workload Automation

  • 1.  what is the best way to sort a list in automic?

    Posted Sep 03, 2018 08:26 AM

    I process a list of files, where the the order is somewhat arbitrary...

    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-111143.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-122143.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-123123.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-193153.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-023142.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-123143.xml
    /upload/outgoing/BANK_IBT_CH9995723218_2018-08-22-123127.xml

    :  set &FILELIST_CNT# = 0
    :  set &HND# = prep_process_report(,&RID#,'REP','/*')
    :  process &HND#
    :    set &FILE# = get_process_line(&HND#)
    :    set &TMP_POS# = str_find_rev(&FILE#,'/')
    :    set &TMP_POS# = &TMP_POS# + 1
    :    set &FILE# = STR_CUT(&FILE#,&TMP_POS#)
    :    set &FILE# = str_trim(&FILE#)
    :    print "FILE: &FILE#"
    :  endprocess
    :  close_process &HND#

    what is the best way, to sort them as ascending (like the unix command (sort -f) in Automic.

    I would like to process this sorted list...



  • 2.  Re: what is the best way to sort a list in automic?
    Best Answer

    Posted Sep 03, 2018 02:53 PM

    Hi

    I am afraid the salutation is missing :-)

     

    you can do a PUT_VAR into a static VARA (define your favorite sort order in the VARA's attributes) with all file names.

    Optional you can store the path in an additional Column.

    afterwards you can do a PREP_PROCESS_VAR and you have your required sort order.

     

    If you have access to the files via agent, I would recommend using PREP_PROCESS + OS command (like sort xyz in unix) that conusmes less performance ..

     

    cheers, Wolfgang