View previous topic :: View next topic
|
Author |
Message |
Ganesh N
New User
Joined: 09 May 2008 Posts: 7 Location: Kochi
|
|
|
|
Hi,
I found trouble in incrementing the sequence number which is being appended in the file name.
For first run the file name is AEBCQ01P.001 in JCL,but it should be as AEBCQ01P.002 for the 2nd run. This file name is specified in SYSIN card itself.
Please help to solve this issue. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Can you post the sample input and expected output? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
1. AEBCQ01P.001 is not a valid file name in JCL -- every level must start with a letter or symbol, not a number.
2. What you want to do cannot be done through pure JCL -- you will need to write a program to submit your JCL to the internal reasder with the correct sequence number in the correct spot.
3. Why not just use a GDG which is already part of the system rather than reinvent the wheel? |
|
Back to top |
|
|
Ganesh N
New User
Joined: 09 May 2008 Posts: 7 Location: Kochi
|
|
|
|
Hi,
My JCL is used to transmit the file to different location. I have coded as below
Code: |
//STEP10 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
&FROMDSN='PV1376A.GRAUD540.SEND - /* LOCAL DATASET*/
&FDISP=DISP=(SHR) - /* FROM DISP */
&FDCB=DCB=(DSORG=PS) - /* DCB INFO */
&TDISP=NEW - /* TO DISP */
&FILENAME=AEBQC01P.001 - /* REMOTE FLE NAME */
/*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,9,CH,EQ,C'&FILENAME'),
OVERLAY=(20:20,3,ZD,ADD,+1,ZDF,LENGTH=3))
/*
|
In the above JCL, my aim is to increment the &Filename after each run. As
AEBQC01P.002 in the 2nd run, AEBQC01P.003 in 3rd and so on |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
In order to increment the run number, you will need to store the information in a file, I would then add a step to the job to increment the number like below
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
&FILENAME=AEBQC01P.001 - /* REMOTE FLE NAME */
/*
//SORTOUT DD DSN=OUTPUT-FILE
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(20:20,3,ZD,ADD,+1,ZDF,LENGTH=3)
|
SORTIN DD * will need to be the OUTPUT-FILE (GDG files would very useful)
ie.
SORTIN DD DSN=FILE(0)
SORTOUT DD DSN=FILE(+1)
Now you can concatenate the (+1) FILE in your step.
Gerry |
|
Back to top |
|
|
|