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
 

 

Control card updation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Control card updation
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    Post subject:
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

Senior Member


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

PostPosted: Wed Aug 18, 2010 5:14 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Control card updation
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    Post subject:
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    Post subject: Reply to: Control card updation
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    Post subject: Reply to: Control card updation
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    Post subject: Reply to: Control card updation
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    Post subject: Re: Reply to: Control card updation
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    Post subject: Reply to: Control card updation
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    Post subject: Reply to: Control card updation
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    Post subject: Re: Reply to: Control card updation
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    Post subject: Reply to: Control card updation
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
No new posts Control-M manuals JPVRoff All Other Mainframe Topics 0 Fri May 20, 2016 11:15 am
No new posts Performing addition using JCL sort card Shaheen Shaik DFSORT/ICETOOL 14 Fri May 06, 2016 12:25 pm


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