No,

The program is called from inside the DCL jacket as a "foreign command". That way, the arg list is supposed to be controlled by the program as far as I know.

See the statement:
$ prog := $$1$DKA100:[IGOR.SPB2ASC.REL_058]TEST_ARGS.EXE
Then:
$ prog 'args'


Mike

-----Original Message-----
From: sol gongola [mailto:sol@adldata.com]
Sent: Monday, December 03, 2007 3:37 PM
To: Info-VAX@Mvb.Saic.Com
Subject: 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 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>
>