How to execute job step reverse order



How to execute job step reverse order

Postby gunesh » Wed Mar 06, 2013 11:29 pm

How to execute job step reverse order without use IEBEDIT utility?
gunesh
 
Posts: 4
Joined: Wed Mar 06, 2013 10:49 pm
Has thanked: 2 times
Been thanked: 0 time

Re: How to execute job step reverse order

 

Re: JCL

Postby enrico-sorichetti » Wed Mar 06, 2013 11:36 pm

please a moderator move the topic to the stupid questions section :geek:
also why post a topic with the title jcl in the cobol section ???
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

These users thanked the author enrico-sorichetti for the post:
gunesh (Fri Mar 08, 2013 11:47 am)
enrico-sorichetti
Global moderator
 
Posts: 2636
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 129 times

Re: JCL

Postby Akatsukami » Wed Mar 06, 2013 11:38 pm

You didn't read any of the rules for posting here, kusomushi, did you? :x

The answer is simply to use another tool, as Rexx or your shop's sort product, to rearrange the steps. Of course, even a software engineer would never actually do so foolish a thing.
"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

These users thanked the author Akatsukami for the post:
gunesh (Fri Mar 08, 2013 11:48 am)
User avatar
Akatsukami
Global moderator
 
Posts: 1052
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: JCL

Postby Robert Sample » Thu Mar 07, 2013 12:14 am

enrico: topic moved.

gunesh: WHY would you want to do such a thing? Usually a job consists of a set of programs that are executed sequentially because the output of the first step is used by the program in the second step and so forth. Reversing the steps means you will have programs executing before their input data is available, or is not sorted correctly.
Robert Sample
Global moderator
 
Posts: 3363
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 221 times

Re: JCL

Postby BillyBoyo » Thu Mar 07, 2013 12:34 am

I think I'd use the editor, use M(ove) and A(fter) until the task is comlete. Then SUBmit. Then CANcel, as the whole thing seems pointless.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to execute job step reverse order

Postby Ed Goodman » Thu Mar 07, 2013 7:51 pm

Man, that is one DOOZY of a first post.

I spent a few minutes trying to decipher it, but no luck. The implication is that IEB* can do what they need. But I can't transform that into any useful tasks in my mind.

Do they really mean data?
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: How to execute job step reverse order

Postby gunesh » Fri Mar 08, 2013 11:46 am

I am fresher in mainframe and looking for job.

I know that it is foolish question,

But why this question asked during interview.

:)
gunesh
 
Posts: 4
Joined: Wed Mar 06, 2013 10:49 pm
Has thanked: 2 times
Been thanked: 0 time

Re: How to execute job step reverse order

Postby enrico-sorichetti » Fri Mar 08, 2013 12:33 pm

that' s what usually foolish interviewers do ...
they ask foolish questions ;)

and ... why didn' t You say so from the beginning ???
( that it was an interview question You were asked )
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: 2636
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 129 times

Re: How to execute job step reverse order

Postby Ed Goodman » Fri Mar 08, 2013 8:05 pm

From some of the horror stories I've heard from some of my sub-continental co-workers, I'd guess it was a set up.

Some companies are forced to interview people they don't want to hire, so they have questions like this. It allows them to say that none of the people who applied were able to answer the questions. Then they can hire the friend/cousin/brother that was already promised the job.

Sorry that's inflammatory, it's just what I've been told.
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: How to execute job step reverse order

Postby BillyBoyo » Sat Mar 09, 2013 7:13 am

Well, there's always DFSORT to the rescue:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION EQUALS
  INREC IFTHEN=(WHEN=INIT,
  OVERLAY=(81:C'257')),
        IFTHEN=(WHEN=INIT,
                  PARSE=(%00=(STARTAFT=BLANKS,FIXLEN=5))),
        IFTHEN=(WHEN=INIT,
                  OVERLAY=(84:%00)),
        IFTHEN=(WHEN=GROUP,
                  BEGIN=(1,2,CH,EQ,C'//',
                     AND,3,1,CH,NE,C'*',
                     AND,84,4,CH,EQ,C'EXEC '),
                  PUSH=(81:ID=3))
  SORT FIELDS=(81,3,CH,D)
  OUTREC BUILD=(1,80)
                                                         
//SORTIN   DD DATA,DLM=ZZ
//TEXT JOB STUFF
// OTHER STUFF BEFORE FIRST STEP
// EXEC 1
//* EXEC PART OF STEP 1, BUT A COMMENT
// 1
// EXEC 2
// 2
// EXEC 3
// 3
ZZ


Produces this:

//TEXT JOB STUFF                     
// OTHER STUFF BEFORE FIRST STEP     
// EXEC 3                             
// 3                                 
// EXEC 2                             
// 2                                 
// EXEC 1                             
//* EXEC PART OF STEP 1, BUT A COMMENT
// 1                                 


The record is "extended" by adding the characters "257" at position 81. 257 is more steps than you can have in a job. PARSE is then used to find the first field after one or more blanks, and five bytes are extracted. This is appended after the 257. WHEN=GROUP is used, starting if a JCL line and not a "comment" and the second extension is "EXEC ", to identify the start of a step. A 3-byte ID is PUSHed, overwriting the "257". This ID will be on all records of the group.

The data is SORTed, descending, with OPTION EQUALS, on the "257"/ID field, leaving the "job-related" statements at the top, and then producing the steps in reverse order.

This would only be of any use if there is no dependency in the steps from one to another.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Stupid Questions