Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to increment sequence number in file name itself

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Ganesh N

New User


Joined: 09 May 2008
Posts: 7
Location: Kochi

PostPosted: Tue Oct 07, 2008 8:35 pm    Post subject: How to increment sequence number in file name itself
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Tue Oct 07, 2008 8:36 pm    Post subject:
Reply with quote

Can you post the sample input and expected output?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8055
Location: East Dubuque, Illinois, USA

PostPosted: Tue Oct 07, 2008 8:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Ganesh N

New User


Joined: 09 May 2008
Posts: 7
Location: Kochi

PostPosted: Tue Oct 07, 2008 8:57 pm    Post subject: Reply to: How to increment sequence number in file name itse
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Oct 08, 2008 4:47 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us