Qshell LS command is thnks is last year - IBM AS400

This is a discussion on Qshell LS command is thnks is last year - IBM AS400 ; Hi. I am using the Qshell command QSH CMD('LS -lt QOPENSYS/UKHSDS > + /QSYS.LIB/DATA3SC.LIB/QSOUT.FILE/QSOUT.MBR') to extract a list of files in a folder. I then read through the file and work out the change date, using the rule that if ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Qshell LS command is thnks is last year

  1. Qshell LS command is thnks is last year

    Hi.

    I am using the Qshell command
    QSH CMD('LS -lt QOPENSYS/UKHSDS > +
    /QSYS.LIB/DATA3SC.LIB/QSOUT.FILE/QSOUT.MBR')

    to extract a list of files in a folder. I then read through the file
    and work out the change date, using the rule that if it shows the time
    the file was created in the current year, otherwise use the year as
    displayed.

    Ran it today and the listing is showing the time format for files
    created in 2006.

    Oct 27 10:04 93E1039.pdf
    Oct 27 10:03 93L20.pdf
    Oct 27 10:03 93E1001.pdf
    Oct 27 10:03 V3758.pdf

    This system data/time are set correctly to 2007. so the above should
    be showing 2006 not the time.

    Any thoughts.

    regards Ivan


  2. Re: Qshell LS command is thnks is last year

    Ivan wrote:
    > Hi.
    >
    > I am using the Qshell command
    > QSH CMD('LS -lt QOPENSYS/UKHSDS > +
    > /QSYS.LIB/DATA3SC.LIB/QSOUT.FILE/QSOUT.MBR')
    >
    > to extract a list of files in a folder. I then read through the file
    > and work out the change date, using the rule that if it shows the time
    > the file was created in the current year, otherwise use the year as
    > displayed.
    >
    > Ran it today and the listing is showing the time format for files
    > created in 2006.
    >
    > Oct 27 10:04 93E1039.pdf
    > Oct 27 10:03 93L20.pdf
    > Oct 27 10:03 93E1001.pdf
    > Oct 27 10:03 V3758.pdf
    >
    > This system data/time are set correctly to 2007. so the above should
    > be showing 2006 not the time.
    >
    > Any thoughts.

    It's working as designed. According to
    http://publib.boulder.ibm.com/iserie...o/rzahz/ls.htm

    If the file was modified within six months of the current date, the time
    is displayed as the abbreviated month, day-of-month, hour, and minute.
    Otherwise the time is displayed as the abbreviated month, day-of-month,
    and four-digit year.

    Use 'ls -ltT' if you always want 4-digits year being displayed.
    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

+ Reply to Thread