Page 1 of 1

How to read command given infornt of file in REXX

PostPosted: Wed Dec 21, 2011 12:40 pm
by Mann_B
Hi

Can we read the command we give infront of file name and run the REXX code accodingly.
Suppose we have file INPUT1.FILE. If I give EXT100 infront of file name ,i should be able to read that command and extract 100 records from file using REXX(I am actaully sub SORT to extract ).

How can we read that EXT100 given and perform accordingly.

Thank You

Re: How to read command given infornt of file in REXX

PostPosted: Wed Dec 21, 2011 1:26 pm
by mongan
Yes, you can do that. You have not said where the file name is though. Is it part of the DSN in a JCL statement that you are editing, is it in a 3.4 list, ??? Have you looked for examples with google? Have you tried something yourself?

Re: How to read command given infornt of file in REXX

PostPosted: Wed Dec 21, 2011 1:50 pm
by enrico-sorichetti
write a small snippet along the lines of ...
 EDIT       ENRICO.ISPF.EXEC(ZZ) - 01.04                    Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 /* Rexx */                                                             
 000002 Trace "O"                                                               
 000003 parse arg argv                                                         
 000004 argc = words(argv)                                                     
 000005 say right(argc,2)                                                       
 000006 do iarg = 1 to argc                                                     
 000007    say right(iarg,2) word(argv,iarg)                                   
 000008 end                                                                     
 000009 exit                                                                   
 ****** **************************** Bottom of Data ****************************


save it in Your SYSPROC/SYSEXEC concatenation as <NameOfYourChoice>

after that go to ISPF option 3.4
and in front of a dataset enter
<NameOfYourChoice>
<NameOfYourChoice> a b c / d e f

where the / is the placeholder for dataset name
and meditate on the result
and above all meditate on
http://publibz.boulder.ibm.com/cgi-bin/ ... s/IKJ4BK90
and
http://publibz.boulder.ibm.com/cgi-bin/ ... s/ISPZPM70
not the last one, but more than enough for basic understanding

up to You to find the manuals for Your zOS level starting from
http://www-03.ibm.com/systems/z/os/zos/ ... index.html

Re: How to read command given infornt of file in REXX

PostPosted: Wed Dec 21, 2011 2:01 pm
by enrico-sorichetti
follow on ... to make You understand better the suggestion of the previous post
her is how the 3.4 screen would look like for the test

before
 DSLIST - Data Sets Matching ENRICO.ISPF                            Row 1 of 10
 Command ===>                                                  Scroll ===> CSR 
                                                                               
 Command - Enter "/" to select action                  Message           Volume
 -------------------------------------------------------------------------------
 zz       ENRICO.ISPF.DITPROF                                            STOR03
 zz /     ENRICO.ISPF.EXEC                                               STOR04
 zz / a b c RICO.ISPF.JCL                                                STOR04
 zz / a b c / d e f F.MSGS                                               STOR04
          ENRICO.ISPF.OBJ                                               STOR02
          ENRICO.ISPF.PANELS                                            STOR04
          ENRICO.ISPF.PARMS                                             STOR04
          ENRICO.ISPF.PROFILE                                           STOR03
          ENRICO.ISPF.SKELS                                             STOR01
          ENRICO.ISPF.TABLES                                            STOR01
 ***************************** End of Data Set list ****************************

after ( screen 1 )
 DSLIST - Data Sets Matching ENRICO.ISPF                            Row 1 of 10
 Command ===>                                                  Scroll ===> CSR 
                                                                               
 Command - Enter "/" to select action                  Message           Volume
 -------------------------------------------------------------------------------
 zz       ENRICO.ISPF.DITPROF                                            STOR03
 zz /     ENRICO.ISPF.EXEC                                               STOR04
 zz / a b c RICO.ISPF.JCL                                                STOR04
 zz / a b c / d e f F.MSGS                                               STOR04
          ENRICO.ISPF.OBJ                                               STOR02
          ENRICO.ISPF.PANELS                                            STOR04
          ENRICO.ISPF.PARMS                                             STOR04
          ENRICO.ISPF.PROFILE                                           STOR03
          ENRICO.ISPF.SKELS                                             STOR01
          ENRICO.ISPF.TABLES                                            STOR01
 ***************************** End of Data Set list ****************************
                                                                               
                                                                               
  1                                                                             
  1 'ENRICO.ISPF.DITPROF'       
                                               
  1                                                                             
 ***                                                                           

after ( screen 2 )
  1 'ENRICO.ISPF.EXEC'           
                                             
  4                                                                             
  1 'ENRICO.ISPF.JCL'                                                           
  2 A                                                                           
  3 B                                                                           
  4 C                                                                           

  8                                                                             
  1 'ENRICO.ISPF.MSGS'                                                         
  2 A                                                                           
  3 B                                                                           
  4 C                                                                           
  5 'ENRICO.ISPF.MSGS'                                                         
  6 D                                                                           
  7 E                                                                           
  8 F                                                                           
 ***                                                                           


note how in the last invocation the dsname is substituted for each occurrence of a /

Re: How to read command given infornt of file in REXX

PostPosted: Thu Dec 22, 2011 11:20 am
by Mann_B
mongan wrote:Yes, you can do that. You have not said where the file name is though. Is it part of the DSN in a JCL statement that you are editing, is it in a 3.4 list, ??? Have you looked for examples with google? Have you tried something yourself?



Yes I need to do it in 3.4 option.If they give command to extract 100 records ,I need to extract 100 and if it is 10 then i need to do for 10.So based on the command they give I need to perform the action.

hi Enrico

Thank You for your reply.But I am confused ..As you have give do we need to have a member ZZ in one of PDS and when we give ZZ infront of the file then that REXX mem will exceute.But here the command is not the same every time.So I need to read the command and perform accordingly.

Please suggest me and help me .

Thank You

Re: How to read command given infornt of file in REXX

PostPosted: Thu Dec 22, 2011 11:47 am
by NicC
If you look more carefully you will see that ZZ is a Rexx program given in Enrico's prevoious reply. You can put any valid command / program name where Enrico has put ZZ. Use the PF1 key to read more about options in 3.4.

Re: How to read command given infornt of file in REXX

PostPosted: Thu Dec 22, 2011 7:29 pm
by enrico-sorichetti
You overlooked ...

save it in Your SYSPROC/SYSEXEC concatenation as <NameOfYourChoice>

after that go to ISPF option 3.4
and in front of a dataset enter
<NameOfYourChoice>
<NameOfYourChoice> a b c / d e f

Re: How to read command given infornt of file in REXX

PostPosted: Fri Dec 23, 2011 4:49 am
by enrico-sorichetti
Follow on...
Can we read the command we give infront of file name and run the REXX code accodingly.


terminology is important in IT,
It is not You who ( in ISPF 3.4 ) will read the command given in front of the file name
it is the ISPF 3.4 dialog processor which does it, and then it <invokes> the string entered
looking first for a load module/command in the <current> steplib and friends concatenation
and after for a <command>/<script>/CLIST/REXX in the current SYSPROC/SYSEXEC concatenation
( or ALTLIB-bed thing )