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
 

 

Can we declare temporary dataset without name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Can we declare temporary dataset without name
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: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 19, 2008 3:20 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 19, 2008 3:30 pm    Post subject:
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: 92
Location: Hyderabad

PostPosted: Tue Dec 23, 2008 1:39 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 23, 2008 2:46 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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 http://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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Dec 24, 2008 9:20 pm    Post subject:
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: 2276
Location: @my desk

PostPosted: Wed Dec 24, 2008 9:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm


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