REXX QUEUE variable ignored



IBM's Command List programming language & Restructured Extended Executor

REXX QUEUE variable ignored

Postby cvcv » Wed Sep 07, 2016 8:56 pm

Hello, using REXX, I'm trying to generate and submit dynamic JCLs.

To test this out, I've created code to loop through my input, and then, generate and submit jobs.

The jobs get submitted properly, but they don't get generated properly when I display the values of LINE.I

This is the REXX code i'm using:

    SAY 'START OF REXX CODE.'

    "EXECIO * DISKR MYDATA (STEM LINE. FINIS"

    THIS_IS_A_VALUE1 = "VALUE #1"
    THIS_IS_A_VALUE2 = "VALUE #2"

    TRACE 'R'
    DO I = 1 TO LINE.0

        PARSE VAR LINE.I

        SAY "VALUE OF LINE.I : " LINE.I

        THIS_IS_A_VALUE3 = LINE.I

        QUEUE "//TESTA JOB 00000,'TEST',"
        QUEUE "//            CLASS=T,"
        QUEUE "//            MSGCLASS=X,"
        QUEUE "//            MSGLEVEL=(1,1),"
        QUEUE "//            USER=000000"
        QUEUE "//* THIS IS A VALUE#1  : " THIS_IS_A_VALUE1
        QUEUE "//* THIS IS A VALUE#2  : " THIS_IS_A_VALUE2
        QUEUE "//* THIS IS A VALUE#3  : " THIS_IS_A_VALUE3
        QUEUE "//STEP1 EXEC PGM=IEFBR14"
        QUEUE "//DD1 DD DUMMY"
        QUEUE "/*"
        QUEUE "$$"
        O = OUTTRAP("OUTPUT.",,"CONCAT")
        "SUBMIT * END($$)"
        O = OUTTRAP(OFF)
    END

    SAY 'END OF REXX CODE.'


This is the output of the submitted REXX code.. notice the missing " at the end of line 32, where I'm trying to show the value of LINE.I (through variable THIS_IS_A_VALUE3)


    START OF REXX CODE.
    16 *-* DO I = 1 TO LINE.0
    >>>   "1"
    >>>   "3"
    18 *-*  PARSE VAR LINE.I
    20 *-*  SAY "VALUE OF LINE.I : " LINE.I
    >>>    "VALUE OF LINE.I :  HELLO#1
    VALUE OF LINE.I :  HELLO#1
    22 *-*  THIS_IS_A_VALUE3 = LINE.I
    >>>    "
HELLO#1
    24 *-*  QUEUE "//TESTA JOB 00000,'TEST',"
    >>>    "//TESTA JOB 00000,'TEST',"
    25 *-*  QUEUE "//            CLASS=T,"
    >>>    "//            CLASS=T,"
    26 *-*  QUEUE "//            MSGCLASS=X,"
    >>>    "//            MSGCLASS=X,"
    27 *-*  QUEUE "//            MSGLEVEL=(1,1),"
    >>>    "//            MSGLEVEL=(1,1),"
    28 *-*  QUEUE "//            USER=000000"
    >>>    "//            USER=000000"
    30 *-*  QUEUE "//* THIS IS A VALUE#1  : " THIS_IS_A_VALUE1
    >>>    "//* THIS IS A VALUE#1  :  VALUE #1"
    31 *-*  QUEUE "//* THIS IS A VALUE#2  : " THIS_IS_A_VALUE2
    >>>    "//* THIS IS A VALUE#2  :  VALUE #2"
    32 *-*  QUEUE "//* THIS IS A VALUE#3  : " THIS_IS_A_VALUE3
    >>>    "//* THIS IS A VALUE#3  :  HELLO#1


This is an example of one of the generated JCLs:

    //TESTA JOB 00000,'TEST',
    //            CLASS=T,
    //            MSGCLASS=X,
    //            MSGLEVEL=(1,1),
    //            USER=000000
    //* THIS IS A VALUE#1  :  VALUE #1
    //* THIS IS A VALUE#2  :  VALUE #2
        ---> missing line here, should display this line --->//* THIS IS A VALUE#3  :  HELLO#1
    //STEP1 EXEC PGM=IEFBR14
    //DD1 DD DUMMY
    /*


Any ideas of how I can display the value of LINE.I?

Thanks
cvcv
 
Posts: 11
Joined: Fri Aug 28, 2015 6:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: REXX QUEUE variable ignored

 

Re: REXX QUEUE variable ignored

Postby Pedro » Wed Sep 07, 2016 10:52 pm

Show us a few lines of your input file.
Pedro Vera
User avatar
Pedro
 
Posts: 541
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 34 times

Re: REXX QUEUE variable ignored

Postby cvcv » Wed Sep 07, 2016 10:55 pm

Here's my input

********************************* Top of Data **********************************
HELLO#1
HELLO#2
HELLO#3
******************************** Bottom of Data ********************************
cvcv
 
Posts: 11
Joined: Fri Aug 28, 2015 6:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: REXX QUEUE variable ignored

Postby Pedro » Wed Sep 07, 2016 11:00 pm

notice the missing " at the end of line 32,

Probably your data records are too wide to show the end of the string. You should strip off the trailing blanks.

I tried this:
/* rexx */                                        
    SAY 'START OF REXX CODE.'                    
                                                 
 /* "EXECIO * DISKR MYDATA (STEM LINE. FINIS" */  
 line.1 = 'HELLO#1'|| copies(' ',500)            
 line.0 = 1                                      
<remainder the same as yours>                                                  
 

and I get the same result as you (a missing line)
Pedro Vera

These users thanked the author Pedro for the post:
cvcv (Wed Sep 14, 2016 2:54 am)
User avatar
Pedro
 
Posts: 541
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 34 times

Re: REXX QUEUE variable ignored

Postby cvcv » Wed Sep 07, 2016 11:08 pm

Thanks, it worked with

THIS_IS_A_VALUE3    = STRIP(LINE.I)


and

QUEUE "//* THIS IS A VALUE#3    : "||THIS_IS_A_VALUE3||"    "
cvcv
 
Posts: 11
Joined: Fri Aug 28, 2015 6:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: REXX QUEUE variable ignored

Postby Pedro » Thu Sep 08, 2016 1:40 am

I do not think you need to add trailing blanks in the QUEUE statement. It should work without them.
Pedro Vera
User avatar
Pedro
 
Posts: 541
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 34 times

Re: REXX QUEUE variable ignored

Postby cvcv » Tue Sep 13, 2016 9:07 pm

You're totally right. Thanks!
cvcv
 
Posts: 11
Joined: Fri Aug 28, 2015 6:05 pm
Has thanked: 2 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post