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: 1531
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: 2025
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
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm


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