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

Control card updation


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Aug 18, 2010 3:17 pm
Reply with quote

Hi,

I have a requirement to work on but I am not sure whether it will work as I had never worked on anything like this. please let me know if satisfying the following business requirement is feasible or not?

I have a ctlcard containg 6 digit agent codes which needs manual updation by adding or deleting agent codes from it every monday for that night's batch run.
Now they want to automate the manual process of this control card updation process as this involves lot of release procedure related activity.

The requirement comes as

1. there will be two files each having 6 bytes length one containing the codes to be added and other to be deleted.
2. A program will read the files and update the ctlscard (A PDS member) accordingly like if the input code is already present in the ctlcard it will bypass that code and write if its not present. same logic for deletion.

Now as this requires read the control card record by record like a file and process accordingly. I am not sure whether a PDS member can be declared as a file in the jcl and can be read/update like a file in COBOL program. Is this feasible?

Please advise.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 18, 2010 3:31 pm
Reply with quote

Souren wrote:
Is this feasible?

**Sigh** yes

remember to always use DISP=SHR on any DD statements referencing the PDS Member.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Aug 18, 2010 5:14 pm
Reply with quote

COBOL:
Code:
SELECT FDname assign to DDname

JCL:
Code:
//DDname DD dsn=PDSname(membername)
And I hope, for the given problem, there is only one member which you want to read?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 18, 2010 5:56 pm
Reply with quote

remember, he has to potentially update the member
because he is comparing the existing contents to the contents of the
use and not-use files
that means read and write.

The TS is also implying that all three files will be multi-record.

logically, it would be simpler to have 4 FDs, removing Input/output logic problem from the code
  • original member
    • open input
    • load to cobol internal table
    • display records read
    • close
  • codes to use
    • open input
    • read and add to CI table
    • close
  • codes to drop
    • open input
    • read and delete from CI table
    • close
  • newly created member
    • open output
    • write active table items
    • close


I added a display records read incase there is a problem
  • program bug
  • wrong add file
  • wrong del file
the member could be manually rebuilt from the sysout by virtue of EDITing the sysout and using ISPF EDIT REPLACE Member statement.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Aug 20, 2010 12:47 pm
Reply with quote

'newly created member' - But the requirement is to update that specific ctlcard only which will later be used by other jobs. So might be a copy step in the job will replace the original member with the newly created one.

One more thing...the contents in that ctlcard will keep updating regularly changing the number of records in it. In that case how would I determine the size of the array to load the ctlcard in it or simply predefining the array with 999 will be a good way out?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 20, 2010 2:30 pm
Reply with quote

Quote:
So might be a copy step in the job will replace the original member with the newly created one.


1. original member and newly created member are the same dsn. That is why I said 4 FD's instead of 3.

2. how many potential 6-digit agent codes are there? 999,999.
if alpha is also part of the agent code then there are more.
so you need a COBOL Internal Table of 999,999 items.
In COBOL the term array only refers to db2 host variable arrays,
otherwise the term is COBOL Internal Table.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Aug 20, 2010 2:54 pm
Reply with quote

Ohh...got it now...Thanks a lot for the help I will try it out!
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Aug 20, 2010 6:11 pm
Reply with quote

Few more things thing came up while going through the detailed req...

o Run new job with both files empty
 Job runs successfully and e-mail notification triggered and sent

o All code numbers in add file already exist, delete file is empty
 Job runs successfully and e-mail notification is triggered.

o All codes in delete file do not exist in control card, add file is empty
 Job runs successfully and e-mail notification is triggered.

What I understand to be done, is to add a SMTPMAIL utility in the next step of my job which executes the program.The MAIL step in the job will run based on condition code of its previos step. And in the program the situation can be captured by the use of flags for the above conditions.

Now, how will I pass the custom condition code to my jobstep which runs this program...or some other ways are thr to achieve this..Please advice.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Aug 20, 2010 6:19 pm
Reply with quote

One other way that came up to my mind is...after creating the new member I can add a SUPERCE step in my job to compare the back up of the original ctlcard(preferebly a temp file) and the newly replaced ctlcard...If the RC is zero next step will shoot the mail..
would it work that way?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 20, 2010 6:57 pm
Reply with quote

ksouren007 wrote:
One other way that came up to my mind is...after creating the new member I can add a SUPERCE step in my job to compare the back up of the original ctlcard(preferebly a temp file) and the newly replaced ctlcard...If the RC is zero next step will shoot the mail..
would it work that way?


why do that?
In the program, have logic to set a 'flag' if
  • a 'to be deleted' is found in existing
  • a 'to be added' is not found in existing

both situations indicate a change to the original. Set the return-code special register upon exit from program.
Also, what do you do if a 'delete' = 'add'?
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Mon Aug 23, 2010 11:36 am
Reply with quote

delete=add will automatically taken care by the logic of 'bypass if present for add'...
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Mon Aug 23, 2010 3:50 pm
Reply with quote

One question...If a VSAM file is used instead of Cobol Internal Table will it be any difference in the I/O overhead?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 23, 2010 3:51 pm
Reply with quote

ksouren007 wrote:
One question...If a VSAM file is used instead of Cobol Internal Table will it be any difference in the I/O overhead?


only the i/o concerned with the vsam file.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Aug 25, 2010 8:36 pm
Reply with quote

Thanks everyone and dbz for all your help.

I could able to solve the problem through a Proc alone and program was not needed. Just the delete process was a bit complex with ICETOOL but with help from the forum it was solved too...its working fine now..

Thanks again for you help..!!
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts Need suggestion on a sort card DFSORT/ICETOOL 10
No new posts Want to mask Middle 8 Digits of Debit... COBOL Programming 3
Search our Forums:

Back to Top