View previous topic :: View next topic
|
Author |
Message |
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi all,
i need copy a variable defined in the jcl into a 80byte flate file. i tried to use sort but failed.
for example,
Code: |
// set HOST='10.0.858.88'
//*i need to copy &HOST into a 80byte file.
|
thanks, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
i tried to use sort but failed. |
Well, not being psychic I can not see either your SORT statement or the output from the SORT step.
Perhaps if you bothered to post the relevent information people would be able to help you. |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Basically i need to copy the variable into a flat file. i used sort but not sure if that i a valid. please let me know how to copy the variable value into a flat file.
Code: |
//SORTIN DD *
&HOST
/*
//SORTOUT DD DSN=X.Y.Z,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
SORT FIELDS=COPY
/*
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You can not use symbolic substitutiions in instream, as used in your sysin.
These will not be substituted |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Ok. is there any way or utility to capture the value of that variable into a 80 byte file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Try this
Code: |
//SORTIN DD DSN=where your JCL is,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,80,SS,EQ,C'HOST')
/* |
|
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi expat,
i tried your code but i'm not geting the desired output. I got the following output
Code: |
// SET HOST='123.456.789'
|
But i only need the value. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm not aware of any standard utility that will let you pass a parm value from the JCL into an output dataset. If your site has a need to do this, then I'd suggest that you have your own in-house utility coded up to accomplish this task. You could, of course, easily accomplish this with any number of langauges or tools, such as COBOL/Assembler/PLI/REXX/CLIST/SAS/Easytrieve, etc.
Certainly easily doable with REXX:
Code: |
//*
// SET HOST='10.0.858.88'
//*
//STEP0001 EXEC PGM=ICEGENER
//SYSUT1 DD *,DLM=@@
PUSH ARG(1)
"EXECIO 1 DISKW OUT (FINIS"
EXIT 0
@@
//SYSUT2 DD DSN=&&PDS(X),DISP=(,PASS),UNIT=VIO,
// SPACE=(TRK,(1,1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//STEP0002 EXEC PGM=IRXJCL,PARM='X &HOST'
//SYSEXEC DD DSN=&&PDS,DISP=(OLD,DELETE)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//OUT DD SYSOUT=*,RECFM=FB,LRECL=80
|
|
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Hi,
I agree with Kevin. Utility to copy Symbolic Parameters vary from sit to site. At our site we use following utility
Code: |
//SET1 SET HOST='10.0.858.88'
//STEPCPY EXEC PGM=K9801GCP,
// PARM=(,SFILE,&HOST)
//
//SFILE DD DSN=&&TEMP,DISP=(NEW,PASS)
//SYSPRINT DD SYSOUT=&CLS
|
Note: I have used a temporary file, which can be replaced with actual DSN
Cheers!!
Happy Coding |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Thanks for the help. But one think that i though is to write a small program, pass the value as a parm then write it to output file. this can be done in no time. But anyhow will try to find if any such utility is available in my shop.
thanks for your time and help. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
One simple approach:
Code: |
// SET HOST='10.11.12.13'
//CREATE EXEC PGM=IEBGENER
//SYSUT1 DD *
Queue Arg(1)
'EXECIO 1 DISKW OUT (FINIS'
Return rc
//SYSUT2 DD DISP=(,PASS),DSN=&&EXEC(MYEXEC),SPACE=(TRK,(1,1,1))
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//*---------------------------------------------------------------
//WRITE EXEC PGM=IKJEFT01,PARM='%MYEXEC &HOST'
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&EXEC
//OUT DD DISP=OLD,DSN=MBB1986.OUTPUT.FILE
//SYSTSIN DD DUMMY
//SYSTSPRT DD DUMMY |
drop the 1st step if your exec is already in a pds soomewhere |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
One simple approach: |
MBabu,
Is this different from the solution which Kevin had already posted? |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
arcvns wrote: |
Is this different from the solution which Kevin had already posted? |
No. I just wasn't paying attention |
|
Back to top |
|
|
|