Using the CA7/ISPF Interface, changes to queue JCL are not always saved as expected. Why?

Document ID : KB000046082
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

Using the CA7/ISPF Interface, edits to queue JCL are not always saved back to the CA7 request queue as expected. Why?

Environment:  

CA7/ISPF Interface

Answer:

When using the CA7/ISPF interface for editing JCL, jobs already in the CA7 request queue and jobs fetched from a JCL source library (FE from JCL panel DB.7) should be handled differently. This is because when queue JCL is edited, the intent is to replace the queue JCL with changes made but in the case of JCL fetched from a source library, the intent is usually NOT to replace the source JCL with changes made, but rather to save the changed job to the CA7 Override library for “next time” execution only. The best practice to follow is: 
- When editing queue JCL, always save with command CA7SR. 
- When editing JCL fetched from a JCL library, not in the CA7 queues, always save your changes with CA7SAVE. This will bring you back to the DB.7 panel where you can issue a SAVE to the 254 override library. 

A couple of things to keep in mind; 
Once the CA7SAVE command is issued from ANY CA7/ISPF edit panel, a variable is set in the editor to issue the same command on all subsequent edit sessions, until the user logs off this TSO session or until the variable is reset by issuing the CA7SR command. The current variable that is in effect can be seen in every edit session, immediately after the TOP OF DATA and prior to JCL statements as shown below:

Command ===> 
****** ***************************** Top of Data ************
==MSG> IF DATA IS SAVED, A CA7 SR WILL BE EXECUTED <<==DEFAULT VARIABLE IN EFFECT 
000001 //JOBCARD JOB (ACCTINFO),'PNAME',NOTIFY=&SYSUID, 
000002 // CLASS=A,MSGCLASS=X,PERFORM=999 

****** ***************************** Top of Data *********
==MSG> IF DATA IS SAVED, A CA7 SAVE WILL BE EXECUTED <<==VARIABLE IN EFFECT AFTER ISSUING A CA7SAVE COMMAND
000001 //JOBCARD JOB (ACCTINFO),'PNAME',NOTIFY=&SYSUID, 
000002 // CLASS=A,MSGCLASS=X,PERFORM=999 

When the JCL above is edited again and a CA7SR is issued the variable is reset to “CA7 SR” as shown below:
****** ***************************** Top of Data ***********
==MSG> IF DATA IS SAVED, A CA7 SR WILL BE EXECUTED <<==VARIABLE RESET TO “CA7 SR” 
000001 //JOBCARD2 JOB (ACCTINFO),'PNAME',NOTIFY=&SYSUID, 
000002 // CLASS=A,MSGCLASS=X,PERFORM=999 

As you can see from the above examples, it is fairly easy to determine what action will be taken if SAVE, or PF3 (END) is issued. However, if you always save in the methods described above (CA7SAVE for non-queue JCL’s, CA7SR for queue JCL’s) the desired results will be achieved. 

Additional Information:

CA Workload Automation CA 7 Edition Database Maintenance Guide.