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

How to differentiate VSAM file from a flat file in rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Jul 10, 2009 8:32 pm
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

Global Moderator


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

PostPosted: Fri Jul 10, 2009 8:42 pm
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

Global Moderator


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

PostPosted: Fri Jul 10, 2009 9:32 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top