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

Get the record length of a file


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Wed Oct 15, 2008 12:42 pm
Reply with quote

I have a requirement to get the record length of the input file.
How to get this value? Is there any specific command in REXX? I googled but I couldn't get answer yet.

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 15, 2008 1:00 pm
Reply with quote

Manual = ISPF Services Guide, section = LMDLIST

Manuals button at the top of the page
Back to top
View user's profile Send private message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Wed Oct 15, 2008 8:36 pm
Reply with quote

Hi expat

Is the syntax correct?

Code:

ADDRESS ISPEXEC "LMDLIST LISTID('"||INPUT||"') OPTION(FREE)"
" DATASET(ZDLLRECL)  STATS(YES)"     
   


Where INPUT is File name got from Panel. It is throwing

ISPS108

Invalid length
Parameter 'LISTID' exceeds the allowable length.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Oct 15, 2008 9:01 pm
Reply with quote

LISTID should point to a variable name. I have no idea where you came up with that syntax. When I use the ISPF Edit Models for REXX, I see these screens:
Code:

SYSB                              REXX Models                             
Option ===>                                                               
                                                                         
Enter number or service name.                                             
Enter END command to cancel MODEL command.                               
                                                                         
Variables                 Workstation                 Library Access     
V1  VGET                  X1  FILESTAT                L0  LIBACC         
V2  VPUT                  X2  FILEXFER                                   
V3  VERASE                X3  WSCON                   Miscellaneous       
                          X4  WSDISCON                M0  MISC           
Display                                                                   
D1  DISPLAY                                                               
D2  TBDISPL               File Tailoring                                 
D3  SETMSG                F1  FTOPEN                                     
D4  PQUERY                F2  FTINCL                                     
D5  ADDPOP                F3  FTCLOSE                                     
D6  REMPOP                F4  FTERASE                                     
                                                                         
Tables                                                                   
T1  TABLES   


Selecting L0 for the Library Access models, I see:

Code:

SYSB                REXX Models for Library Access Services       
Option ===>                                                       
                                                                 
Enter number or service name.                                     
Enter END command to cancel MODEL command.                       
                                                                 
Library Access                                                   
L1  LMCLOSE                 L11 LMMREP                L26 LMPRINT
L2  LMERASE                 L12 LMOPEN                L27 LMDINIT
L3  LMFREE                  L14 LMPUT                 L28 LMDLIST
L4  LMGET                   L15 LMQUERY               L29 LMDFREE
L5  LMINIT                  L16 LMRENAME              L30 LMDDISP
L6  LMMADD                  L21 LMMDISP               L31 MEMLIST
L7  LMMDEL                  L22 LMMOVE                           
L8  LMMFIND                 L23 LMCOPY                           
L9  LMMLIST                 L24 LMCOMP                           
L10 LMMREN                  L25 LMMSTATS                         


Selecting L28 LMDLIST, I see this:

Code:

  'LMDLIST LISTID('listid') OPTION('dsl-opt')',                       
           'DATASET(DSVAR)  STATS('stats-opt') GROUP('group')'       
                                                                     
     LMDLIST  - Name of dialog service                               
     listid   - Listid generated by the lmdinit service               
     dsl-opt  - One of LIST, FREE and SAVE                           
                  LIST  - if data set list not yet built, build it.   
                          returns next data set name in list         
                  FREE  - free the data set list                     
                  SAVE  - build the data set list,                   
                          print the list to a file.                   
                          free the list.                             
                  SAVEC - same as SAVE but the catalog name for each 
                          data set is also printed.                   
     DSVAR    - Optional, when a data set list is built by the list   
                option, the first data set name to be returned is the
                data set name in this variable name                   
     stats-opt- Specifies whether or not data set information is to   
                be returned in function pool variables.  either yes or
                no.                                                   
    group    - Optional, used by the SAVE option.  When specified,     
               the data set list is written to a data set named       
               <userid>.<group>.DATASETS where <group> is the name     
               specified by this parameter.  If not specified, the     
               data set list is written to the ISPF list file.         
                                                                       
     EXAMPLE: ADDRESS ISPEXEC                                         
              'LMDLIST LISTID('dslistid') OPTION(LIST) DATASET(DSNVAR)'
                                                                       
 If rc ¬= 0 Then          /* Return codes                           */
   Do                     /*  4 - No data sets matched specified    */
   End                    /*      search criteria (the values for   */
 Else                     /*      keywords LEVEL and VOLUME on the  */
                          /*      LMDINIT service).                 */
                          /*  8 - No more data sets names in list   */
                          /*      (option LIST)                     */
                          /*    - No data set list exists for this  */
                          /*      dslist-id (option FREE)           */
                          /*    - Data set lists already exists and */
                          /*      must be freed before using SAVE   */
                          /*      option (option SAVE)              */
                          /* 10 - Data set listid not created by    */
                           /*      lmdinit                           */
                           /* 12 - Invalid parameter value           */
                           /* 16 - Truncation or translation error   */
                           /*      in accessing dialog variables     */
                           /* 20 - Severe error                      */


Now, note that the model states that:

listid - Listid generated by the lmdinit service

So, obviously you need to first call the LMDINIT service. The ISPF Edit Model for that looks like:

Code:

   'LMDINIT LISTID(LISTIDV)  LEVEL('dslev')  VOLUME('volser')'         
                                                                       
      LMDINIT  - Name of dialog service                               
      LISTIDV  - Name of the variable into which is stored the list-id
                 to be associated with the list of data set names.     
      DSLEV    - Optional, data set name pattern which all data set   
                 names in list must match                             
      VOLSER   - Optional, the volume on which data sets must reside in
                 order to be in the data set list.                     
                                                                       
       EXAMPLE: ADDRESS ISPEXEC                                       
                'LMDINIT LISTID(DSLISTID) LEVEL(SYS1.ISP*) '           
                                                                       
   If rc ¬= 0 Then               /* Return codes                     */
     Do                          /*  8 - Listid not created          */
     End                         /* 12 - Invalid parameter value     */
   Else                          /* 16 - Truncation or translation   */
                                 /*      error in accessing dialog   */
                                 /*      variables                   */
                                 /* 20 - Severe error                */
Back to top
View user's profile Send private message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Wed Oct 15, 2008 9:12 pm
Reply with quote

Great man!!

Code:


ADDRESS ISPEXEC "LMDINIT LISTID(LOK1) LEVEL("||INPUT||")"
ADDRESS ISPEXEC "LMDLIST LISTID(LOK1) OPTION(FREE)"       



is working. But how to get the variable ZDLLRECL??
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Oct 15, 2008 9:26 pm
Reply with quote

I don't know how your code could be working since it's syntactically incorrect. My version looks like this:
Code:

Address ISPEXEC
"LMDINIT LISTID(lok1) LEVEL("input")"
"LMDLIST LISTID("lok1") OPTION(LIST) DATASET(dsn) STATS(YES)"
Say dsn zdllrecl
"LMDFREE LISTID("lok1")"
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Oct 15, 2008 9:30 pm
Reply with quote

You also could've used the REXX LISTDSI function or the TSO/E LISTDS command, all with the basic same results.
Back to top
View user's profile Send private message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Fri Oct 17, 2008 5:38 pm
Reply with quote

Thanks man..!! Now only I checked. Its working fine.

icon_lol.gif
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
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
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top