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

Can we declare temporary dataset without name


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sachin_kaushik84

New User


Joined: 03 Oct 2008
Posts: 23
Location: noida

PostPosted: Wed Nov 19, 2008 3:06 pm
Reply with quote

1. Can we declare temporary dataset without name?
2. How can we declare a db2 data type(varchar) filelds in the cobol declaration?
3. Suppose we have a proc step,
//step1 exec procname
//d1 dd dsn=dsn1
// dd dsn=dsn2
// dd dsn=dsn3
// dd dsn=dsn4

How can we override dsn2 from job?

4. what is the datatype of S9(4)A(4) variable?
5. can redefines come before the occurs clause or vice versa?
6. In a Job there r 100 steps how can we execute only 28 , 60 ,and 96 steps ?
7. Can Proc A call to B and B TO C and C To A? Is it possible? I mean to say is to possible to call proc from another proc?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 19, 2008 3:20 pm
Reply with quote

Topic moved to correct forum.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Wed Nov 19, 2008 3:20 pm
Reply with quote

1) yes we can declare a temporary dataset without name it would be decalred as &&temp
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 19, 2008 3:30 pm
Reply with quote

mambopras wrote:
1) yes we can declare a temporary dataset without name it would be decalred as &&temp

I suggest that you try a DD with no DSN and see what the OS really generates.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 91
Location: Hyderabad

PostPosted: Tue Dec 23, 2008 1:39 pm
Reply with quote

Hi.
2.
Code:

01 Var.                                   
   05 VAR-LENGTH                 PIC S9(4) COMP.
   05 VAR-DATA.                   PIC X(SIZE)           
 


3.
Code:

//STEP1.D1 DD DSN=DUMMY,
//               DD  DSN=dsn2,DISP=SHR



Correct me If I am worng ..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Dec 23, 2008 2:46 pm
Reply with quote

dp33770 wrote:
3.
Code:

//STEP1.D1 DD DSN=DUMMY,
//               DD  DSN=dsn2,DISP=SHR

Correct me if I am wrong ...

The DD is a concatenation rather than a single dataset and special care is needed. The first DD DUMMY in your reply will end the concatenation. Also, the question was to override dsn2 from the step.
Code:

//STEP1.D1 DD
//         DD DSN=dsn3
//         DD DSN=dsn4
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 24, 2008 8:01 pm
Reply with quote

Hi DeeP,

You wrote:
Quote:
Code:

01 Var.
05 VAR-LENGTH PIC S9(4) COMP.
05 VAR-DATA. PIC X(SIZE).

As I remember a DB2 Var Char was defined:
Code:
01 Var.                                   
   49 VAR-LENGTH                 PIC S9(4) COMP.
   49 VAR-DATA.                   PIC X(SIZE). 

Unless they changed it.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 24, 2008 8:17 pm
Reply with quote

Quote:
4. what is the datatype of S9(4)A(4) variable?

The datatype is invalid - it won't compile.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Dec 24, 2008 8:29 pm
Reply with quote

PIC S9(4)A(4) would be invalid but PIC A(4) would be okay. I haven't used the A picture symbol since experimenting with picture clauses when first learning COBOL, but it should work. See publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR30/5.3.12.1?DT=20050714120224#TBLWQ372
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 24, 2008 9:20 pm
Reply with quote

The presence of the S in the field causes it to be invalid and flagged with an S level compiler error. I tested a PIC 9(4)A(4) field (without the S) and that compiles fine.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 24, 2008 9:38 pm
Reply with quote

expat,

For overriding the 2nd dataset in the concatenation, should n't it be something like this.

Code:
//STEP1.D1 DD
//         DD DSN=new-dataset
//         DD
//         DD
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top