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
 

 

Want to create a KSDS file using cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ashish_setia
Currently Banned

New User


Joined: 19 Jan 2007
Posts: 3
Location: noida

PostPosted: Thu Jan 25, 2007 4:43 pm    Post subject: Want to create a KSDS file using cobol program
Reply with quote

Q- I want to create a KSDS file using cobol program , somewhat like this
Environment Division
Input-output section.
File-control
Select file1 assign to ddname.*
Access mode is random.
Organization is dynamic.
File status is fs1.

Corresponding JCL would be somewhat like this
//jobcard
//step1 exec pgm=idcam
//sysprint dd sysout=a
//sysin dd *
Define cluster(name (a.b.c?.
?..
/*
My question is what should I write in ddname ? in the statement select file1 assign to ddname*
Please help?

Warning: Title edited from cobol[/b]
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Thu Jan 25, 2007 5:05 pm    Post subject: Re: cobol
Reply with quote

Quote:
Organization is dynamic.


I don't find any format as dynamic for Organization from the manuals.

Next,The ddname in the program will be the logical file name for the VSAM that you want to define.
In case of the JCL
Quote:
Corresponding JCL would be somewhat like this
Quote:
//jobcard
//step1 exec pgm=idcam
//sysprint dd sysout=a
//sysin dd *
Define cluster(name (a.b.c?.
?..
/*

is for defining the VSAM,the above jcl should be executed before running the program .
VSAM has to be present physically before you execute the program.
In case of the program JCL ,you will map the logical file name in the program to the physical file name in the DD step.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sun Jan 28, 2007 12:04 pm    Post subject:
Reply with quote

First create VSAM dataset
2nd In the program execution step just assign DD name which has the VSAM dataset
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Jan 28, 2007 12:22 pm    Post subject:
Reply with quote

Hi Ashish,

You wrote:
Quote:
Access mode is random.
Organization is dynamic.

Your choices are:
Code:
 Organization is indexed
Access mode is random
or
Code:
 Organization is indexed
Access mode is dynamic
or
Code:
 Organization is indexed
Access mode is sequential

If you choose "dynamic" you can then perform both random and sequential processing against your VSAM file.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Jan 29, 2007 2:52 pm    Post subject:
Reply with quote

Hi All,
As per the requirement we can Create a VSAM file and access the same in a single step, there are parameters in JCL which would help us to create the vsam file like any other ordinary PS or PDS and uiset he same in the executing cobol program, please refer to special dd parameters like DATACLAS, RECORG. Using these parameters u can create a VSAM data set with out using the IDCAMS utility, I will try to post the JCL if possible.

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
sumitchaturvedi_12

New User


Joined: 24 May 2005
Posts: 1
Location: bangalore

PostPosted: Mon Jan 29, 2007 3:13 pm    Post subject: how can i see the moved value in the variable
Reply with quote

I have one VSAM file many records are there when I am moving the record structure of this file to a another group variable at the time of testing I want to see the value of the variables ,whether it has moved correctly or not. we can not use display and pick option. how would i do this?

Thanks & Regards
Sumit Chaturvedi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jan 29, 2007 3:21 pm    Post subject: Re: how can i see the moved value in the variable
Reply with quote

sumitchaturvedi_12 wrote:
I have one vsam file many records are there when i am mooving the record structure of this file to a another group variable at the time of testing i want to see the value of the variables ,whether it has mooved correctly or not. we can not use display and pick option. how would i do this?
What are you using to move the record?
If you can't us display, what can you use?
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue Jan 30, 2007 8:08 am    Post subject:
Reply with quote

You can use expeditor and peek the variables.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jan 30, 2007 8:43 am    Post subject:
Reply with quote

Hello,

If you are not able to "display" the moved fields, you could write a new file with these fields as the record, then look at the file after the run completes. If they are not packed/binary fields, you could use SYSOUT for the file rather than a DSN. The test file would be removed after you are sure your moves work as needed.

If you don't want to add a file for this testing, you could do the move(s) in your code, force an abend (i.e. 0c7), then look in the dump for the moved data. I'd suggest putting an eye-cather before and after the fields you want to check.

Many sites do not allow "display" in production modules, but usually there is no problem having some display statements in a test program. Why can you not use display for your test?
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
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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