Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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: 1542
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: 2086
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us