dynamic jcl through Rexx



IBM's Command List programming language & Restructured Extended Executor

Re: dynamic jcl through Rexx

Postby coolpinky » Sun Jun 09, 2013 11:19 am

Sort will only allow me to split the files..however i need o create file name dynamically and process those..I dont think sort can do this..
coolpinky
 
Posts: 11
Joined: Fri Jun 07, 2013 4:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: dynamic jcl through Rexx

Postby enrico-sorichetti » Sun Jun 09, 2013 12:57 pm

this snippet will build a reasonable jcl according to Your input

 ****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  4 Line(s) not Displayed
 000005 //S1      EXEC PGM=SORT
 000006 //SYSPRINT  DD SYSOUT=*
 000007 //SYSOUT    DD SYSOUT=*
 000008 //SORTIN    DD *
 000009 1234 ... ... ...
 000010 2345 ... ... ...
 000011 2345 ... ... ...
 000012 3456 ... ... ...
 000013 3456 ... ... ...
 000014 3456 ... ... ...
 000015 4567 ... ... ...
 000016 4567 ... ... ...
 000017 4567 ... ... ...
 000018 4567 ... ... ...
 000019 //JCL       DD DISP=(,PASS),DSN=&JCL,
 000020 //             DCB=(RECFM=FB,LRECL=80),
 000021 //             UNIT=VIO,SPACE=(TRK,(1,1))
 000022 //CTL       DD DISP=(,PASS),DSN=&CTL,
 000023 //             DCB=(RECFM=FB,LRECL=80),
 000024 //             UNIT=VIO,SPACE=(TRK,(1,1))
 000025 //SYSIN     DD *
 000026   OPTION COPY
 000027   INREC  OVERLAY(81:SEQNUM,4,ZD,RESTART=(1,4))
 000028   OUTFIL FNAMES=JCL,
 000029     INCLUDE=(81,4,ZD,EQ,1),
 000030     REMOVECC,
 000031     HEADER1=('//SPLIT    JOB NOTIFY=&SYSUID,                ',/,
 000032              '//             CLASS=A,MSGCLASS=X,            ',/,
 000033              '//             MSGLEVEL=(1,1)                 ',/,
 000034              '//*                                           ',/,
 000035              '//S       EXEC PGM=SORT                       ',/,
 000036              '//SYSPRINT  DD SYSOUT=*                       ',/,
 000037              '//SYSOUT    DD SYSOUT=*                       ',/,
 000038              '//SORTIN    DD DISP=SHR,DSN=XXXX.YYYY.IN'),
 000039     TRAILER1=('//SYSIN    DD *'),
 000040     BUILD=(1:C'//OU',1,4,13:C'DD DISP=(,CATLG),',80:X,/,
 000041            1:C'//',16:C'DSN=XXXX.YYYY.OU',1,4,C',',80:X,/,
 000042            1:C'//',16:C'UNIT=SYSDA,SPACE=(CYL,(1,1)),',80:X,/,
 000043            1:C'//',16:C'DCB=(RECFM=FB,LRECL=80)',80:X)
 000044   OUTFIL FNAMES=CTL,
 000045     INCLUDE=(81,4,ZD,EQ,1),
 000046     REMOVECC,
 000047     HEADER1=('  OPTION COPY'),
 000048     TRAILER1=('/*',/,'//'),
 000049     BUILD=(3:C'OUTFIL FNAMES=OU',1,4,
 000050                       C',INCLUDE=(1,4,CH,EQ,C''',1,4,C''')',80:X)
 000051 //S2      EXEC PGM=SORT
 000052 //SYSPRINT  DD SYSOUT=*
 000053 //SYSOUT    DD SYSOUT=*
 000054 //SORTIN    DD DISP=(OLD,PASS),DSN=&JCL
 000055 //          DD DISP=(OLD,PASS),DSN=&CTL
 000056 //SORTOUT   DD SYSOUT=*
 000057 //SYSIN     DD *
 000058   OPTION COPY
 ****** **************************** Bottom of Data ****************************
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: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: dynamic jcl through Rexx

Postby coolpinky » Sun Jun 09, 2013 9:35 pm

1234 ...key is not fixed..It is a random number generated by system so it cannot be defined.
coolpinky
 
Posts: 11
Joined: Fri Jun 07, 2013 4:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: dynamic jcl through Rexx

Postby enrico-sorichetti » Sun Jun 09, 2013 10:14 pm

before criticizing did You try to run the snippet posted as is
did You run it and tried to understand it ?
it will behave properly for any key composed of 4 alpha numerics ( upper case letters and numbers ).

Do you realize that today is sunday and psychic day is wednesday.
( being able to guess what You want for a poor description of the requirement )

if You want good answers learn to post better questions.

the snippet as posted satisfied the description of the requirement
( it was posted as is for a similar request on the sibling forum )

a better description would have told ..
the position, length, format of the key ...
the number of different keys
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: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: dynamic jcl through Rexx

Postby coolpinky » Mon Jun 10, 2013 10:44 am

I tried running the rexx code.
I got maxx cc-0 but my files are not alllocated

I used the below jcl
//STEP1 EXEC PGM=IKJEFT01
//SYSEXEC  DD DSN=HLQ.PINKY.CTLLIB(REXX4),DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//TULIN    DD  DSN=HLQ.PINKY.REXX.INPUT3,DISP=SHR
//SYSTSIN  DD  DUMMY


Rexx code is :
/* REXX */
LASTKEY = ''
DSN     = ''
DROP RECORD.
"EXECIO 1 DISKR TULIN"
DO WHILE (RC=0)
  PULL RECORD.1
  THISKEY = SUBSTR(RECORD.1,1,4)

  IF (THISKEY¬LASTKEY) THEN DO
    IF (LASTKEY¬='') THEN DO
      "EXECIO 0 DISKW TULOUT (FINIS"
      "FREE FI(TULOUT)"
      ADDRESS ISPEXEC "FTOPEN  TEMP"
      ADDRESS ISPEXEC "FTINCL  FOO"
      ADDRESS ISPEXEC "FTCLOSE"
      ADDRESS ISPEXEC "VGET ZTEMPF"
      "SUBMIT '"ZTEMPF"'"
      DSN = "HLQ.PINKY"D.THISKEY
      "ALLOC FI(TULOUT) DA("DSN") NEW SPACE(1,1) TRACKS LRECL(80)",
            "RECFM(F B)"
END
LASTKEY = THISKEY
      END

      "EXECIO 1 DISKW TULOUT (STEM RECORD.)"
      "EXECIO 1 DISKR TULIN"

Can you guide why files are not allocated

Code'd
coolpinky
 
Posts: 11
Joined: Fri Jun 07, 2013 4:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: dynamic jcl through Rexx

Postby BillyBoyo » Mon Jun 10, 2013 11:38 am

Please use the Code tags to preserve spacing, use the Preview button to ensure your posting looks like how you want it to look.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: dynamic jcl through Rexx

Postby Akatsukami » Mon Jun 10, 2013 3:29 pm

coolpinky wrote:I tried running the rexx code.
I got maxx cc-0 but my files are not alllocated

I used the below jcl
//STEP1 EXEC PGM=IKJEFT01
//SYSEXEC  DD DSN=HLQ.PINKY.CTLLIB(REXX4),DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//TULIN    DD  DSN=HLQ.PINKY.REXX.INPUT3,DISP=SHR
//SYSTSIN  DD  DUMMY

  1. Add a TRACE I (or R) statement at the beginning and re-run it.
  2. You do have ALTER access to HLQ, yes?
  3. To short-circuit the next complaint, viz., "My jobs aren't getting submitted!", you evidently didn't bother to read
    I assume that you're running this in background ISPF

    You're not; you're running background TSO.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post