Re: LISTDSI - hardcoded dsn vs. read in from file
On Sat, 6 Jan 2024 04:06:59 -0600, Willy Jensen wrote: >"PROF NOPREFIX works but can leave you that setting when you don't want it on >termination." PROF NOPREFIX should never be used especially if you can't figure out quoting. You are potentially creating problems for others working on your code. More important, millions of programmers mastered quoting (e.g. HTML with JavaScript). Others told you to TRACE I your REXX. This should make your quoting problem obvious when seeing the resulting line. Without you posting this trace output, we can only guess at your problem. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
"PROF NOPREFIX works but can leave you that setting when you don't want it on termination." Do check if it is already off before you change it, and if so dont set it on afterwards. Also remember that the prefix is not neccessarily the user id, so you need something like the following to preserve the value: pfx = sysvar('syspref') -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
Quoted strings always gave me grief. I started to use Q='7D'X and concatenate my strings this way: Str = Q||DsNAme||Q. LISTDSI(Str) PROF NOPREFIX works but can leave you that setting when you don't want it on termination. On Sat, Jan 6, 2024 at 8:00 AM Willy Jensen wrote: > > . . > >Unquote: return strip(space(translate(arg(1)," ","'"))) > > > >Isn't that a verbose equivalent of: > >return strip( arg( 1 ), 'Both', ) > Not exactly, the Unquote also removes spaces between the quote and the > text. It has happened. > > >Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'" > > > >If arg( 1 ) is a string of blanks, do you want to pass listds() > >an empty string? > > Yes, though one could return something like '*missing name*' I guess > and/or do a SAY with a message. > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- Wayne V. Bickerdike -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
> . . >Unquote: return strip(space(translate(arg(1)," ","'"))) > >Isn't that a verbose equivalent of: >return strip( arg( 1 ), 'Both', ) Not exactly, the Unquote also removes spaces between the quote and the text. It has happened. >Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'" > >If arg( 1 ) is a string of blanks, do you want to pass listds() >an empty string? Yes, though one could return something like '*missing name*' I guess and/or do a SAY with a message. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
On Fri, 5 Jan 2024 03:06:10 -0600, Willy Jensen wrote: >or requote as a function, I think it looks nicer > > cc=Listdsi(requote(ds)) > . . >Unquote: return strip(space(translate(arg(1)," ","'"))) > Isn't that a verbose equivalent of: return strip( arg( 1 ), 'Both', ) ??? >Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'" > If arg( 1 ) is a string of blanks, do you want to pass listds() an empty string? -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
or requote as a function, I think it looks nicer cc=Listdsi(requote(ds)) . . Unquote: return strip(space(translate(arg(1)," ","'"))) Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'" -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
Instead of changing the TSO profile, I usually remove quotes using a function like so: cc=Listdsi("'"unquote(ds)"'") . . Unquote: return strip(space(translate(arg(1)," ","'"))) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
Everyone, I so appreciate everyone's prompt feedback on my challenge. I ended up using ITschak Mugzach solution by turning off TSO profile prefix and removing quotation marks from my input file. I am now good to go. Again really appreciate the prompt response! Steve Estle sest...@gmail.com -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
On Thu, 4 Jan 2024 13:55:22 -0600, Steve Estle wrote: >I've hardcoded the enclosing double quote/quote inside my file as follows: >"'SYS1.PARMLIB'" That's the problem. When your exec that works correctly does this: > DSName = "'SYS1.PARMLIB'" the double quotes are part of the REXX syntax to indicate that what's between is a literal string, and only the single quotes are part of the value of that string. When that exec then does: > Say DSName you'll see in the output just the single quotes: 'SYS1.PARMLIB' When your failing exec does: > Say dsn you'll instead see both sets of quotes, because they're both part of the data you read from the input file: "'SYS1.PARMLIB'" So don't put the double quotes in your input file, because they're not part of your data. ¬R -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
On Thu, 4 Jan 2024 14:07:20 -0600, Steve Estle wrote: >It fails on this instruction in 2nd scenario: > >x = LISTDSI(dsn) > What is the failure message? -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
On Thu, 4 Jan 2024 13:55:22 -0600, Steve Estle wrote: > >I'm sure I'm doing something boneheaded but can't quite figure out what. I >have a list of fully qualified datasets in a file that I want to read the >dataset names once per record and then once I've read the record with dataset >name then use that name in a LISTDSI command. When I hard code name in REXX >exec it works fine - when I read dsname from file it fails. I've hardcoded >the enclosing double quote/quote inside my file as follows: >... >Trace i >... Please show your Trace output. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
You need to quote the dsname in apostrophes if it's fully qualified. Try x = LISTDSI("'"dsn"'") This might be more readable: apostrophe = "'" x = listdsi(apostrophe||dsn||apostrophe) -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 עַם יִשְׂרָאֵל חַי נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר From: IBM Mainframe Discussion List on behalf of Steve Estle Sent: Thursday, January 4, 2024 2:55 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: LISTDSI - hardcoded dsn vs. read in from file All, I'm sure I'm doing something boneheaded but can't quite figure out what. I have a list of fully qualified datasets in a file that I want to read the dataset names once per record and then once I've read the record with dataset name then use that name in a LISTDSI command. When I hard code name in REXX exec it works fine - when I read dsname from file it fails. I've hardcoded the enclosing double quote/quote inside my file as follows: "'SYS1.PARMLIB'" When it fails (2nd version) I get this error message: IKJ56712I INVALID KEYWORD, "'SYS1.PARMLIB'" Two scenarios: Works Fine: /* REXX */ /*--*/ /*S E L E C T D S N S & L I S T I N F O*/ /*--*/ DSName = "'SYS1.PARMLIB'" Say DSName x = LISTDSI(DSName) SAY 'Function code from LISTDSI is: ' x SAY 'The data set name is: ' sysdsname SAY 'The device unit on which the volume resides is:' sysunit SAY 'The record format is: ' sysrecfm SAY 'The logical record length is: ' syslrecl SAY 'The block size is: ' sysblksize SAY 'The allocation in space units is: ' sysalloc EXIT Failing Version: /* REXX */ INDSN = "'P69792.LISTDSI.INPUT'" OUTDSN = "'P69792.LISTDSI.OUTPUT.CSV'" DDNI = "DD"||RANDOM(1,9) DDNO = "DD"||RANDOM(1,9) /*--*/ /* R E A D D S N L I S T */ /*--*/ ADDRESS TSO "ALLOC DA(" INDSN ") DDNAME( " DDNI ") SHR REUSE " ADDRESS TSO "ALLOC DA(" OUTDSN ") DDNAME( " DDNO ") OLD REUSE " ADDRESS TSO "EXECIO * DISKR " DDNI "(STEM Dsni. FINIS" ADDRESS TSO "FREE DDNAME(" DDNI ") " /*--*/ /*S E L E C T D S N S & L I S T I N F O */ /*--*/ Trace i DO I = 1 TO Dsni.0 dsn = Word(Dsni.I,1) Say dsn x = LISTDSI(dsn) SAY 'Function code from LISTDSI is: ' x SAY 'The data set name is: ' sysdsname SAY 'The device unit on which the volume resides is:' sysunit SAY 'The record format is: ' sysrecfm SAY 'The logical record length is: ' syslrecl SAY 'The block size is: ' sysblksize SAY 'The allocation in space units is: ' sysalloc END I -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
It fails on this instruction in 2nd scenario: x = LISTDSI(dsn) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
Simply remove the quote and double quotes from your input file and add address tso prof nopref The list Sai sees two set of quotes instead of one at a maximum. You can try Dan=translate(dsn,' ','"') before the list Sai command *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux and IBM I **| * *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|* *Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il **|* בתאריך יום ה׳, 4 בינו׳ 2024 ב-21:55 מאת Steve Estle : > All, > > I'm sure I'm doing something boneheaded but can't quite figure out what. > I have a list of fully qualified datasets in a file that I want to read the > dataset names once per record and then once I've read the record with > dataset name then use that name in a LISTDSI command. When I hard code > name in REXX exec it works fine - when I read dsname from file it fails. > I've hardcoded the enclosing double quote/quote inside my file as follows: > > "'SYS1.PARMLIB'" > > When it fails (2nd version) I get this error message: > > IKJ56712I INVALID KEYWORD, "'SYS1.PARMLIB'" > > Two scenarios: > > Works Fine: > > /* REXX */ > > > /*--*/ > > /*S E L E C T D S N S & L I S T I N F O*/ > > /*--*/ > >DSName = "'SYS1.PARMLIB'" > >Say DSName > >x = LISTDSI(DSName) > >SAY 'Function code from LISTDSI is: ' x > >SAY 'The data set name is: ' sysdsname > >SAY 'The device unit on which the volume resides is:' sysunit > >SAY 'The record format is: ' sysrecfm > >SAY 'The logical record length is: ' syslrecl > >SAY 'The block size is: ' sysblksize > >SAY 'The allocation in space units is: ' sysalloc > > > EXIT > > Failing Version: > > /* REXX */ > > > > INDSN = "'P69792.LISTDSI.INPUT'" > > OUTDSN = "'P69792.LISTDSI.OUTPUT.CSV'" > > DDNI = "DD"||RANDOM(1,9) > > DDNO = "DD"||RANDOM(1,9) > > > > /*--*/ > > /* R E A D D S N L I S T */ > > /*--*/ > > ADDRESS TSO "ALLOC DA(" INDSN ") DDNAME( " DDNI ") SHR REUSE " > > ADDRESS TSO "ALLOC DA(" OUTDSN ") DDNAME( " DDNO ") OLD REUSE " > > ADDRESS TSO "EXECIO * DISKR " DDNI "(STEM Dsni. FINIS" > > ADDRESS TSO "FREE DDNAME(" DDNI ") " > > > > /*--*/ > > /*S E L E C T D S N S & L I S T I N F O */ > > /*--*/ > > >Trace i > > DO I = 1 TO Dsni.0 > >dsn = Word(Dsni.I,1) > >Say dsn > >x = LISTDSI(dsn) > >SAY 'Function code from LISTDSI is: ' x > >SAY 'The data set name is: ' sysdsname > >SAY 'The device unit on which the volume resides is:' sysunit > >SAY 'The record format is: ' sysrecfm > >SAY 'The logical record length is: ' syslrecl > >SAY 'The block size is: ' sysblksize > >SAY 'The allocation in space units is: ' sysalloc > > END I > > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: LISTDSI - hardcoded dsn vs. read in from file
Which instruction fails? Do TRACE on the whole routine. On Thu, 4 Jan 2024 13:55:22 -0600 Steve Estle wrote: :>All, :> :>I'm sure I'm doing something boneheaded but can't quite figure out what. I have a list of fully qualified datasets in a file that I want to read the dataset names once per record and then once I've read the record with dataset name then use that name in a LISTDSI command. When I hard code name in REXX exec it works fine - when I read dsname from file it fails. I've hardcoded the enclosing double quote/quote inside my file as follows: :> :>"'SYS1.PARMLIB'" :> :>When it fails (2nd version) I get this error message: :> :>IKJ56712I INVALID KEYWORD, "'SYS1.PARMLIB'" :> :>Two scenarios: :> :>Works Fine: :> :>/* REXX */ :> :>/*--*/ :> :>/*S E L E C T D S N S & L I S T I N F O*/ :> :>/*--*/ :> :> DSName = "'SYS1.PARMLIB'" :> :> Say DSName :> :> x = LISTDSI(DSName) :> :> SAY 'Function code from LISTDSI is: ' x :> :> SAY 'The data set name is: ' sysdsname :> :> SAY 'The device unit on which the volume resides is:' sysunit :> :> SAY 'The record format is: ' sysrecfm :> :> SAY 'The logical record length is: ' syslrecl :> :> SAY 'The block size is: ' sysblksize :> :> SAY 'The allocation in space units is: ' sysalloc :> :> :>EXIT :> :>Failing Version: :> :>/* REXX */ :> :> :> :>INDSN = "'P69792.LISTDSI.INPUT'" :> :>OUTDSN = "'P69792.LISTDSI.OUTPUT.CSV'" :> :>DDNI = "DD"||RANDOM(1,9) :> :>DDNO = "DD"||RANDOM(1,9) :> :> :> :>/*--*/ :> :>/* R E A D D S N L I S T */ :> :>/*--*/ :> :>ADDRESS TSO "ALLOC DA(" INDSN ") DDNAME( " DDNI ") SHR REUSE " :> :>ADDRESS TSO "ALLOC DA(" OUTDSN ") DDNAME( " DDNO ") OLD REUSE " :> :>ADDRESS TSO "EXECIO * DISKR " DDNI "(STEM Dsni. FINIS" :> :>ADDRESS TSO "FREE DDNAME(" DDNI ") " :> :> :> :>/*--*/ :> :>/*S E L E C T D S N S & L I S T I N F O */ :> :>/*--*/ :> :> :> Trace i :> :>DO I = 1 TO Dsni.0 :> :> dsn = Word(Dsni.I,1) :> :> Say dsn :> :> x = LISTDSI(dsn) :> :> SAY 'Function code from LISTDSI is: ' x :> :> SAY 'The data set name is: ' sysdsname :> :> SAY 'The device unit on which the volume resides is:' sysunit :> :> SAY 'The record format is: ' sysrecfm :> :> SAY 'The logical record length is: ' syslrecl :> :> SAY 'The block size is: ' sysblksize :> :> SAY 'The allocation in space units is: ' sysalloc :> :>END I :> :> :>-- :>For IBM-MAIN subscribe / signoff / archive access instructions, :>send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- Binyamin Dissen http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
LISTDSI - hardcoded dsn vs. read in from file
All, I'm sure I'm doing something boneheaded but can't quite figure out what. I have a list of fully qualified datasets in a file that I want to read the dataset names once per record and then once I've read the record with dataset name then use that name in a LISTDSI command. When I hard code name in REXX exec it works fine - when I read dsname from file it fails. I've hardcoded the enclosing double quote/quote inside my file as follows: "'SYS1.PARMLIB'" When it fails (2nd version) I get this error message: IKJ56712I INVALID KEYWORD, "'SYS1.PARMLIB'" Two scenarios: Works Fine: /* REXX */ /*--*/ /*S E L E C T D S N S & L I S T I N F O*/ /*--*/ DSName = "'SYS1.PARMLIB'" Say DSName x = LISTDSI(DSName) SAY 'Function code from LISTDSI is: ' x SAY 'The data set name is: ' sysdsname SAY 'The device unit on which the volume resides is:' sysunit SAY 'The record format is: ' sysrecfm SAY 'The logical record length is: ' syslrecl SAY 'The block size is: ' sysblksize SAY 'The allocation in space units is: ' sysalloc EXIT Failing Version: /* REXX */ INDSN = "'P69792.LISTDSI.INPUT'" OUTDSN = "'P69792.LISTDSI.OUTPUT.CSV'" DDNI = "DD"||RANDOM(1,9) DDNO = "DD"||RANDOM(1,9) /*--*/ /* R E A D D S N L I S T */ /*--*/ ADDRESS TSO "ALLOC DA(" INDSN ") DDNAME( " DDNI ") SHR REUSE " ADDRESS TSO "ALLOC DA(" OUTDSN ") DDNAME( " DDNO ") OLD REUSE " ADDRESS TSO "EXECIO * DISKR " DDNI "(STEM Dsni. FINIS" ADDRESS TSO "FREE DDNAME(" DDNI ") " /*--*/ /*S E L E C T D S N S & L I S T I N F O */ /*--*/ Trace i DO I = 1 TO Dsni.0 dsn = Word(Dsni.I,1) Say dsn x = LISTDSI(dsn) SAY 'Function code from LISTDSI is: ' x SAY 'The data set name is: ' sysdsname SAY 'The device unit on which the volume resides is:' sysunit SAY 'The record format is: ' sysrecfm SAY 'The logical record length is: ' syslrecl SAY 'The block size is: ' sysblksize SAY 'The allocation in space units is: ' sysalloc END I -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN