F$FAO question - VMS

This is a discussion on F$FAO question - VMS ; HAFNER> echo f$fao("!5AS","5") 5 This left-justifies the output. Now looking at the HELP description I see !n None Left-justifies and blank-fills all data represented by the instructions . . . in fields n characters wide. isn't this superfluous? I ask ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: F$FAO question

  1. F$FAO question

    HAFNER> echo f$fao("!5AS","5")
    5

    This left-justifies the output. Now looking at the HELP description I see

    !n<...!> None Left-justifies and blank-fills all data
    represented by the instructions . . . in
    fields n characters wide.
    isn't this superfluous? I ask because what I really wanted was
    right-justified.

    Too bad we don't have Rexx on VMS.
    --
    PL/I for OpenVMS
    www.kednos.com

  2. Re: F$FAO question

    In article , "Tom Linden" writes:
    >
    >
    >HAFNER> echo f$fao("!5AS","5")
    >5
    >
    >This left-justifies the output. Now looking at the HELP description I see
    >
    > !n<...!> None Left-justifies and blank-fills all data
    > represented by the instructions . . . in
    > fields n characters wide.
    >isn't this superfluous? I ask because what I really wanted was
    >right-justified.


    Are you wanting to do this is DCL???

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    "Well my son, life is like a beanstalk, isn't it?"

    http://tmesis.com/drat.html

  3. Re: F$FAO question

    In article , "Tom Linden" writes:
    >
    >
    >HAFNER> echo f$fao("!5AS","5")
    >5
    >
    >This left-justifies the output. Now looking at the HELP description I see
    >
    > !n<...!> None Left-justifies and blank-fills all data
    > represented by the instructions . . . in
    > fields n characters wide.
    >isn't this superfluous? I ask because what I really wanted was
    >right-justified.


    It depends on whether or not you are formatting an ascii format or
    a numerical format.

    If _*you*_ want, take a look here:

    http://www.tmesis.com/SYMBOL/Using/RIGHT_JUSTIFY.COM

    You can right justify an ascii format but it requires a little more
    than just the F$fao.

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    "Well my son, life is like a beanstalk, isn't it?"

    http://tmesis.com/drat.html

  4. Re: F$FAO question

    On Fri, 03 Aug 2007 13:39:57 -0700, VAXman- <@SendSpamHere.ORG> wrote:

    > In article , "Tom Linden"
    > writes:
    >>
    >>
    >> HAFNER> echo f$fao("!5AS","5")
    >> 5
    >>
    >> This left-justifies the output. Now looking at the HELP description I
    >> see
    >>
    >> !n<...!> None Left-justifies and blank-fills all
    >> data
    >> represented by the instructions . . .
    >> in
    >> fields n characters wide.
    >> isn't this superfluous? I ask because what I really wanted was
    >> right-justified.

    >
    > It depends on whether or not you are formatting an ascii format or
    > a numerical format.
    >
    > If _*you*_ want, take a look here:
    >
    > http://www.tmesis.com/SYMBOL/Using/RIGHT_JUSTIFY.COM
    >
    > You can right justify an ascii format but it requires a little more
    > than just the F$fao.
    >

    Thanks, Brian. I still understand the purpose of the !n<...!> since that
    is
    what it does anyway.



    --
    PL/I for OpenVMS
    www.kednos.com

  5. Re: F$FAO question

    On Aug 3, 7:24 pm, "Tom Linden" wrote:
    > HAFNER> echo f$fao("!5AS","5")
    > 5
    >
    > This left-justifies the output. Now looking at the HELP description I see
    >
    > !n<...!> None Left-justifies and blank-fills all data
    > represented by the instructions . . . in
    > fields n characters wide.
    > isn't this superfluous? I ask because what I really wanted was
    > right-justified.


    No it is not superfluous, the !n<...,!> is much more powerful than
    just setting a value to 'n' in !nAS. You can stick a whole bunch of
    directives between the !n< and the !>, not just one. Here is a very
    simple example of using it, that I extracted from one of my
    procedures:

    $ write sys$output f$fao("!20!AS","AUTO_ACTION",f
    $getenv("AUTO_ACTION"))

    - I don't believe you could do this without the '!n< !>' construct.

    >
    > Too bad we don't have Rexx on VMS.
    > --
    > PL/I for OpenVMSwww.kednos.com


    Never heard of Rexx, (heard of PL/1 tho!)

    - Cheers, John


  6. Re: F$FAO question

    Big John schrieb:

    >> Too bad we don't have Rexx on VMS.
    >> --
    >> PL/I for OpenVMSwww.kednos.com

    >
    > Never heard of Rexx, (heard of PL/1 tho!)


    REXX (REstructured eXtended eXecutor) - a script language developed by
    IBM - mostly for mainframe use - but also available for OS/2, Linux,
    MS-Windows. For details see here:

    http://en.wikipedia.org/wiki/Rexx

    From the syntax quite similar to DCL (Influenced by: PL/I, EXEC 2,
    BASIC) - but still actively developed and extended - and with all the
    features I miss in DCL.

    Martin
    --
    mailto://krischik@users.sourceforge.net
    Ada programming at: http://ada.krischik.com

  7. Suggestion: F$FAO question

    On Fri, 03 Aug 2007 11:24:12 -0700, Tom Linden wrote:

    > HAFNER> echo f$fao("!5AS","5")
    > 5
    >
    > This left-justifies the output. Now looking at the HELP description I
    > see
    >
    > !n<...!> None Left-justifies and blank-fills all
    > data
    > represented by the instructions . . .
    > in
    > fields n characters wide.
    > isn't this superfluous? I ask because what I really wanted was
    > right-justified.
    >
    > Too bad we don't have Rexx on VMS.


    I think that this !nAS directive should be extended as follows
    !nASL same as !nAS
    !nASR right justifies



    --
    PL/I for OpenVMS
    www.kednos.com

  8. Re: Suggestion: F$FAO question

    Tom Linden wrote:
    >
    > On Fri, 03 Aug 2007 11:24:12 -0700, Tom Linden wrote:
    >
    > > HAFNER> echo f$fao("!5AS","5")
    > > 5
    > >
    > > This left-justifies the output. Now looking at the HELP description I
    > > see
    > >
    > > !n<...!> None Left-justifies and blank-fills all
    > > data
    > > represented by the instructions . . .
    > > in
    > > fields n characters wide.
    > > isn't this superfluous? I ask because what I really wanted was
    > > right-justified.
    > >
    > > Too bad we don't have Rexx on VMS.

    >
    > I think that this !nAS directive should be extended as follows
    > !nASL same as !nAS
    > !nASR right justifies


    I'd suggest these instead:

    ![n]AL ASCII text, left justified (same as ![n]AS)
    ![n]AR ASCII text, right justified

    ....rather than try to accomodate inconsistencies in the operator length.

    --
    David J Dachtera
    dba DJE Systems
    http://www.djesys.com/

    Unofficial OpenVMS Marketing Home Page
    http://www.djesys.com/vms/market/

    Unofficial Affordable OpenVMS Home Page:
    http://www.djesys.com/vms/soho/

    Unofficial OpenVMS-IA32 Home Page:
    http://www.djesys.com/vms/ia32/

    Unofficial OpenVMS Hobbyist Support Page:
    http://www.djesys.com/vms/support/

  9. Re: Suggestion: F$FAO question

    On Aug 6, 9:43 pm, "Tom Linden" wrote:
    > On Fri, 03 Aug 2007 11:24:12 -0700, Tom Linden wrote:
    > > I ask because what I really wanted was right-justified.

    >
    > > Too bad we don't have Rexx on VMS.


    the c- printf formatting available through perl and awk will often do
    just fine.

    > I think that this !nAS directive should be extended as follows
    > !nASL same as !nAS
    > !nASR right justifies


    You know better...
    That would break all existing programs where the text "L" or "R"
    follows an !AS.

    With a wink to printf, I'd like !-nAS, but that would also break
    legal albeit useless constructs like: $ write sys$output f$fao("!AS!-
    AS!AS","xx")
    xxASxx
    So I would have to suggest a generic - or R modifier to !n
    To be applicable to AS, AD as well as <.
    For example F$FAO("!10-AS : !AS",name,value)
    Runner up: !nRAS

    fwiw,
    Hein.




    > --
    > PL/I for OpenVMSwww.kednos.com- Hide quoted text -
    >
    > - Show quoted text -




  10. Re: F$FAO question

    In article , VAXman- @SendSpamHere.ORG writes:
    >
    > You can right justify an ascii format but it requires a little more
    > than just the F$fao.


    Without following your link, this admittedly rather ugly approach comes to mind:

    $ write sys$output f$fao("!''f$int(12-f$len("Stuff"))'* !AS","Stuff")

    Longer, but cleaner:

    $ s="Stuff"
    $ n=12-f$len(s)
    $ if n.lt.0 then n=0 ! Negative n is a no-no
    $ write sys$output f$fao("!''n'* !AS",s)

    > --
    > VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM


    --
    George Cornelius cornelius(at)eisner.decus.org
    cornelius(at)mayo.edu

  11. Re: Suggestion: F$FAO question

    Tom Linden wrote:
    >
    > On Fri, 03 Aug 2007 11:24:12 -0700, Tom Linden wrote:
    >
    > > HAFNER> echo f$fao("!5AS","5")
    > > 5
    > >
    > > This left-justifies the output. Now looking at the HELP description I
    > > see
    > >
    > > !n<...!> None Left-justifies and blank-fills all
    > > data
    > > represented by the instructions . . .
    > > in
    > > fields n characters wide.
    > > isn't this superfluous? I ask because what I really wanted was
    > > right-justified.
    > >
    > > Too bad we don't have Rexx on VMS.

    >
    > I think that this !nAS directive should be extended as follows
    > !nASL same as !nAS
    > !nASR right justifies


    I'd suggest these instead:

    ![n]AL ASCII text, left justified (same as ![n]AS)
    ![n]AR ASCII text, right justified

    ....rather than try to accomodate inconsistencies in the operator length.

    --
    David J Dachtera
    dba DJE Systems
    http://www.djesys.com/

    Unofficial OpenVMS Marketing Home Page
    http://www.djesys.com/vms/market/

    Unofficial Affordable OpenVMS Home Page:
    http://www.djesys.com/vms/soho/

    Unofficial OpenVMS-IA32 Home Page:
    http://www.djesys.com/vms/ia32/

    Unofficial OpenVMS Hobbyist Support Page:
    http://www.djesys.com/vms/support/

+ Reply to Thread