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

What is difference between && temp and &temp


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

New User


Joined: 14 Jun 2006
Posts: 14

PostPosted: Mon Jun 19, 2006 10:59 am
Reply with quote

hi friends
i got one question
1.what is difference between && temp and &temp?

thanks in advance

regards
reena
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Mon Jun 19, 2006 11:55 am
Reply with quote

Single Ampersand (&) denotes a Symbloic Parameter, for which a value can be assigned in an Exec statement or on Proc staement and down the line u can use that parameter with prefix &.

Double ampersand (&&) denotes a temporary dataset.

u can get this info in any JCL book.

ksk
Back to top
View user's profile Send private message
reena_preethi

New User


Joined: 14 Jun 2006
Posts: 14

PostPosted: Mon Jun 19, 2006 12:01 pm
Reply with quote

thanks a lot ksk

regards
reena
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Jun 19, 2006 1:18 pm
Reply with quote

Reena,

& -->To identify a symbolic parameter, for example, &LIB
&& --> To identify a temporary data set name, for example, &&TEMPDS, and, to identify an in-stream or sysout data set name, for example, &&PAYOUT

Real Time Example
Code:

//SET1 SET VAL1='ABC,',VAL2=DEF,NULLSYM='
//S1 EXEC PGM=IEFBR14,PARM=&VAL1
// TIME=3)
//S2 EXEC PGM=IEFBR14,PARM=&VAL2
// TIME=3)
//S3 EXEC PGM=IEFBR14,PARM=&VAL1
// &NULLSYM


Code:
//S1 EXEC PGM=IEFBR14,ACCT='&&ABC'
//DD1 DD DSN=&&TEST,UNIT=SYSDA,SPACE=(TRK,(1,1))
Back to top
View user's profile Send private message
reena_preethi

New User


Joined: 14 Jun 2006
Posts: 14

PostPosted: Tue Jun 20, 2006 6:22 pm
Reply with quote

thanks a lot khamarutheen for explain with example

regards
reena
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jun 24, 2006 7:33 am
Reply with quote

Both & and && can be used to define a temp dataset.

The difference is that if &xxx is used somewhere else in the JCL for a symbolic, it will be used as a symbolic in the dsn too.

For example;

// set pgm1=abc
//s1 exec pgm=&pgm1
//dd1 dd dsn=&pgm1,disp=(,pass),...

pgm abc will be executed and a permanent ds with dsn abc will be created.

If
//s1 exec pgm=def
//dd1 dd dsn=&pgm1,disp=(,pass),...

a temp ds with a temp dsn beginning with "pgm1" is created.

That's why it's best to use && for temp datasets.
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 XDC SDSF output to temp dataset CLIST & REXX 4
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
Search our Forums:

Back to Top