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
 

 

SAS - Temp dataset with DISP=MOD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Tue Jun 24, 2014 2:00 am    Post subject: SAS - Temp dataset with DISP=MOD
Reply with quote

Hi,

There is a JCL DD statement which allocates a TEMP file with DISP=MOD.
Code:
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(TRK,(5,2)),
//       DCB=(RECFM=VB,LRECL=2500,BLKSIZE=27998)
I need to convert this into SAS FILENAME statement.

Tried the below code as given in http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/viewer.htm#mvs-allexf-ufs.htm
Code:
FILENAME TEMP '&TEMP' DISP=NEW SPACE=(TRK,(3,1))
         LRECL = 2500 RECFM = VB BLKSIZE = 27998;
FILENAME TEMP '&TEMP' DISP=MOD;

But this file is still being written in DISP=OLD.

Test program:
Code:
FILENAME TEMP '&TEMP' DISP=NEW SPACE=(TRK,(3,1))
         LRECL = 2500 RECFM = VB BLKSIZE = 27998;
FILENAME TEMP '&TEMP' DISP=mod;
/* this step writes one record into temp file */
data think;
file temp;
put ' hello';
run;
/* this step writes second record into temp file */
data next;
file temp;
put 'world';
run;
/* this step reads the temp file and wrrites it into log */
data _null_;
infile temp;
input;
put _infile_;
run;


Expected output in SAS log:
Code:
hello
world

Actual output in SAS log:
Code:
world


Could you please let me know how to allocate a TEMP file with DISP=MOD in SAS. I cannot use JCL since there are a lot of TEMP files and the number of temp datasets are dynamic.
Thanks & Regards,
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Tue Jun 24, 2014 2:23 am    Post subject: Reply to: SAS - Temp dataset with DISP=MOD
Reply with quote

What about coding a disposition for termination? KEEP?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Tue Jun 24, 2014 11:59 am    Post subject:
Reply with quote

Hello Bill,
Yup tried coding termination parameter as well. Still the same issue.
The file is being treated as disp = old.

Thanks,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Tue Jun 24, 2014 7:19 pm    Post subject:
Reply with quote

Hello,
This method worked.

Mentioning MOD in the FILE statement.

Code:
FILENAME TEMP '&TEMP' DISP=NEW SPACE=(TRK,(3,1))
         LRECL = 2500 RECFM = VB BLKSIZE = 27998;
/* this step writes one record into temp file */
data think;
file temp mod;
put 'hello';
run;
/* this step writes second record into temp file */
data next;
file temp mod;
put 'world';
run;
/* this step reads the temp file and wrrites it into log */
data _null_;
infile temp;
input;
put _infile_;
run;


Regards,
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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