How to write next record in VSAM using Information expert

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

How to write next record in VSAM using Information expert

Post by anilanju » Tue Dec 30, 2008 4:50 pm

HI

I am facing a problem, i have declared a Vsam(ksds), in a Information expert program.I want to write a record , its doin that but when the program is used for different sources ,its over writes the previous record of another source instead of adding a next record.

Can anyone please tell me what to do to solve this problem?

Thanks Anu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Dec 30, 2008 5:47 pm

Hi,

You didn't give us enough information to work with. Please show the scrap of code which is writing to the file.

What DISP do you use for VSAM by the way ?
Regards,
Anuj

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Tue Dec 30, 2008 6:35 pm

Hi Anuj

I am using disp= mod.

This is code
WRITE FSTTOT-TRANS-REC,
this record i have defined in Dframe which is like copy book in Cobol.

Thanks Anu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Dec 31, 2008 9:24 am

Hi,

Once again, please let me know what does this mean,
when the program is used for different sources
previously I thought VSAM is being updated by multiple programs but you say "program" is being used for different sources, what does that mean ?
Regards,
Anuj

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Wed Dec 31, 2008 2:04 pm

HI

It means that we are using the same program for various soucres like, we get data from diffrent feeds(input).

Thanks Anu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sat Jan 03, 2009 12:32 pm

Hi Anu,

'am still not clear with what is happening at your end, however please have a look at this maual, hopefully it'll help you.

When you say this
It means that we are using the same program for various soucres like, we get data from diffrent feeds(input).
Does that mean that your program can get input from multiple sources and using all those inputs you want to write records only in a single VSAM ? If yes, then actually that does not provide me anything to answer your original question - you've got a single source program some input & one VSAM output but when you write second record in VSAM it does not work, is this your question ?
Regards,
Anuj

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Mon Jan 05, 2009 2:13 pm

Hi Anuj

Yes this is my question.Whenver i try to run the program for any other input, it simply overwrite the previous record instead of adding a new one.
This program has other outputs also which are working fine.

At a time i use this program for one source only.

I tried to use a sequential file instead of VSAM file, then it worked fine, but i need a VSAM file..

Hope this makes my point a bit clear.

Thanks
Anu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Jan 05, 2009 5:16 pm

Hi,

If it works for flat file it should work for VSAM, please post the full code you are using & the VSAM definition (IDCAMS Define).
Regards,
Anuj

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Mon Jan 05, 2009 5:33 pm

Hi

Code for VSAM DEF:

//SYSIN DD *
DELETE FST.TST3.ALL.REPORT.CLUSTER CLUSTER PURGE
SET MAXCC EQ 0
DEFINE CLUSTER -
(NAME(FST.TST3.ALL.REPORT.CLUSTER) -
TRACKS(50 50) -
MODEL(FST.TST3.TP.BRD.CLUSTER) -
IMBED -
IXD -
REUSE -
RECSZ (80 80) -
KEYS (10 0) -
) -
DATA -
(NAME(FST.TST3.ALL.REPORT.DATA) -
CISZ(18432)) -
INDEX -
(NAME(FST.TST3.ALL.REPORT.INDEX))


Program code:this is an Information expert code not cobol,

ATTACH FSTOTRPT CREATE


FSTOTRPT:FSTFMT-APPLN = FSTFMT-APPLN
FSTOTRPT:FSTFMT-JRNL-DATA-TYP = FSTFMT-JRNL-DATA-TYP
FSTOTRPT:FSTFMT-SRCE = FSTFMT-SRCE
FSTOTRPT:FSTFMT-JRNL-ID = FSTFMT-JRNL-ID
FSTOTRPT:FSTFMT-PRD = FHDER-FSTFMT-PRD
FSTOTRPT:FSTFMT-WEEK = FHDER-FSTFMT-WEEK
FSTOTRPT:FSTFMT-DY = FHDER-FSTFMT-DY
FSTOTRPT:FSTTOT-COUNT = ACCT-TOTAL-IN
FSTOTRPT:FSTTOT-SUSCOUNT = ACCT-TOTAL-SUS

WRITE FSTTOT-TRANS-REC

this is a Vsam record.

Thanks
Anu

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Jan 06, 2009 8:02 pm

Hi,

You bowled me out - I don't know coding in Information expert but basic idea should be similar to COBOL, you might try your luck in google:

http://www.google.co.in/search?hl=en&q= ... VSAM&meta=
Regards,
Anuj

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Tue Jan 06, 2009 8:17 pm

Hi Anuj

So sorry, but yes it is similar to COBOl, an quiet easy to code than Cobol,

Here we don have to open or close files lik cobol we simply attach them n they r ready to use, when i use this code for sequential file it is working perfectly fine but not for VSAM.

Thanks

Anu

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others