FW: Passing large number of arguments to a program - VMS

This is a discussion on FW: Passing large number of arguments to a program - VMS ; One of my programmers wrote a program that receives a huge (embarassingly huge) number of arguments. The program is run through a DCL jacket procedure that develops the arguments and calls the program. If the number of arguments exceeds 143, ...

+ Reply to Thread
Results 1 to 20 of 20

Thread: FW: Passing large number of arguments to a program

  1. FW: Passing large number of arguments to a program

    One of my programmers wrote a program that receives a huge (embarassingly huge) number of arguments.

    The program is run through a DCL jacket procedure that develops the arguments and calls the program.



    If the number of arguments exceeds 143, not the leading argument, but the following leading arguments get clobbered.

    (When 144 arguments are used, arguments 2 and 3 get clobbered.)



    The program below is a stub program that shows this condition. There are 4 runs shown here. One for 143 arguments where all is fine, and one each for 144, 156, and 170 arguments where an increasing number of the leading arguments starting with argument 1 gets clobbered. (Note that if you run this you can always see that "varg[0]" is correct, always showing the exact version of the program name being executed.)



    Yes, passing a ridiculous number of arguments does bring new meaning to the expression "quick and dirty programming". And yes, there is a better way to do it, and yes, that change is being made now.



    But, what went on here? Is DCL involved in this problem? Can someone explain what could be involved?



    We are running "HP C V7.1-015 on OpenVMS Alpha V8.3". The original program was linked with a "STACK=200" command in the link options file but I'm not sure if this.



    Any insight will be greatly appreciated.



    Thanks



    Mike



    Mike Farrell

    VoltDelta Resources, LLC





    G> cc test_args.c ! Std "cc" command

    G> link test_args ! Std "link" command





    Directory $1$DKA100:[XXXX]



    TEST_ARGS.C;4 0.50KB/34KB 3-DEC-2007 10:59:41.99

    TEST_ARGS.COM;3 1KB/34KB 3-DEC-2007 11:11:17.58

    TEST_ARGS.EXE;4 3KB/34KB 3-DEC-2007 10:59:45.10

    TEST_ARGS.OBJ;4 2KB/34KB 3-DEC-2007 10:59:43.69



    Total of 4 files, 7KB/138KB

    G>









    G> ty TEST_ARGS.COM

    $! TEST_ARGS.COM

    $! -------------

    $! P1 - number of command line arguments to test

    $!

    $! This test procedure will generate requested number of command line arguments as "1 2 3 ...", and

    $! will attempt to run TEST_ARGS.EXE program while passing all those arguments. The program will attempt

    $! to simply print the list of command line arguments.

    $!

    $ if (f$type(P1) .nes. "INTEGER") then exit 4

    $!

    $ n = 0

    $ args = ""

    $ max = P1

    $LOOP:

    $ n = n + 1

    $ if (n .gt. max) then goto FINISH

    $ args = args + " ''n'"

    $ goto LOOP

    $FINISH:

    $!

    $ prog := $ $1$DKA100:[IGOR.SPB2ASC.REL_058]TEST_ARGS.EXE

    $ set verify

    $ prog 'args'

    $ set noverify

    $ exit

    G>







    G> type TEST_ARGS.c

    #include



    main(int narg, char *varg[]) {



    int n;



    for (n = 0; n < narg; n++) printf(" Arg %d: %s;", n, varg[n]);

    }

    G>









    G> @test_args 143

    $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

    38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

    75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 10

    8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

    136 137 138 139 140 141 142 143

    Arg 0: $1$dka100:[XXXX]test_args.exe;4; Arg 1: 1; Arg 2: 2; Arg 3: 3; Arg 4: 4; Arg 5:

    5; Arg 6: 6; Arg 7: 7; Arg 8: 8; Arg 9: 9; Arg 10: 10; Arg 11: 11; Arg 12: 12; Arg 13: 13; Arg 14: 14

    ; Arg 15: 15; Arg 16: 16; Arg 17: 17; Arg 18: 18; Arg 19: 19; Arg 20: 20; Arg 21: 21; Arg 22: 22; Arg

    23: 23; Arg 24: 24; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28: 28; Arg 29: 29; Arg 30: 30; Arg 31: 3

    1; Arg 32: 32; Arg 33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg 37: 37; Arg 38: 38; Arg 39: 39; Ar

    g 40: 40; Arg 41: 41; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg 47: 47; Arg 48:

    48; Arg 49: 49; Arg 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55: 55; Arg 56: 56; A

    rg 57: 57; Arg 58: 58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63; Arg 64: 64; Arg 65:

    65; Arg 66: 66; Arg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72: 72; Arg 73: 73;

    Arg 74: 74; Arg 75: 75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80; Arg 81: 81; Arg 82

    : 82; Arg 83: 83; Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89: 89; Arg 90: 90;

    Arg 91: 91; Arg 92: 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97; Arg 98: 98; Arg 9

    9: 99; Arg 100: 100; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg 104: 104; Arg 105: 105; Arg 106: 106

    ; Arg 107: 107; Arg 108: 108; Arg 109: 109; Arg 110: 110; Arg 111: 111; Arg 112: 112; Arg 113: 113; Ar

    g 114: 114; Arg 115: 115; Arg 116: 116; Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg 120: 120; Arg 121

    : 121; Arg 122: 122; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg 126: 126; Arg 127: 127; Arg 128: 128

    ; Arg 129: 129; Arg 130: 130; Arg 131: 131; Arg 132: 132; Arg 133: 133; Arg 134: 134; Arg 135: 135; Ar

    g 136: 136; Arg 137: 137; Arg 138: 138; Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg 142: 142; Arg 143

    : 143;

    $ set noverify

    G>

    G>

    G> @test_args 144

    $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

    38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

    75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 10

    8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

    136 137 138 139 140 141 142 143 144

    Arg 0: $1$dka100:[XXXX]test_args.exe;4; Arg 1: D; Arg 2: ; Arg 3: 3; Arg 4: 4; Arg 5: 5

    ; Arg 6: 6; Arg 7: 7; Arg 8: 8; Arg 9: 9; Arg 10: 10; Arg 11: 11; Arg 12: 12; Arg 13: 13; Arg 14: 14;

    Arg 15: 15; Arg 16: 16; Arg 17: 17; Arg 18: 18; Arg 19: 19; Arg 20: 20; Arg 21: 21; Arg 22: 22; Arg

    23: 23; Arg 24: 24; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28: 28; Arg 29: 29; Arg 30: 30; Arg 31: 31

    ; Arg 32: 32; Arg 33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg 37: 37; Arg 38: 38; Arg 39: 39; Arg

    40: 40; Arg 41: 41; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg 47: 47; Arg 48: 4

    8; Arg 49: 49; Arg 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55: 55; Arg 56: 56; Ar

    g 57: 57; Arg 58: 58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63; Arg 64: 64; Arg 65:

    65; Arg 66: 66; Arg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72: 72; Arg 73: 73; A

    rg 74: 74; Arg 75: 75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80; Arg 81: 81; Arg 82:

    82; Arg 83: 83; Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89: 89; Arg 90: 90;

    Arg 91: 91; Arg 92: 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97; Arg 98: 98; Arg 99

    : 99; Arg 100: 100; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg 104: 104; Arg 105: 105; Arg 106: 106;

    Arg 107: 107; Arg 108: 108; Arg 109: 109; Arg 110: 110; Arg 111: 111; Arg 112: 112; Arg 113: 113; Arg

    114: 114; Arg 115: 115; Arg 116: 116; Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg 120: 120; Arg 121:

    121; Arg 122: 122; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg 126: 126; Arg 127: 127; Arg 128: 128;

    Arg 129: 129; Arg 130: 130; Arg 131: 131; Arg 132: 132; Arg 133: 133; Arg 134: 134; Arg 135: 135; Arg

    136: 136; Arg 137: 137; Arg 138: 138; Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg 142: 142; Arg 143:

    143; Arg 144: 144;

    $ set noverify

    G>

    G>

    G> @test_args 156

    $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

    38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

    75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 10

    8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

    136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156

    Arg 0: $1$dka100:[XXXX]test_args.exe;4; Arg 1: D; Arg 2: ; Arg 3:

    D; Arg 4: ; Arg 5: D;

    Arg 6: ; Arg 7: D; Arg 8: ; Arg 9: D; Arg 13: ; Arg 14: ; Arg 15: D

    ; Arg 16: D; Arg 17: ; Arg 18: ; Arg 19: D; Arg 20: D; Arg 21: ; Arg 22: 22; Arg 23: 23; Arg 24: 24

    ; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28: 28; Arg 29: 29; Arg 30: 30; Arg 31: 31; Arg 32: 32; Arg

    33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg 37: 37; Arg 38: 38; Arg 39: 39; Arg 40: 40; Arg 41: 4

    1; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg 47: 47; Arg 48: 48; Arg 49: 49; Ar

    g 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55: 55; Arg 56: 56; Arg 57: 57; Arg 58:

    58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63; Arg 64: 64; Arg 65: 65; Arg 66: 66; A

    rg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72: 72; Arg 73: 73; Arg 74: 74; Arg 75:

    75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80; Arg 81: 81; Arg 82: 82; Arg 83: 83;

    Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89: 89; Arg 90: 90; Arg 91: 91; Arg 92

    : 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97; Arg 98: 98; Arg 99: 99; Arg 100: 100

    ; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg 104: 104; Arg 105: 105; Arg 106: 106; Arg 107: 107; Ar

    g 108: 108; Arg 109: 109; Arg 110: 110; Arg 111: 111; Arg 112: 112; Arg 113: 113; Arg 114: 114; Arg 115

    : 115; Arg 116: 116; Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg 120: 120; Arg 121: 121; Arg 122: 122

    ; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg 126: 126; Arg 127: 127; Arg 128: 128; Arg 129: 129; Ar

    g 130: 130; Arg 131: 131; Arg 132: 132; Arg 133: 133; Arg 134: 134; Arg 135: 135; Arg 136: 136; Arg 137

    : 137; Arg 138: 138; Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg 142: 142; Arg 143: 143; Arg 144: 144

    ; Arg 145: 145; Arg 146: 146; Arg 147: 147; Arg 148: 148; Arg 149: 149; Arg 150: 150; Arg 151: 151; Ar

    g 152: 152; Arg 153: 153; Arg 154: 154; Arg 155: 155; Arg 156: 156;

    $ set noverify

    G>

    G>

    G> @test_args 170

    $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

    38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

    75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 10

    8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

    136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 16

    3 164 165 166 167 168 169 170

    Arg 0: $1$dka100:[XXXX]test_args.exe;4; Arg 1: D; Arg 2: ; Arg 3:

    D; Arg 4: ; Arg 5: D;

    Arg 6: ; Arg 7: D; Arg 8: ; Arg 9: D; Arg 13: ; Arg 14: ; Arg 15: D

    ; Arg 16: D; Arg 17: ; Arg 18: ; Arg 19: D; Arg 20: D; Arg 21: ; Arg 22: ; Arg 23: D; Arg 24: D;

    Arg 25: ; Arg 26: ; Arg 27: D; Arg 28: D; Arg 29: ; Arg 30: ; Arg 31: D; Arg 32: D; Arg 33: ; Arg 3

    4: ; Arg 35: D; Arg 36: D; Arg 37: ; Arg 38: ; Arg 39: D; Arg 40: 40; Arg 41: 41; Arg 42: 42; Arg 43

    : 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg 47: 47; Arg 48: 48; Arg 49: 49; Arg 50: 50; Arg 51: 51;

    Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55: 55; Arg 56: 56; Arg 57: 57; Arg 58: 58; Arg 59: 59; Arg 6

    0: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63; Arg 64: 64; Arg 65: 65; Arg 66: 66; Arg 67: 67; Arg 68: 68;

    Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72: 72; Arg 73: 73; Arg 74: 74; Arg 75: 75; Arg 76: 76; Arg

    77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80; Arg 81: 81; Arg 82: 82; Arg 83: 83; Arg 84: 84; Arg 85: 85

    ; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89: 89; Arg 90: 90; Arg 91: 91; Arg 92: 92; Arg 93: 93; Arg

    94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97; Arg 98: 98; Arg 99: 99; Arg 100: 100; Arg 101: 101; Arg 1

    02: 102; Arg 103: 103; Arg 104: 104; Arg 105: 105; Arg 106: 106; Arg 107: 107; Arg 108: 108; Arg 109: 1

    09; Arg 110: 110; Arg 111: 111; Arg 112: 112; Arg 113: 113; Arg 114: 114; Arg 115: 115; Arg 116: 116;

    Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg 120: 120; Arg 121: 121; Arg 122: 122; Arg 123: 123; Arg 1

    24: 124; Arg 125: 125; Arg 126: 126; Arg 127: 127; Arg 128: 128; Arg 129: 129; Arg 130: 130; Arg 131: 1

    31; Arg 132: 132; Arg 133: 133; Arg 134: 134; Arg 135: 135; Arg 136: 136; Arg 137: 137; Arg 138: 138;

    Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg 142: 142; Arg 143: 143; Arg 144: 144; Arg 145: 145; Arg 1

    46: 146; Arg 147: 147; Arg 148: 148; Arg 149: 149; Arg 150: 150; Arg 151: 151; Arg 152: 152; Arg 153: 1

    53; Arg 154: 154; Arg 155: 155; Arg 156: 156; Arg 157: 157; Arg 158: 158; Arg 159: 159; Arg 160: 160;

    Arg 161: 161; Arg 162: 162; Arg 163: 163; Arg 164: 164; Arg 165: 165; Arg 166: 166; Arg 167: 167; Arg 1

    68: 168; Arg 169: 169; Arg 170: 170;

    $ set noverify

    G>

    G>



  2. Re: FW: Passing large number of arguments to a program

    sol gongola wrote in
    news:2OZ4j.235$Id1.109@newsfe10.lga:

    > I am still on vms 7.2-1.
    > vms 8.3 allows more than p1...p8?


    DCL only allows 8 arguments, the OP is passing the arguments to a C
    program. What the OP is probably running into is the maximum lenght of a
    DCL line,

    Ken

  3. Re: FW: Passing large number of arguments to a program

    I am still on vms 7.2-1.
    vms 8.3 allows more than p1...p8?

    Farrell, Michael wrote:
    > One of my programmers wrote a program that receives a huge
    > (embarassingly huge) number of arguments.
    >
    > The program is run through a DCL jacket procedure that develops the
    > arguments and calls the program.
    >
    >
    >
    > If the number of arguments exceeds 143, not the leading argument, but
    > the following leading arguments get clobbered.
    >
    > (When 144 arguments are used, arguments 2 and 3 get clobbered.)
    >
    >
    >
    > The program below is a stub program that shows this condition. There
    > are 4 runs shown here. One for 143 arguments where all is fine, and one
    > each for 144, 156, and 170 arguments where an increasing number of the
    > leading arguments starting with argument 1 gets clobbered. (Note that
    > if you run this you can always see that varg[0] is correct, always
    > showing the exact version of the program name being executed.)
    >
    >
    >
    > Yes, passing a ridiculous number of arguments does bring new meaning to
    > the expression quick and dirty programming. And yes, there is a
    > better way to do it, and yes, that change is being made now.
    >
    >
    >
    > But, what went on here? Is DCL involved in this problem? Can someone
    > explain what could be involved?
    >
    >
    >
    > We are running HP C V7.1-015 on OpenVMS Alpha V8.3. The original
    > program was linked with a STACK=200 command in the link options file
    > but Im not sure if this.
    >
    >
    >
    > Any insight will be greatly appreciated.
    >
    >
    >
    > Thanks
    >
    >
    >
    > Mike
    >
    >
    >
    > Mike Farrell
    >
    > VoltDelta Resources, LLC
    >
    >
    >
    >
    >
    > G> cc test_args.c ! Std cc command
    >
    > G> link test_args ! Std link command
    >
    >
    >
    >
    >
    > Directory $1$DKA100:[XXXX]
    >
    >
    >
    > TEST_ARGS.C;4 0.50KB/34KB
    > 3-DEC-2007 10:59:41.99
    >
    > TEST_ARGS.COM;3 1KB/34KB
    > 3-DEC-2007 11:11:17.58
    >
    > TEST_ARGS.EXE;4 3KB/34KB
    > 3-DEC-2007 10:59:45.10
    >
    > TEST_ARGS.OBJ;4 2KB/34KB
    > 3-DEC-2007 10:59:43.69
    >
    >
    >
    > Total of 4 files, 7KB/138KB
    >
    > G>
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > G> ty TEST_ARGS.COM
    >
    > $! TEST_ARGS.COM
    >
    > $! -------------
    >
    > $! P1 - number of command line arguments to test
    >
    > $!
    >
    > $! This test procedure will generate requested number of command line
    > arguments as "1 2 3 ..", and
    >
    > $! will attempt to run TEST_ARGS.EXE program while passing all those
    > arguments. The program will attempt
    >
    > $! to simply print the list of command line arguments.
    >
    > $!
    >
    > $ if (f$type(P1) .nes. "INTEGER") then exit 4
    >
    > $!
    >
    > $ n = 0
    >
    > $ args = ""
    >
    > $ max = P1
    >
    > $LOOP:
    >
    > $ n = n + 1
    >
    > $ if (n .gt. max) then goto FINISH
    >
    > $ args = args + " ''n'"
    >
    > $ goto LOOP
    >
    > $FINISH:
    >
    > $!
    >
    > $ prog := $ $1$DKA100:[IGOR.SPB2ASC.REL_058]TEST_ARGS.EXE
    >
    > $ set verify
    >
    > $ prog 'args'
    >
    > $ set noverify
    >
    > $ exit
    >
    > G>
    >
    >
    >
    >
    >
    >
    >
    > G> type TEST_ARGS.c
    >
    > #include
    >
    >
    >
    > main(int narg, char *varg[]) {
    >
    >
    >
    > int n;
    >
    >
    >
    > for (n = 0; n < narg; n++) printf(" Arg %d: %s;", n, varg[n]);
    >
    > }
    >
    > G>
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > G> @test_args *143*
    >
    > $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    > 25 26 27 28 29 30 31 32 33 34 35 36 37
    >
    > 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    > 62 63 64 65 66 67 68 69 70 71 72 73 74
    >
    > 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    > 99 100 101 102 103 104 105 106 107 10
    >
    > 8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    > 126 127 128 129 130 131 132 133 134 135
    >
    > 136 137 138 139 140 141 142 143
    >
    > Arg 0: $1$dka100:[XXXX]test_args.exe;4; Arg 1: 1; Arg 2: 2; Arg 3:
    > 3; Arg 4: 4; Arg 5:
    >
    > 5; Arg 6: 6; Arg 7: 7; Arg 8: 8; Arg 9: 9; Arg 10: 10; Arg 11:
    > 11; Arg 12: 12; Arg 13: 13; Arg 14: 14
    >
    > ; Arg 15: 15; Arg 16: 16; Arg 17: 17; Arg 18: 18; Arg 19: 19; Arg
    > 20: 20; Arg 21: 21; Arg 22: 22; Arg
    >
    > 23: 23; Arg 24: 24; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28:
    > 28; Arg 29: 29; Arg 30: 30; Arg 31: 3
    >
    > 1; Arg 32: 32; Arg 33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg
    > 37: 37; Arg 38: 38; Arg 39: 39; Ar
    >
    > g 40: 40; Arg 41: 41; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45:
    > 45; Arg 46: 46; Arg 47: 47; Arg 48:
    >
    > 48; Arg 49: 49; Arg 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53;
    > Arg 54: 54; Arg 55: 55; Arg 56: 56; A
    >
    > rg 57: 57; Arg 58: 58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62:
    > 62; Arg 63: 63; Arg 64: 64; Arg 65:
    >
    > 65; Arg 66: 66; Arg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70;
    > Arg 71: 71; Arg 72: 72; Arg 73: 73;
    >
    > Arg 74: 74; Arg 75: 75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79:
    > 79; Arg 80: 80; Arg 81: 81; Arg 82
    >
    > : 82; Arg 83: 83; Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87;
    > Arg 88: 88; Arg 89: 89; Arg 90: 90;
    >
    > Arg 91: 91; Arg 92: 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg
    > 96: 96; Arg 97: 97; Arg 98: 98; Arg 9
    >
    > 9: 99; Arg 100: 100; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg
    > 104: 104; Arg 105: 105; Arg 106: 106
    >
    > ; Arg 107: 107; Arg 108: 108; Arg 109: 109; Arg 110: 110; Arg 111:
    > 111; Arg 112: 112; Arg 113: 113; Ar
    >
    > g 114: 114; Arg 115: 115; Arg 116: 116; Arg 117: 117; Arg 118: 118;
    > Arg 119: 119; Arg 120: 120; Arg 121
    >
    > : 121; Arg 122: 122; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg
    > 126: 126; Arg 127: 127; Arg 128: 128
    >
    > ; Arg 129: 129; Arg 130: 130; Arg 131: 131; Arg 132: 132; Arg 133:
    > 133; Arg 134: 134; Arg 135: 135; Ar
    >
    > g 136: 136; Arg 137: 137; Arg 138: 138; Arg 139: 139; Arg 140: 140;
    > Arg 141: 141; Arg 142: 142; Arg 143
    >
    > : 143;
    >
    > $ set noverify
    >
    > G>
    >
    > G>
    >
    > G> @test_args *144*
    >
    > $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    > 25 26 27 28 29 30 31 32 33 34 35 36 37
    >
    > 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    > 62 63 64 65 66 67 68 69 70 71 72 73 74
    >
    > 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    > 99 100 101 102 103 104 105 106 107 10
    >
    > 8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    > 126 127 128 129 130 131 132 133 134 135
    >
    > 136 137 138 139 140 141 142 143 144
    >
    > Arg 0: $1$dka100:[XXXX]test_args.exe;4; *Arg 1: D; Arg 2: ;* Arg 3:
    > 3; Arg 4: 4; Arg 5: 5
    >
    > ; Arg 6: 6; Arg 7: 7; Arg 8: 8; Arg 9: 9; Arg 10: 10; Arg 11: 11;
    > Arg 12: 12; Arg 13: 13; Arg 14: 14;
    >
    > Arg 15: 15; Arg 16: 16; Arg 17: 17; Arg 18: 18; Arg 19: 19; Arg
    > 20: 20; Arg 21: 21; Arg 22: 22; Arg
    >
    > 23: 23; Arg 24: 24; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28:
    > 28; Arg 29: 29; Arg 30: 30; Arg 31: 31
    >
    > ; Arg 32: 32; Arg 33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg
    > 37: 37; Arg 38: 38; Arg 39: 39; Arg
    >
    > 40: 40; Arg 41: 41; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45:
    > 45; Arg 46: 46; Arg 47: 47; Arg 48: 4
    >
    > 8; Arg 49: 49; Arg 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53; Arg
    > 54: 54; Arg 55: 55; Arg 56: 56; Ar
    >
    > g 57: 57; Arg 58: 58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62:
    > 62; Arg 63: 63; Arg 64: 64; Arg 65:
    >
    > 65; Arg 66: 66; Arg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70;
    > Arg 71: 71; Arg 72: 72; Arg 73: 73; A
    >
    > rg 74: 74; Arg 75: 75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79:
    > 79; Arg 80: 80; Arg 81: 81; Arg 82:
    >
    > 82; Arg 83: 83; Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87;
    > Arg 88: 88; Arg 89: 89; Arg 90: 90;
    >
    > Arg 91: 91; Arg 92: 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg 96:
    > 96; Arg 97: 97; Arg 98: 98; Arg 99
    >
    > : 99; Arg 100: 100; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg
    > 104: 104; Arg 105: 105; Arg 106: 106;
    >
    > Arg 107: 107; Arg 108: 108; Arg 109: 109; Arg 110: 110; Arg 111:
    > 111; Arg 112: 112; Arg 113: 113; Arg
    >
    > 114: 114; Arg 115: 115; Arg 116: 116; Arg 117: 117; Arg 118: 118;
    > Arg 119: 119; Arg 120: 120; Arg 121:
    >
    > 121; Arg 122: 122; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg
    > 126: 126; Arg 127: 127; Arg 128: 128;
    >
    > Arg 129: 129; Arg 130: 130; Arg 131: 131; Arg 132: 132; Arg 133:
    > 133; Arg 134: 134; Arg 135: 135; Arg
    >
    > 136: 136; Arg 137: 137; Arg 138: 138; Arg 139: 139; Arg 140: 140;
    > Arg 141: 141; Arg 142: 142; Arg 143:
    >
    > 143; Arg 144: 144;
    >
    > $ set noverify
    >
    > G>
    >
    > G>
    >
    > G> @test_args *156*
    >
    > $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    > 25 26 27 28 29 30 31 32 33 34 35 36 37
    >
    > 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    > 62 63 64 65 66 67 68 69 70 71 72 73 74
    >
    > 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    > 99 100 101 102 103 104 105 106 107 10
    >
    > 8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    > 126 127 128 129 130 131 132 133 134 135
    >
    > 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
    > 154 155 156
    >
    > Arg 0: $1$dka100:[XXXX]test_args.exe;4; *Arg 1: D; Arg 2: ; Arg 3:*
    >
    > *
    > D; Arg 4: ; Arg 5: D;*
    >
    > * Arg 6: ; Arg 7: D; Arg 8: ; Arg 9: D; Arg 13: ; Arg 14: ; Arg
    > 15: D*
    >
    > *; Arg 16: D; Arg 17: ; Arg 18: ; Arg 19: D; Arg 20: D; Arg 21:
    > ;* Arg 22: 22; Arg 23: 23; Arg 24: 24
    >
    > ; Arg 25: 25; Arg 26: 26; Arg 27: 27; Arg 28: 28; Arg 29: 29; Arg
    > 30: 30; Arg 31: 31; Arg 32: 32; Arg
    >
    > 33: 33; Arg 34: 34; Arg 35: 35; Arg 36: 36; Arg 37: 37; Arg 38:
    > 38; Arg 39: 39; Arg 40: 40; Arg 41: 4
    >
    > 1; Arg 42: 42; Arg 43: 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg
    > 47: 47; Arg 48: 48; Arg 49: 49; Ar
    >
    > g 50: 50; Arg 51: 51; Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55:
    > 55; Arg 56: 56; Arg 57: 57; Arg 58:
    >
    > 58; Arg 59: 59; Arg 60: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63;
    > Arg 64: 64; Arg 65: 65; Arg 66: 66; A
    >
    > rg 67: 67; Arg 68: 68; Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72:
    > 72; Arg 73: 73; Arg 74: 74; Arg 75:
    >
    > 75; Arg 76: 76; Arg 77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80;
    > Arg 81: 81; Arg 82: 82; Arg 83: 83;
    >
    > Arg 84: 84; Arg 85: 85; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89:
    > 89; Arg 90: 90; Arg 91: 91; Arg 92
    >
    > : 92; Arg 93: 93; Arg 94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97;
    > Arg 98: 98; Arg 99: 99; Arg 100: 100
    >
    > ; Arg 101: 101; Arg 102: 102; Arg 103: 103; Arg 104: 104; Arg 105:
    > 105; Arg 106: 106; Arg 107: 107; Ar
    >
    > g 108: 108; Arg 109: 109; Arg 110: 110; Arg 111: 111; Arg 112: 112;
    > Arg 113: 113; Arg 114: 114; Arg 115
    >
    > : 115; Arg 116: 116; Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg
    > 120: 120; Arg 121: 121; Arg 122: 122
    >
    > ; Arg 123: 123; Arg 124: 124; Arg 125: 125; Arg 126: 126; Arg 127:
    > 127; Arg 128: 128; Arg 129: 129; Ar
    >
    > g 130: 130; Arg 131: 131; Arg 132: 132; Arg 133: 133; Arg 134: 134;
    > Arg 135: 135; Arg 136: 136; Arg 137
    >
    > : 137; Arg 138: 138; Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg
    > 142: 142; Arg 143: 143; Arg 144: 144
    >
    > ; Arg 145: 145; Arg 146: 146; Arg 147: 147; Arg 148: 148; Arg 149:
    > 149; Arg 150: 150; Arg 151: 151; Ar
    >
    > g 152: 152; Arg 153: 153; Arg 154: 154; Arg 155: 155; Arg 156: 156;
    >
    > $ set noverify
    >
    > G>
    >
    > G>
    >
    > G> @test_args *170*
    >
    > $ prog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    > 25 26 27 28 29 30 31 32 33 34 35 36 37
    >
    > 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    > 62 63 64 65 66 67 68 69 70 71 72 73 74
    >
    > 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    > 99 100 101 102 103 104 105 106 107 10
    >
    > 8 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    > 126 127 128 129 130 131 132 133 134 135
    >
    > 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
    > 154 155 156 157 158 159 160 161 162 16
    >
    > 3 164 165 166 167 168 169 170
    >
    > Arg 0: $1$dka100:[XXXX]test_args.exe;4; *Arg 1: D; Arg 2: ; Arg 3:*
    >
    > *
    > D; Arg 4: ; Arg 5: D;*
    >
    > * Arg 6: ; Arg 7: D; Arg 8: ; Arg 9: D; Arg 13: ; Arg 14: ; Arg
    > 15: D*
    >
    > *; Arg 16: D; Arg 17: ; Arg 18: ; Arg 19: D; Arg 20: D; Arg 21:
    > ; Arg 22: ; Arg 23: D; Arg 24: D;*
    >
    > *Arg 25: ; Arg 26: ; Arg 27: D; Arg 28: D; Arg 29: ; Arg 30: ;
    > Arg 31: D; Arg 32: D; Arg 33: ; Arg 3*
    >
    > *4: ; Arg 35: D; Arg 36: D; Arg 37: ; Arg 38: ; Arg 39: D;* Arg
    > 40: 40; Arg 41: 41; Arg 42: 42; Arg 43
    >
    > : 43; Arg 44: 44; Arg 45: 45; Arg 46: 46; Arg 47: 47; Arg 48: 48;
    > Arg 49: 49; Arg 50: 50; Arg 51: 51;
    >
    > Arg 52: 52; Arg 53: 53; Arg 54: 54; Arg 55: 55; Arg 56: 56; Arg
    > 57: 57; Arg 58: 58; Arg 59: 59; Arg 6
    >
    > 0: 60; Arg 61: 61; Arg 62: 62; Arg 63: 63; Arg 64: 64; Arg 65: 65;
    > Arg 66: 66; Arg 67: 67; Arg 68: 68;
    >
    > Arg 69: 69; Arg 70: 70; Arg 71: 71; Arg 72: 72; Arg 73: 73; Arg
    > 74: 74; Arg 75: 75; Arg 76: 76; Arg
    >
    > 77: 77; Arg 78: 78; Arg 79: 79; Arg 80: 80; Arg 81: 81; Arg 82:
    > 82; Arg 83: 83; Arg 84: 84; Arg 85: 85
    >
    > ; Arg 86: 86; Arg 87: 87; Arg 88: 88; Arg 89: 89; Arg 90: 90; Arg
    > 91: 91; Arg 92: 92; Arg 93: 93; Arg
    >
    > 94: 94; Arg 95: 95; Arg 96: 96; Arg 97: 97; Arg 98: 98; Arg 99:
    > 99; Arg 100: 100; Arg 101: 101; Arg 1
    >
    > 02: 102; Arg 103: 103; Arg 104: 104; Arg 105: 105; Arg 106: 106;
    > Arg 107: 107; Arg 108: 108; Arg 109: 1
    >
    > 09; Arg 110: 110; Arg 111: 111; Arg 112: 112; Arg 113: 113; Arg
    > 114: 114; Arg 115: 115; Arg 116: 116;
    >
    > Arg 117: 117; Arg 118: 118; Arg 119: 119; Arg 120: 120; Arg 121:
    > 121; Arg 122: 122; Arg 123: 123; Arg 1
    >
    > 24: 124; Arg 125: 125; Arg 126: 126; Arg 127: 127; Arg 128: 128;
    > Arg 129: 129; Arg 130: 130; Arg 131: 1
    >
    > 31; Arg 132: 132; Arg 133: 133; Arg 134: 134; Arg 135: 135; Arg
    > 136: 136; Arg 137: 137; Arg 138: 138;
    >
    > Arg 139: 139; Arg 140: 140; Arg 141: 141; Arg 142: 142; Arg 143:
    > 143; Arg 144: 144; Arg 145: 145; Arg 1
    >
    > 46: 146; Arg 147: 147; Arg 148: 148; Arg 149: 149; Arg 150: 150;
    > Arg 151: 151; Arg 152: 152; Arg 153: 1
    >
    > 53; Arg 154: 154; Arg 155: 155; Arg 156: 156; Arg 157: 157; Arg
    > 158: 158; Arg 159: 159; Arg 160: 160;
    >
    > Arg 161: 161; Arg 162: 162; Arg 163: 163; Arg 164: 164; Arg 165:
    > 165; Arg 166: 166; Arg 167: 167; Arg 1
    >
    > 68: 168; Arg 169: 169; Arg 170: 170;
    >
    > $ set noverify
    >
    > G>
    >
    > G>
    >


  4. Re: FW: Passing large number of arguments to a program

    In article <4754650b$0$7446$88260bb3@news.teranews.com>, Ken Robinson writes:
    >
    >
    >sol gongola wrote in
    >news:2OZ4j.235$Id1.109@newsfe10.lga:
    >
    >> I am still on vms 7.2-1.
    >> vms 8.3 allows more than p1...p8?

    >
    >DCL only allows 8 arguments, the OP is passing the arguments to a C
    >program. What the OP is probably running into is the maximum lenght of a
    >DCL line,



    The OP didn't bother to post his code in plain text making it virtually
    impossible for me to bother to decipher it. 2000+ lines of unreadable
    code.

    --
    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

  5. Re: FW: Passing large number of arguments to a program

    Ken Robinson wrote:
    > sol gongola wrote in
    > news:2OZ4j.235$Id1.109@newsfe10.lga:
    >
    >> I am still on vms 7.2-1.
    >> vms 8.3 allows more than p1...p8?

    >
    > DCL only allows 8 arguments, the OP is passing the arguments to a C
    > program. What the OP is probably running into is the maximum lenght of a
    > DCL line,
    >
    > Ken



    Ken,

    You can get DCL itself to input a long line of arguments,
    and then get DCL to parse them itself, without using a C
    program. Just make DCL think it is inputting P1 as a quoted
    string of text. Then the limit of input is simply the length
    of the keyboard buffer.

    I found the trick of getting DCL to take long lines of
    dictation in my DIARY.com suite. I enter the symbol ADDD
    several times a day to make entries into my online work
    diary. I use a symbol to point to a DCL command procedure,
    but the symbol itself is defined as having a single trailing
    double-quote.

    SO my ADDDIARY.COM (below) grabs a line of text which can
    be several elements long (~254 chars max). Then by using
    the lexical function f$element you could dig out each
    argument just inputted on the command line.

    Here is may ADDD (short for ADDDIARY.COM). NOTE AGAIN:
    THE TRICK IS IN HOW YOU DEFINE THE SHORTHAND SYMBOL
    FOR THE PROGRAM!!! The symbol must be defined with
    a trailing double-quotation mark.



    > show symbol addd
    > ADDD*IARY == "@BACH$DIR:[COM]ADDDIARY.COM " "



    Here is how I define the symbol. ( DEFINE.COM runs
    inside LOGIN.COM )

    > search define.com adddiary
    > $! 08-SEO-2000 FWB. Add ADDDIARY. Trailing triple quote allows lowercase and more than 8 args.
    > $ ADDD*IARY :==@BACH$DIR:[COM]ADDDIARY.COM """



    This trialling quote is absolutely essential. Unfortunately,
    you do pay a price for this functionality. The entry must not
    contain single quotes. If you use a single quote, DCL will
    try to translate the word following it as a symbol. If you
    use a double-quote in your line of text, then the text
    following the double quote comes back in all capitals.


    First, an example of the single quote:

    > addd This isn't Fred's day.
    > LOGIN == "@SYS$LOGIN:LOGIN.COM"
    > LOGINTIME == "3-DEC-2007 07:36:16.47"
    > Taking data from command line.
    > Continue entry, end with BLANK line:
    > Continue entry, end with BLANK line:
    > DIARY_ENTRY:
    >
    > Monday 3-DEC-2007 13:19:27 This isn Fred@BACH$DIR:[COM]S.COM day.
    > Is this entry OK? {Yes}:



    Note the 't has no translation, and so isn't comes out as isn .
    Note that the 's in Fred's has a translation, and the value
    of the symbol "s" is placed in the line to be added to the diary.


    Next, the example with a pair of lone double-quotes and text
    in the middle:

    > ADDD Arrive 07:15 "Weather was poor".
    > LOGIN == "@SYS$LOGIN:LOGIN.COM"
    > LOGINTIME == "3-DEC-2007 07:36:23.03"
    > Taking data from command line.
    > Continue entry, end with BLANK line:
    > Continue entry, end with BLANK line:
    > DIARY_ENTRY:
    >
    > Monday 3-DEC-2007 13:16:47 Arrive 07:15 WEATHER WAS POOR".
    > Is this entry OK? {Yes}:



    Note that the phrase Weather was poor came out in all caps.
    I haven't experimented with various combinations of double and
    single quotes, but I figure that if you know the rules then you
    actually could add the text you wanted to the diary.


    Here is ADDDIARY.COM. Remember that it expects everything on
    the first line to be part of the FIRST argument since the symbol
    ends with a trailing lone double-quote.


    > Bach_1_BN2> type adddiary.com
    > $! written Friday 08-SEP-2000 by Fred W. Bach, TRIUMF Operations
    > $! tag keyboard diary entries and add to diary.
    > $! In DEFINE.COM the symbol ADDD*IARY is defined to have a trailing
    > $! single quote which allows many words and lowercase from argument string.
    > $! Pretty neat VMS DCL trick, eh ??
    > $! edit 12-MAY-2004 FWB. Add empty line at beginning.
    > $!
    > $ ON WARNING THEN CONTINUE
    > $ ON ERROR THEN GOTO EXIT
    > $ ON SEVERE_ERROR THEN STOP
    > $ ON CONTROL_Y THEN GOTO EXIT
    > $ DOUBLESI*ZE = "@BACH$DIR:[COM]DOUBLESIZE.COM"
    > $ DOUBLESIZE_C*ENTER = "@BACH$DIR:[COM]DOUBLESIZE_CENTER.COM"
    > $ SPACE = " "
    > $ SPACES = " "
    > $ ARGS = ""
    > $ ARGS = p1+space+p2+space+p3+space+p4+space+p5+space+p6+sp ace+p7+space+p8
    > $ ARGS = F$EDIT(ARGS,"TRIM") !remove any leading or trailing spaces.
    > $ LINE = ""
    > $ PID = F$GETJPI("","PID")
    > $!
    > $!***** NOTE: DIARY directory MUST exist under SYS$LOGIN directory
    > $!
    > $ DIARY_DIR = F$TRNLNM("SYS$LOGIN") - "]" + ".DIARY]"
    > $ DIARY_FILE = DIARY_DIR + "DIARY.TXT"
    > $ DIARY_TEMP = DIARY_DIR + "DIARY.''PID'"
    > $ THIS_TIME = F$CVTIME("",,"WEEKDAY") + " " + F$TIME()
    > $! chop off the fractional seconds - wasted characters
    > $ THIS_TIME = F$EXTRACT(0,F$LENGTH(THIS_TIME)-3,THIS_TIME)
    > $!
    > $! **** create temporary file
    > $!
    > $ show symbol/global *login*
    > $ CLOSE/NOLOG OUTFILE
    > $ CREATE 'DIARY_TEMP'
    > $ OPEN/APPEND OUTFILE 'DIARY_TEMP'
    > $ WRITE OUTFILE " " !need an empty line to separate it from last day's entry
    > $!
    > $! **** Write date & time to temp file.
    > $!
    > $ IF F$EDIT(ARGS,"COLLAPSE") .EQS. "" THEN WRITE/SYMBOL OUTFILE THIS_TIME
    > $! SHOW SYMBOL THIS_TIME
    > $!
    > $!
    > $ line_count = 0
    > $LOOP:
    > $ if f$edit(args,"collapse") .eqs. ""
    > $ then
    > $!
    > $! *** if entry started on command line, then use Continue instead of Write
    > $!
    > $ WORD = "Write"
    > $ if line_count .ne. 0 then WORD = "Continue"
    > $ Doublesize "''word' entry, end with BLANK line:"
    > $ read/prompt="DIARY_ENTRY: " sys$command line
    > $ if line_count .lt. 1 .and. f$edit(line,"collapse") .eqs. "" then goto exit
    > $ line_count = line_count + 1
    > $ if line_count .eq. 1 then LINE = SPACES + THIS_TIME + SPACE + LINE
    > $ else
    > $ write sys$output "Taking data from command line."
    > $ line = SPACES + THIS_TIME + SPACE + ARGS
    > $ line_count = line_count + 1
    > $ args = "" !must kill args otherwise we will loop forever
    > $ endif
    > $ if f$edit(line,"collapse") .eqs. "" then goto GOT_ENTRY
    > $ write/symbol outfile line
    > $ line = ""
    > $ goto loop
    > $!
    > $GOT_ENTRY:
    > $ close outfile
    > $!
    > $EDIT_ENTRY:
    > $ TYPE 'diary_temp'
    > $ INQUIRE OK "Is this entry OK? {Yes}"
    > $ IF OK .EQS. "" THEN OK = "YES"
    > $ IF OK THEN GOTO APPEND_ENTRY
    > $ ASSIGN/USER SYS$COMMAND SYS$INPUT
    > $ EDIT = "EDIT/TPU/INIT=''diary_dir'DIARY$INIT.EVE/COMM=''diary_dir'DIARY$COMMAND.TPU"
    > $ EDIT 'DIARY_TEMP'
    > $ GOTO EDIT_ENTRY
    > $!
    > $APPEND_ENTRY:
    > $ on error then goto APPEND_ERROR
    > $ on warning then goto EXIT
    > $ append/log 'diary_temp' 'diary_file'
    > $ delete/nolog/noconfirm 'diary_temp';*
    > $ doublesize "Entry dated: ''this_time'"
    > $!
    > $EXIT:
    > $ close/nolog outfile
    > $ sho default
    > $ exit
    > $!
    > $APPEND_ERROR:
    > $ status = $STATUS
    > $ write sys$output "Error appending temp file: ''f$message(STATUS)'"
    > $ goto exit





  6. Re: Passing large number of arguments to a program

    > If the number of arguments exceeds 143, not the leading argument, but the
    > following leading arguments get clobbered.
    > (When 144 arguments are used, arguments 2 and 3 get clobbered.)


    Neat bug!

    On both Alpha 8.3 and IA64 8.3 the first x arguments get clobbered if you
    between 144 and 191 arugments. If you pass 143 then you are fine, if you
    pass 292 or more then you are fine. If you pass 144 then you parameters 1
    and 2 are bad, if you pass 291 then the first 175 arguments are clobbered.
    But pass 292 or more and you are fine until you get over 700 arguments (I
    tried 300, 400, 500, 600, 700 and 800 but nothing between those numbers). At
    800 the first 107 arguments are clobbered.

    If you have a support contract on you C license I would report it HP.

    Peter Weaver
    www.weaverconsulting.ca
    CHARON-VAX CHARON-AXP DataStream Reflection PreciseMail HP Commercial
    Hardware


  7. Re: FW: Passing large number of arguments to a program

    Farrell, Michael wrote:
    > One of my programmers wrote a program that receives a huge
    > (embarassingly huge) number of arguments.
    >
    > The program is run through a DCL jacket procedure that develops the
    > arguments and calls the program.
    >
    >
    > If the number of arguments exceeds 143, not the leading argument, but
    > the following leading arguments get clobbered.


    From the documentation of DCL currently available in the OpenVMS User's
    Guide at the HP web site: "Include no more than 127 elements
    (parameters, qualifiers, and qualifier values) in each command line."

    The associated command length and token size limits were increased in
    late V7 and in V8 releases, and that much is documented in the new
    features manuals.

    I don't know that the maximum number of elements has been changed.
    (Based on what you are seeing, it would appear not.)

    If this documentation holds -- it's what is currently posted, though
    whether or not this documentation is the most current in light of the
    DCL changes is another question -- then your programmer's code is
    depending on unsupported behavior, and you have an enhancement request
    (better error reporting, more elements) and not a bug report. (How HP
    might choose to respond to any of this is another and open question.)

    Me? I'd alter the code to avoid needing a gazillion parameters. I'd
    tend to look to pass in the wad of data required here via a file or via
    mailbox or other such approach. (FWIW, DCL has mailbox capabilities in
    recent releases with CREATE /MAILBOX and such...) Or at least stuff the
    wad you have into 127 or fewer elements.

    --
    www.HoffmanLabs.com
    Services for OpenVMS

  8. Re: FW: Passing large number of arguments to a program

    Stephen Hoffman wrote:
    > From the documentation of DCL currently available in the OpenVMS User's
    > Guide at the HP web site: "Include no more than 127 elements
    > (parameters, qualifiers, and qualifier values) in each command line."


    Is this applicable to a C program that does a unix-like grabbing of
    arguments via argc/argv ?

    I can understand this limitaion applying to real DCL (eg: application
    doing CLI$PARSE $GET_VALUE etc), but would DCL be involved in parsing
    any of the stuff after the command ? Or does the C run time just access
    a single long string beyond the command and parse it itself ?

  9. Re: FW: Passing large number of arguments to a program

    In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >
    > You are too kind! I'd fire the boob who wrote the program that
    > required several hundred arguments!


    You'ld have to fire just about everyone that ever wrote a UNIX
    utility. Remember in UNIX shells, the shell expands the wildcards.
    So if you have 200 files in a directory and enter "program *", then
    that program sees 200 arguments.


  10. Re: FW: Passing large number of arguments to a program

    Bob Koehler wrote:
    > In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >
    >>You are too kind! I'd fire the boob who wrote the program that
    >>required several hundred arguments!

    >
    >
    > You'ld have to fire just about everyone that ever wrote a UNIX
    > utility.


    Small loss! ;-)

    It's a big help to have some understanding of the O/S (s) that you are
    writing for.

    How many times, back in the 1980s and early 1990s did we hear from some
    Unix type who wondered why his program ran like a dog on VMS? The
    problem frequently turned out to be some outrageous abuse of what is
    good programming practice on VMS. We'd see people doing bizarre things
    like putting 10,000 twenty-seven byte files in one directory. . . .



  11. Re: FW: Passing large number of arguments to a program

    In article ,
    koehler@eisner.nospam.encompasserve.org (Bob Koehler) writes:
    > In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>
    >> You are too kind! I'd fire the boob who wrote the program that
    >> required several hundred arguments!

    >
    > You'ld have to fire just about everyone that ever wrote a UNIX
    > utility. Remember in UNIX shells, the shell expands the wildcards.
    > So if you have 200 files in a directory and enter "program *", then
    > that program sees 200 arguments.


    Unix has finite limits too.

    From /usr/include/errno.h

    #define E2BIG 7 /* Argument list too long */

    No OS that I am aware of can deal with an infinite number of anything!!
    Not even VMS.

    bill

    --
    Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
    bill@cs.scranton.edu | and a sheep voting on what's for dinner.
    University of Scranton |
    Scranton, Pennsylvania | #include

  12. Re: FW: Passing large number of arguments to a program

    In article <4756D713.9060904@comcast.net>,
    "Richard B. Gilbert" writes:
    > Bob Koehler wrote:
    >> In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>
    >>>You are too kind! I'd fire the boob who wrote the program that
    >>>required several hundred arguments!

    >>
    >>
    >> You'ld have to fire just about everyone that ever wrote a UNIX
    >> utility.

    >
    > Small loss! ;-)
    >
    > It's a big help to have some understanding of the O/S (s) that you are
    > writing for.
    >
    > How many times, back in the 1980s and early 1990s did we hear from some
    > Unix type who wondered why his program ran like a dog on VMS? The
    > problem frequently turned out to be some outrageous abuse of what is
    > good programming practice on VMS.


    Or we could turn it around and just admit that this was caused by
    a VMS shortcoming compared to Unix!!

    Like the following!!

    > We'd see people doing bizarre things
    > like putting 10,000 twenty-seven byte files in one directory. . . .


    We all know the other OS that has a real problem with too many files
    in one directrory, now, don't we??

    bill

    --
    Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
    bill@cs.scranton.edu | and a sheep voting on what's for dinner.
    University of Scranton |
    Scranton, Pennsylvania | #include

  13. Re: FW: Passing large number of arguments to a program

    In article <5ro5epF15iprdU1@mid.individual.net>, billg999@cs.uofs.edu (Bill Gunshannon) writes:
    >
    > #define E2BIG 7 /* Argument list too long */


    Thus xargs becomes your friend if you have to deal with UNIX.



  14. Re: FW: Passing large number of arguments to a program

    In article ,
    koehler@eisner.nospam.encompasserve.org (Bob Koehler) writes:
    > In article <5ro5epF15iprdU1@mid.individual.net>, billg999@cs.uofs.edu (Bill Gunshannon) writes:
    >>
    >> #define E2BIG 7 /* Argument list too long */

    >
    > Thus xargs becomes your friend if you have to deal with UNIX.


    I didn't say you couldn't deal with large numbers of arguments. I just
    said that Unix, like VMS and every other OS, has finite limits.

    bill

    --
    Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
    bill@cs.scranton.edu | and a sheep voting on what's for dinner.
    University of Scranton |
    Scranton, Pennsylvania | #include

  15. Re: FW: Passing large number of arguments to a program

    In article <5ro5epF15iprdU1@mid.individual.net>, billg999@cs.uofs.edu (Bill Gunshannon) writes:
    >
    >
    >In article ,
    > koehler@eisner.nospam.encompasserve.org (Bob Koehler) writes:
    >> In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>>
    >>> You are too kind! I'd fire the boob who wrote the program that
    >>> required several hundred arguments!

    >>
    >> You'ld have to fire just about everyone that ever wrote a UNIX
    >> utility. Remember in UNIX shells, the shell expands the wildcards.
    >> So if you have 200 files in a directory and enter "program *", then
    >> that program sees 200 arguments.

    >
    >Unix has finite limits too.
    >
    >From /usr/include/errno.h
    >
    >#define E2BIG 7 /* Argument list too long */
    >
    >No OS that I am aware of can deal with an infinite number of anything!!
    >Not even VMS.


    As an aggregate, Weendoze systems are asymptotically approaching the
    infinite number of reboots.


    --
    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

  16. Re: FW: Passing large number of arguments to a program

    Bill Gunshannon wrote:
    > In article <4756D713.9060904@comcast.net>,
    > "Richard B. Gilbert" writes:
    >
    >>Bob Koehler wrote:
    >>
    >>>In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>>
    >>>
    >>>>You are too kind! I'd fire the boob who wrote the program that
    >>>>required several hundred arguments!
    >>>
    >>>
    >>> You'ld have to fire just about everyone that ever wrote a UNIX
    >>> utility.

    >>
    >>Small loss! ;-)
    >>
    >>It's a big help to have some understanding of the O/S (s) that you are
    >>writing for.
    >>
    >>How many times, back in the 1980s and early 1990s did we hear from some
    >>Unix type who wondered why his program ran like a dog on VMS? The
    >>problem frequently turned out to be some outrageous abuse of what is
    >>good programming practice on VMS.

    >
    >
    > Or we could turn it around and just admit that this was caused by
    > a VMS shortcoming compared to Unix!!
    >
    > Like the following!!
    >
    >
    >> We'd see people doing bizarre things
    >>like putting 10,000 twenty-seven byte files in one directory. . . .

    >
    >
    > We all know the other OS that has a real problem with too many files
    > in one directrory, now, don't we??


    What is your point Bill?

    A Telephone directory can easily handle 10,000 or 100,000 entries.
    File directories are customarily much smaller. We would use an indexed
    file with 10,000 twenty-seven byte records rather than a directory.
    Unix users are not so fortunate and would have to "roll their own"
    indexed files if they didn't want to use a directory.

    I design or select my applications to fit the O/S available. If no
    appropriate design or selection fitted the characteristics of the O/S,
    I'd look for an O/S that was a better match for the job I was trying to
    do. I can choose from Windows, VMS, Solaris, and Red Hat Linux. There
    are, of course, still other options; I just don't happen to have the
    necessary hardware/software on hand.

    I don't know of ANY O/S where I would put 10,000 files in a single
    directory!



  17. Re: FW: Passing large number of arguments to a program

    Bill Gunshannon wrote:
    > #define E2BIG 7 /* Argument list too long */
    >
    > No OS that I am aware of can deal with an infinite number of anything!!
    > Not even VMS.



    VMS has so far survived an infinite amount of mismanagement -)

  18. Re: FW: Passing large number of arguments to a program

    In article <47572E37.4090106@comcast.net>,
    "Richard B. Gilbert" writes:
    > Bill Gunshannon wrote:
    >> In article <4756D713.9060904@comcast.net>,
    >> "Richard B. Gilbert" writes:
    >>
    >>>Bob Koehler wrote:
    >>>
    >>>>In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>>>
    >>>>
    >>>>>You are too kind! I'd fire the boob who wrote the program that
    >>>>>required several hundred arguments!
    >>>>
    >>>>
    >>>> You'ld have to fire just about everyone that ever wrote a UNIX
    >>>> utility.
    >>>
    >>>Small loss! ;-)
    >>>
    >>>It's a big help to have some understanding of the O/S (s) that you are
    >>>writing for.
    >>>
    >>>How many times, back in the 1980s and early 1990s did we hear from some
    >>>Unix type who wondered why his program ran like a dog on VMS? The
    >>>problem frequently turned out to be some outrageous abuse of what is
    >>>good programming practice on VMS.

    >>
    >>
    >> Or we could turn it around and just admit that this was caused by
    >> a VMS shortcoming compared to Unix!!
    >>
    >> Like the following!!
    >>
    >>
    >>> We'd see people doing bizarre things
    >>>like putting 10,000 twenty-seven byte files in one directory. . . .

    >>
    >>
    >> We all know the other OS that has a real problem with too many files
    >> in one directrory, now, don't we??

    >
    > What is your point Bill?
    >
    > A Telephone directory can easily handle 10,000 or 100,000 entries.
    > File directories are customarily much smaller. We would use an indexed
    > file with 10,000 twenty-seven byte records rather than a directory.
    > Unix users are not so fortunate and would have to "roll their own"
    > indexed files if they didn't want to use a directory.
    >
    > I design or select my applications to fit the O/S available. If no
    > appropriate design or selection fitted the characteristics of the O/S,
    > I'd look for an O/S that was a better match for the job I was trying to
    > do. I can choose from Windows, VMS, Solaris, and Red Hat Linux. There
    > are, of course, still other options; I just don't happen to have the
    > necessary hardware/software on hand.
    >
    > I don't know of ANY O/S where I would put 10,000 files in a single
    > directory!


    Never ran a USENET News Server, huh?

    bill

    --
    Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
    bill@cs.scranton.edu | and a sheep voting on what's for dinner.
    University of Scranton |
    Scranton, Pennsylvania | #include

  19. Re: FW: Passing large number of arguments to a program

    In article ,
    JF Mezei writes:
    > Bill Gunshannon wrote:
    >> #define E2BIG 7 /* Argument list too long */
    >>
    >> No OS that I am aware of can deal with an infinite number of anything!!
    >> Not even VMS.

    >
    >
    > VMS has so far survived an infinite amount of mismanagement -)


    Got to admit, you got me there!! :-)

    bill

    --
    Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
    bill@cs.scranton.edu | and a sheep voting on what's for dinner.
    University of Scranton |
    Scranton, Pennsylvania | #include

  20. Re: FW: Passing large number of arguments to a program

    Bill Gunshannon wrote:
    > In article <47572E37.4090106@comcast.net>,
    > "Richard B. Gilbert" writes:
    >
    >>Bill Gunshannon wrote:
    >>
    >>>In article <4756D713.9060904@comcast.net>,
    >>> "Richard B. Gilbert" writes:
    >>>
    >>>
    >>>>Bob Koehler wrote:
    >>>>
    >>>>
    >>>>>In article <4754B0E2.6060703@comcast.net>, "Richard B. Gilbert" writes:
    >>>>>
    >>>>>
    >>>>>
    >>>>>>You are too kind! I'd fire the boob who wrote the program that
    >>>>>>required several hundred arguments!
    >>>>>
    >>>>>
    >>>>> You'ld have to fire just about everyone that ever wrote a UNIX
    >>>>> utility.
    >>>>
    >>>>Small loss! ;-)
    >>>>
    >>>>It's a big help to have some understanding of the O/S (s) that you are
    >>>>writing for.
    >>>>
    >>>>How many times, back in the 1980s and early 1990s did we hear from some
    >>>>Unix type who wondered why his program ran like a dog on VMS? The
    >>>>problem frequently turned out to be some outrageous abuse of what is
    >>>>good programming practice on VMS.
    >>>
    >>>
    >>>Or we could turn it around and just admit that this was caused by
    >>>a VMS shortcoming compared to Unix!!
    >>>
    >>>Like the following!!
    >>>
    >>>
    >>>
    >>>> We'd see people doing bizarre things
    >>>>like putting 10,000 twenty-seven byte files in one directory. . . .
    >>>
    >>>
    >>>We all know the other OS that has a real problem with too many files
    >>>in one directrory, now, don't we??

    >>
    >>What is your point Bill?
    >>
    >>A Telephone directory can easily handle 10,000 or 100,000 entries.
    >>File directories are customarily much smaller. We would use an indexed
    >>file with 10,000 twenty-seven byte records rather than a directory.
    >>Unix users are not so fortunate and would have to "roll their own"
    >>indexed files if they didn't want to use a directory.
    >>
    >>I design or select my applications to fit the O/S available. If no
    >>appropriate design or selection fitted the characteristics of the O/S,
    >>I'd look for an O/S that was a better match for the job I was trying to
    >>do. I can choose from Windows, VMS, Solaris, and Red Hat Linux. There
    >>are, of course, still other options; I just don't happen to have the
    >>necessary hardware/software on hand.
    >>
    >>I don't know of ANY O/S where I would put 10,000 files in a single
    >>directory!

    >
    >
    > Never ran a USENET News Server, huh?
    >
    > bill
    >


    No! I never had the need! I probably wouldn't have been allowed to
    even if I had wanted to.


+ Reply to Thread