2 ways of doing this :
1-
create myproc2 @somevariable as int
as
select 1
go
Create myproc1
as
set @somevariable = 3
exec myproc2 @somevariable
go
2-
Create myproc1 @SomeVariable int output
as
set @somevariable = 3
go
create myproc2 @SomeVariable int
as
select 1
go
declare @var int
exec myproc1 @var output
exec myproc2 @var