How to read command given infornt of file in REXX



IBM's Command List programming language & Restructured Extended Executor

How to read command given infornt of file in REXX

Postby Mann_B » Wed Dec 21, 2011 12:40 pm

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
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby mongan » Wed Dec 21, 2011 1:26 pm

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?
User avatar
mongan
 
Posts: 212
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times

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

Postby enrico-sorichetti » Wed Dec 21, 2011 1:50 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

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

Postby enrico-sorichetti » Wed Dec 21, 2011 2:01 pm

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 /
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

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

Postby Mann_B » Thu Dec 22, 2011 11:20 am

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
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Thu Dec 22, 2011 11:47 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

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

Postby enrico-sorichetti » Thu Dec 22, 2011 7:29 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

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

Postby enrico-sorichetti » Fri Dec 23, 2011 4:49 am

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 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post