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: 2033
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am


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