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

how to update suffix of ps every month


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksreddy

New User


Joined: 30 Mar 2005
Posts: 12
Location: Hyderabad

PostPosted: Tue Aug 02, 2005 10:14 am
Reply with quote

Hi,
my sort program looks like this,

//act001 exec pgm=sort
//sortin dd dsn=abc.xyz.pqr.aug05,disp=shr
//sortout dd dsn=...............,disp=shr
//......
//.....

so,every month suffix of sortin dd name should be changed.
i.e., next month my sortin dd name should be
//sortin dd dsn=abc.xyz.pqr.sep05

how can i get this

regards,
santhosh
Back to top
View user's profile Send private message
varun_sharma

New User


Joined: 08 Jun 2005
Posts: 19
Location: new delhi

PostPosted: Tue Aug 02, 2005 10:19 am
Reply with quote

Hi

U can write define ur files in a proc and use symbolic parameters there, else u can also use overriding parameters. Bt u need to pass values every month, it can't just change the name of the file by itself.

Plz let me know if there's some other way out.

Varun Sharma
Back to top
View user's profile Send private message
shinjini_t

New User


Joined: 11 May 2005
Posts: 14
Location: Bangalore, India

PostPosted: Tue Aug 02, 2005 10:56 am
Reply with quote

to avoid such manual efforts we use generation datasets! Try using them then no one needs to manually update the name of the dataset in the JCL.

Shinjini
Back to top
View user's profile Send private message
ksreddy

New User


Joined: 30 Mar 2005
Posts: 12
Location: Hyderabad

PostPosted: Tue Aug 02, 2005 11:18 am
Reply with quote

Hi Shinjini,
we can use gdg but with gdg we can create gdg's of same name and we can change generations but here case is different.

i want suffix should be changed every month.
now we are using procs there we change suffix every month
how can we get this with out manual effort

regards,
santhosh
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 02, 2005 3:50 pm
Reply with quote

As varun_sharma mentioned, you're going to have to create and use symbolic parameters. My thought - keep the value you want in a library and use a combination of JCLLIB, SET, and INCLUDE statements:

The library:
Code:

'MY.PDS(SUFFIX)' contains the one record:
// SET SUFF=SEP05


The job:
Code:

//MYJOB JOB (....),CLASS=X
//*
// JCLLIB ORDER=MY.PDS
// INCLUDE MEMBER=SUFFIX
//*
//ACT001 EXEC PGM=SORT
//SORTIN DD DSN=ABC.XYZ.PQR.&SUFF,DISP=SHR
//SORTOUT DD DSN=...............,DISP=SHR
Back to top
View user's profile Send private message
ksreddy

New User


Joined: 30 Mar 2005
Posts: 12
Location: Hyderabad

PostPosted: Tue Aug 02, 2005 6:56 pm
Reply with quote

Hi superk,

thankyou for u'r reply but every month we need to update member SUFFIX of MY.PDS. but in production we are not supposed to change pds members. so please suggest another option

regards,
santhosh
Back to top
View user's profile Send private message
Hari Kumar

New User


Joined: 28 Jul 2005
Posts: 19

PostPosted: Tue Aug 02, 2005 8:33 pm
Reply with quote

Hi Santhosh,

First Execute Cobol Program For Updating SUFF & Next step use SUFF[UPDATED VALUE]

COBOL PROGRAM STEPS
------------------------------
Code:
1) ACCEPT CURRENT DATE & MONTH [SYSTEM DATE]
      a)  Split date & Month
   
2) CHANGE SYSTEM DATE & SYSTEM MONTH TO USER FORMAT

EX
IF  MONTH = 04 THEN MOVE 'APR' TO MONTH1   

3) Write updated value to PS or PDS Member.


Let Me know If u need full coding for this
Back to top
View user's profile Send private message
ksreddy

New User


Joined: 30 Mar 2005
Posts: 12
Location: Hyderabad

PostPosted: Tue Aug 02, 2005 8:41 pm
Reply with quote

Hi Hari Kumar,

i didn't get you. please give full coding


thankyou for you'r reply


regards,
santhosh
Back to top
View user's profile Send private message
Prandip

New User


Joined: 04 Mar 2005
Posts: 84
Location: In my tiny cubicle ...

PostPosted: Tue Aug 02, 2005 10:53 pm
Reply with quote

ksreddy, the frustrating part of a post such as this is that you have not indicated what might be acceptable, what options you have already tried and rejected, and how you might want this to work in a production environment.

Why can't your job scheduling system (CA-7, CA-Scheduler, CA-JobTrac, Control-M, TWS/OPC) provide this information in the form of a symbolic variable to the job? That is one of their primary purposes.

If you have already ruled out that option, and the option Superk provided, then you are restricting your options to two methods.

One, dynamically allocate the SORTIN dataset and run SORT using the dynamically allocation:
Code:

//STEP0001 EXEC PGM=ICEGENER                                   
//SYSUT1   DD   DATA,DLM=@@                                   
/* REXX */                                                     
CURR_MMM = LEFT(DATE(M),3)                                     
CURR_YY  = LEFT(DATE(J),2)                                     
"ALLOC DD(SORTIN) DA('ABC.XYZ.PQR."CURR_MMM||CURR_YY"') SHR"   
IF RC <> 0 THEN EXIT 4                                         
"CALL *(SORT)"                                                 
EXIT 0                                                         
@@                                                             
//SYSUT2   DD   DSN=&&PDS(GETDATE),DISP=(,PASS),UNIT=VIO,     
//         SPACE=(TRK,(1,1,1),RLSE)                           
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   DUMMY                                         
//*                                                 
//STEP0002 EXEC PGM=IKJEFT01,PARM='%GETDATE'       
//SYSPROC  DD   DSN=&&PDS,DISP=(OLD,PASS)           
//SYSTSPRT DD   SYSOUT=*                           
//SYSTSIN  DD   DUMMY                               
//SORTOUT  DD  DSN=SORTOUT.DATASET,...
//SYSOUT   DD   SYSOUT=*                           
//SYSIN    DD  *
...
/*                                               


two, build and submit the entire job (or portions of the job) programatically.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
Search our Forums:

Back to Top