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

Want to create a KSDS file using cobol program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: Canada

PostPosted: Thu Jan 25, 2007 5:05 pm
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
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
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
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
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: 3156
Location: Tucson AZ

PostPosted: Mon Jan 29, 2007 3:21 pm
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
Reply with quote

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

Moderator Emeritus


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

PostPosted: Tue Jan 30, 2007 8:43 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top