Skip to main content
Aug 19, 2021 8:30 AM UTC
Question

UniVerse DATA statement allows the at variable @DATA but does not allow @TIME. What at variables are allowed?

All,

I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
'@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

Jon​​

    5 replies

    Shawn Waldie
    Aug 19, 2021 12:46 PM UTC
    All,

    I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
    '@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

    Jon​​
    I don't know Universe, so I don't know the answer to your specific question.

    I don't even know if it will work in Unidata, but something like this may be a possible solution:
    SELECT AnyFile SAMPLE 1 SAVING EVAL "'C:TEMPFILE':@DATE:@TIME:'.TXT'"
    SAVE.LIST SL.REC
    .
    .
    .
    DATA <<F(SAVEDLISTS,SL.REC000,1)>>
    Aug 20, 2021 8:36 AM UTC
    All,

    I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
    '@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

    Jon​​
    Shawn,

    Thanks! It does work in UniVerse. I'm still curious what at-variables are allowed/evaluated in a DATA statement.​
    Neil Morris
    Rocketeer
    Aug 20, 2021 8:55 AM UTC
    All,

    I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
    '@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

    Jon​​
    Jon,
    Do you have a specific example of @DATE being interpreted in a DATA statement?
    I just ran a simple test and whatever I put in the DATA statement such as @DATE or @TIME was being picked up literally.
    I can do some research but was curious how you got @DATE to work.
    Thanks,
    Neil
    ​​​​
    Aug 20, 2021 9:06 AM UTC
    All,

    I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
    '@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

    Jon​​
    Neil,

    My bad! It appears the program I was running changes the '@DATE' in the code. 

    Jon
    Neil Morris
    Rocketeer
    Aug 20, 2021 3:10 PM UTC
    All,

    I have a PAragraph that runs a program and feeds data into it using the DATA statement to provide input. One of my DATA statements has a pathname with an
    '@DATE' in it. I.E. C:TEMPFILE@DATE.TXT. I tried C:TEMPFILE@DATA@TIME.TXT, the pathname had the current date but the '@TIME' was just '@TIME'. The documentation was pretty thin on this topic. What at variables are allowed in a DATA statement?

    Jon​​
    Hi Jon,
    Thanks for that update. As best as I can tell (without further research), the text supplied in a DATA statement is passed literally to the input statement.
    I don't think any @variables are translated as part of a DATA statement.
    Does that give you what you need?
    Thanks,
    Neil
    ​