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
 

 

How to differentiate VSAM file from a flat file in rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Fri Jul 10, 2009 8:17 pm    Post subject: How to differentiate VSAM file from a flat file in rexx
Reply with quote

I have a requirement to process input files based on whether the input file is vsam or Flat file.

How to identify in REXX whether the given input file is vsam or flat file.

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

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Jul 10, 2009 8:32 pm    Post subject: Reply to: How to differentiate VSAM file from a flat file in
Reply with quote

What commands have you tried? Certainly you found one or two that you could use?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Fri Jul 10, 2009 8:42 pm    Post subject:
Reply with quote

Hi Vinay,

Try this

Code:


/*REXX*/                                                             
 DSNAME = '<DATASET NAME OR VSAM FILE>'                               
DSNAME = STRIP(DSNAME)                                               
TDSN = STRIP(DSNAME ,,'''')                                           
STATUS=SYSDSN(''''TDSN'''')                                           
X=OUTTRAP('CLS.')                                                     
"LISTCAT EN('"TDSN"') ALL"                                           
X=OUTTRAP('OFF')                                                     
IF POS('NONVSAM',CLS.1) /= 0 THEN DO                                 
    SAY TDSN "IS NOT A VSAM DATASET"                                 
    ZDLMSG  = 'ERROR- NONVSAM'                                       
    VARLIST = 'ZDLMSG'                                               
   "ISPEXEC VPUT (&VARLIST) SHARED"                                   
    EXIT                                                             
 END                                                                 
 ELSE SAY TDSN 'IT IS A VSAM FILE'                                   

Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Fri Jul 10, 2009 9:32 pm    Post subject: Reply to: How to differentiate VSAM file from a flat file in
Reply with quote

You are using:
Code:
"LISTCAT EN('"TDSN"') ALL"

but for the test being done, I do not think you need to specify 'ALL'.
Back to top
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Sat Jul 11, 2009 2:13 pm    Post subject: Reply to: How to differentiate VSAM file from a flat file in
Reply with quote

Hi Prem,

Your code works, thanks a lot
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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