View previous topic :: View next topic
|
Author |
Message |
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Manual = ISPF Services Guide, section = LMDLIST
Manuals button at the top of the page |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
You also could've used the REXX LISTDSI function or the TSO/E LISTDS command, all with the basic same results. |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
Thanks man..!! Now only I checked. Its working fine.
|
|
Back to top |
|
|
|