View previous topic :: View next topic
|
Author |
Message |
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
How to Copy Current Date to A PS File thru JCL(Without Instream Option)?
For Ex:I will be having a Varible called LASTSATDATE in job which will get a value from COntrolM and I want this to be used as Parm or control-card for the program. IF I used it as a Instream in a job processor group for the job not getting generated and element is getting transfered back to test |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
'am not very sure what "For Ex" part of your post is asking, however to get system date in PS (QSAM) you might use this:
Code: |
//STEP002 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD DSN=XXXXXX.TEST.SYSTEM.DATE,DISP=(NEW,CATLG,CATLG)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(DATE=(MD4-))
/*
//* |
|
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
I have to copy the date filed into ps file every week so i have coded a jcl for getting the required date as mentioned below..,
Code: |
//* %%SET %%CURRENT = %%SUBSTR %%DATE 1 1
//* %%IF %%CURRENT EQ 9
//* %%SET %%CENT = 19
//* %%ELSE
//* %%SET %%CENT = 20
//* %%ENDIF
//* %%SET %%DX1 = %%CALCDATE %%ODATE -6
//* %%SET %%DM1 = %%SUBSTR %%DX1 3 2
//* %%SET %%DD1 = %%SUBSTR %%DX1 5 2
//* %%SET %%DY1 = %%SUBSTR %%DX1 1 2
//* %%SET %%LASTSAT = %%DY1%%.%%DM1%%.%%DD1 |
----------------------------
Given override in the job to copy into flat file
Code: |
//PSTEP010.SYSUT1 DD *
NORMAL
%%LASTSAT%%.05060708091011
//* |
Proc:
Code: |
//PSTEP010 EXEC PGM=IEBGENER
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DUMMY,DCB=(BLKSIZE=0,LRECL=80,RECFM=FB)
$/PSTEP010.SYSUT1 DD *
//SYSUT2 DD DSN=DATEPARM.FILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=(BLKSIZE=0,LRECL=80,RECFM=FB),
// UNIT=SYSDA,SPACE=(TRK,(2,2),RLSE)
//SYSIN DD DUMMY
//* |
I am using the variable %%LASTSAT as instream for copying into PS file. However it's working fine for testing purpose but while trying to promote production, element got transferred to test saying that instream not allowed.
Is there any other way to do this?
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
gopinath,
I am quite not sure of what you're trying to achieve here. What is the content of your 'DATEPARM.FILE' after the execution of above job? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hello,
Instream Data is not allowed in PROCs, may be this is the reason whay this
Quote: |
element got transferred to test saying that instream not allowed |
comes.
And please tell us (to me at least), What do you expect from this code
Code: |
//* %%SET %%CURRENT = %%SUBSTR %%DATE 1 1
//* %%IF %%CURRENT EQ 9
//* %%SET %%CENT = 19
//* %%ELSE
//* %%SET %%CENT = 20
//* %%ENDIF
//* %%SET %%DX1 = %%CALCDATE %%ODATE -6
//* %%SET %%DM1 = %%SUBSTR %%DX1 3 2
//* %%SET %%DD1 = %%SUBSTR %%DX1 5 2
//* %%SET %%DY1 = %%SUBSTR %%DX1 1 2
//* %%SET %%LASTSAT = %%DY1%%.%%DM1%%.%%DD1 |
|
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
Thanks for the reply.
NDVR IS NOT ALLOWING INSTREAM DATA IN the JOB itself that's the reason job got transferred to test.
Job runs on every fri day. Need to get last saturday date from the code and update the same in ps file.
DATEPARM.FILE should contain the below data for this week
Code: |
NORMAL
09011405060708091011 |
Next week, should be
Code: |
NORMAL
09012105060708091011 |
Is there any other way to do this? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
the override statement should be included inside the job that executes the PROC and not inside the PROC.
Also you cannot resolve Control-M variables in a PROC.
Anuj: the code is using Control-M auto edit variables to obtain last Saturday's date. The code is fine.
Gerry |
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
gcicchet,
I am able to copy last saturday date into a PS file in above method i mentioned.
Only issue in this method, NDVR is not allowing INSTREAM DATA in the JOB saying "instream not allowed".
Is there any method other than the above to get the last saturday date?
Can we get with EZACFSM1 ?
Thanks in advance. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Thanks Gerry - I do not use Contol-M so was not aware of it's coding and asked.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
What about a REXX step using the Control M variable in the PARM statement ?
*** UNTESTED - as we use TWS ***
Code: |
//STEP0020 EXEC PGM=IKJEFT01,DYNAMNBR=256,
// PARM='Rexx_name %%LASTSAT%%.05060708091011 '
|
Which would resolve the variable in the PARM statement because it is in the JCL and then be processed in the REXX statements to write to a file.
Code: |
/* REXX */
ARG DATEBIT .
QUEUE DATEBIT
"EXECIO "QUEUED()" DISKW ddname ( FINIS"
|
|
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
could you please elaborate the piece of code what it does?
Code: |
/* REXX */
ARG DATEBIT .
QUEUE DATEBIT
"EXECIO "QUEUED()" DISKW ddname ( FINIS" |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
It reads the value from the PARM in the EXEC card and then writes it out to whatever is allocated to the DD ddname |
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
expat,
I don't know REXX. Please provide me the sample example. Will test and let you know. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
Will test and let you know. |
Good, as the concept has been tested, just the Control M needs to be tested.
The JCL
Code: |
//STEP0020 EXEC PGM=IKJEFT01,
// PARM='Rexx_name %%LASTSAT%%.05060708091011 '
//SYSEXEC DD DSN=PDS where Rexx_name lives,DISP=SHR
//STRUC DD DSN=Dataset name for output,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
|
So the REXX code, stored in member Rexx_name (Or whatever you want to call it) in the PDS above will be
Code: |
/* REXX */
ARG DATEBIT .
QUEUE DATEBIT
"EXECIO "QUEUED()" DISKW STRUC ( FINIS"
|
|
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
expat,
Thank you.
I tested the code and it's working fine.
Removed '.' in b/n lastsat filed and numeric data and tested.
Code: |
PARM='Rexx_name %%LASTSAT%%05060708091011 ' |
Output file is writting only date part.
My output file should be like this.
Code: |
NORMAL
09011405060708091011 |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
OK, change the REXX to this
Code: |
/* REXX */
ARG DATEBIT AN1 AN2 AN3 .
QUEUE DATEBIT
"EXECIO "QUEUED()" DISKW STRUC ( FINIS"
Say DATEBIT AN1 AN2 AN3
|
And let me know what the output. |
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
STRUC DDname output
Code: |
0901175060708091011 |
SYSTSPRT ddname output:
Code: |
0901175060708091011
READY
END |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Aaaaaaaaaaaaaaaaaaaaaaaaaaaah, just seen what you want. Sorry I missed it first time around but I'm a bit busy
Try this
Code: |
/* REXX */
ARG DATEBIT .
QUEUE "NORMAL"
QUEUE DATEBIT
"EXECIO "QUEUED()" DISKW STRUC ( FINIS" |
|
|
Back to top |
|
|
gopinath
New User
Joined: 19 Jan 2004 Posts: 9 Location: Chennai
|
|
|
|
Thank you very much...expat.
It's working. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
No problems, invoice is in the mail |
|
Back to top |
|
|
|