IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

passing a parameter in STDENV which is going beyond a single


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PKONDURI

New User


Joined: 17 Mar 2009
Posts: 11
Location: PUNE,India

PostPosted: Tue Mar 17, 2009 8:15 pm
Reply with quote

1)I am using BPXBATCH utility to pass variables to a script file.....
Basically i need to pass a value which is going beyond a single line to the variable i am using in the script ...how do i do it?

Example Code:
//TEST EXEC PGM=BPXBATCH,
// PARM='SH /dir1/file1.sh'
//SYSPRINT DD SYSOUT=*
//STDOUT DD PATH='/dir1/file.out',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//STDERR DD PATH='/dir1/errlog',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//STDENV DD *
STORAGE_VALUE=VOLSER(variable1,variable2,variable2,variable3,variable4-
variable5,variable6,variable7,variable8)
/*
//


2)Again i am using BPXBATCH utility to copy a unix file from one location to another location..
the target location is so big that it is going beyond a single line...how do i do this

Example code:
//CPYRESPA EXEC PGM=BPXBATCH,COND=(4000,LT)
//STDERR DD PATH='/dir1/error'
// PATHOPTS=(OWRONLY,OCREAT),PATHMODE=SIRWXU
//STDPARM DD *
SH cp
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10/sourcefile > /dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10/targetfile
/*

I tried giving '\' at the end of first line and > in the second line it is not working...i have tried many methods but not working...

Kindly help me out with this
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 17, 2009 8:31 pm
Reply with quote

1) Create a Unix file that contains the parameter value you want and point the PATH to that Unix file instead of DD *.
2) Try using a trailing +:
Code:
SH cp +
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10/sourcefile +
> /dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10/targetfile
Back to top
View user's profile Send private message
PKONDURI

New User


Joined: 17 Mar 2009
Posts: 11
Location: PUNE,India

PostPosted: Wed Mar 18, 2009 8:31 pm
Reply with quote

1)Could you please explain a bit on the solition you suggested for my first query,
What i understood in i should create aunix file and pass it to the variable?
Code:
STORAGE_VALUE=/varfile

if this is true then will the path will be resolved to data contained in it when it is passed to the script?

2)i tried appending + as you suggested ,but it did not work!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 18, 2009 9:21 pm
Reply with quote

Upon further review, the trailing + didn't work but the trailing backslash did (as long as there's no space between the last character and the backslash).

For #2, I ran this JCL
Code:
//BPXBATCH EXEC PGM=BPXBATCH,
//         PARM='sh',
//         REGION=0M
//SYSPRINT DD SYSOUT=*
//STDOUT DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stdout',
// PATHOPTS=(OWRONLY,OCREAT),PATHMODE=SIRWXU
//STDERR DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stderr',
// PATHOPTS=(OWRONLY,OCREAT),PATHMODE=SIRWXU
//STDIN   DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stdin'
with this input in STDIN:
Code:
touch /u/tech/ttssrs0/bpxbatch.031809.output
cp /u/tech/ttssrs0/bpxtest.090317.out\
   /u/tech/ttssrs0/bpxbatch.031809.output
and the copy worked fine.

As far as #1 goes, this JCL:
Code:
//BPXBATCH EXEC PGM=BPXBATCH,
//         PARM='sh',
//         REGION=0M
//SYSPRINT DD SYSOUT=*
//STDOUT DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stdout',
// PATHOPTS=(OWRONLY,OCREAT),PATHMODE=SIRWXU
//STDERR DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stderr',
// PATHOPTS=(OWRONLY,OCREAT),PATHMODE=SIRWXU
//STDIN   DD PATH='/u/tech/ttssrs0/bpxbatch.031809.stdin'
//STDENV  DD PATH='/u/tech/ttssrs0/bpxbatch.031809.longparm'
with STDEJNV file value of
Code:
STORAGE_VALUE=VOLSER(variable1,variable2,variable2,variable3,variable4,variable5,variable6,variable7,variable8)
and an env command in STDIN produced output of
Code:
STORAGE_VALUE=VOLSER(variable1,variable2,variable2,variable3,variable4,variable5,variable6,variable7,variable8)
MAIL=/usr/mail/TTSSRS0
PATH=/bin:/usr/sbin/:/usr/lpp/perl/bin/:/usr/local/bin/:/usr/lpp/internet/sbin/:
TMPDIR=/u/tech/ttssrs0/tmp
EDITOR=ed
_BPXK_AUTOCVT=ON
SHELL=/bin/sh
PS1=$LOGNAME:$PWD: >
_CEE_RUNOPTS=XPLINK(ON)
_=/bin/env
LOGNAME=TTSSRS0
LANG=C
LIBPATH=/lib:/usr/lib:.:/usr/lpp/perl/lib/5.8.7/os390-thread-multi/CORE:/usr/loc
HOME=/u/tech/ttssrs0
TZ=EST5EDT
MANPATH=/usr/man/%L:/usr/lpp/perl/man/C
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat:/usr/lpp/gskssl/lib/nl
(not all the data is listed -- just enough to show what is going on).
Back to top
View user's profile Send private message
PKONDURI

New User


Joined: 17 Mar 2009
Posts: 11
Location: PUNE,India

PostPosted: Thu Mar 19, 2009 2:54 pm
Reply with quote

Thanks a tonne Robert,
I have made changes as you suggested..It worked..two of issues i was facing are solved!
I would also want to mention that i am quite amazed to see your turn arround time...
Great work!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 19, 2009 5:21 pm
Reply with quote

Glad to hear you got both issues resolved. You got lucky that I happened to be able to look quickly at your issues!
Back to top
View user's profile Send private message
PKONDURI

New User


Joined: 17 Mar 2009
Posts: 11
Location: PUNE,India

PostPosted: Thu Mar 19, 2009 5:32 pm
Reply with quote

Hi,
In the above solution we are passing SYSIN data as a unix file ,
Can i create contents of the unix file using batch processing using any utility?
I tried
Code:
echo "xyz\" >> /targetunixfile

I am not able to append "\" at the end!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 19, 2009 5:37 pm
Reply with quote

Put your command in a normal MVS file. You can then use OPUT to move it to a Unix file:
Code:
//OPUT     EXEC PGM=IKJEFT01,DYNAMNBR=400,REGION=0M
//SYSPRINT DD   SYSOUT=*
//SYSTSPRT DD   SYSOUT=*
//SYSTSIN  DD   *
  OPUT 'PGMR.RS0.JAVA.DAT' -
       '/u/tech/ttssrs0/dat'
moves PGMR.RS0.JAVA.DAT to /u/tech/ttssrs0/dat in Unix.
Back to top
View user's profile Send private message
PKONDURI

New User


Joined: 17 Mar 2009
Posts: 11
Location: PUNE,India

PostPosted: Fri Mar 20, 2009 7:47 pm
Reply with quote

Thanks robert!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top