Simple Hello World in JCL???

This forum provides the support of Dezhi Mainframe systems. Please post your questions about logon, usage of our mainframe environment.

Moderators: sysprog, prino, sfan, steve-myers, Tim001

Simple Hello World in JCL???

Postby ltanner » Mon 13 Feb 2012, 14:08

Hi friends,
I hope everyone is fine and doing well. When we learn new computer languages, normally we start with the conventional hello world program to get the feel of the language, and then get going. Could you please tell me how I can run the hello world program in JCL under zos? I would appreciate if you tell me all the steps...

1) How to create a dataset, and type the code for hello world program in JCL
2) How to execute the jcl dataset?

Looking forward to your kind replies!

Thanks in advance!!!
ltanner
 
Posts: 6
Joined: Tue 27 Dec 2011, 17:30

Re: Simple Hello World in JCL???

Postby nclouston » Mon 13 Feb 2012, 14:38

You cannot - JCL is NOT a programming language. It is for telling the OS what resources your job needs. Please refer to the JCL Language Reference manual and the JCL Users Guide which are two manuals you should alwys read when learning a new 'language'.

I would also suggest that if you did not realise the above then perhaps you should not be on this system but that is up to admin. Many of the recent problems have been caused by people thinking this is their own machine and no-one else uses it so they can do what they like. Maybe you are not like that in which case - just be careful to not update/delete datasets that are not your own - i.e. start with your own userid until you are more proficient.
nclouston
 
Posts: 67
Joined: Fri 09 Apr 2010, 17:55

Re: Simple Hello World in JCL???

Postby rsilver » Mon 13 Feb 2012, 14:49

Last edited by rsilver on Tue 14 Feb 2012, 00:20, edited 1 time in total.
Richard (Rick) Silvers

E-mail.......: rsilvers@mebtel.net or rick_silvers@rsilvers.com
My Website: http://www.rsilvers.com/
Webmaster: http://main.nc.us/yancey/
rsilver
 
Posts: 92
Joined: Thu 10 Nov 2011, 13:08
Location: Mebane, NC USA

Re: Simple Hello World in JCL???

Postby nclouston » Mon 13 Feb 2012, 15:06

Simpler rexx example...

/* rexx */
say 'hello world'

the /* rexx */ line is not necessary if the program is in the SYSEXEC concatenation - but as it would be in your own library it is necessary. An end statement is not necessary in this case as the program stops when it falls off the end.
nclouston
 
Posts: 67
Joined: Fri 09 Apr 2010, 17:55

Re: Simple Hello World in JCL???

Postby rsilver » Mon 13 Feb 2012, 18:50

Last edited by rsilver on Tue 14 Feb 2012, 00:20, edited 1 time in total.
Richard (Rick) Silvers

E-mail.......: rsilvers@mebtel.net or rick_silvers@rsilvers.com
My Website: http://www.rsilvers.com/
Webmaster: http://main.nc.us/yancey/
rsilver
 
Posts: 92
Joined: Thu 10 Nov 2011, 13:08
Location: Mebane, NC USA

Re: Simple Hello World in JCL???

Postby steve-myers » Mon 13 Feb 2012, 21:23

Strictly speaking, this is not all JCL.
Code: Select all
//A       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  *
 /* REXX */
SAY 'HELLO WORLD'
//SYSUT2   DD  DISP=(,PASS),
//             UNIT=SYSDA,
//             SPACE=(TRK,(1,1,1)),
//             DCB=(RECFM=FB,LRECL=80,
//             BLKSIZE=800),
//             DSN=&&EXEC(HELLO)
//SYSIN    DD  DUMMY
//B       EXEC PGM=IKJEFT01,PARM='%HELLO'
//SYSEXEC  DD  DISP=(OLD,DELETE),DSN=&&EXEC
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
The first job step creates a temporary PDS with our HELLO EXEC in it.

The second step runs TSO to execute the EXEC. The PARM='%HELLO' directs TSO to lcate an exec named HELLO. The output appears in the dataset specified by the SYSTSPRT DD statement. The SYSTSIN DD statement specifies a "dummy" dataset; when TSO tries t read the dataset it gets an end of dataset indication. The SYSEXEC DD statement specifies the temporary PDS from the first step.

You "execute" JCL by "submitting" the dataset or PDS member using the SUBMIT command in TSO. A batch job can submit a dataset or PDS member by using a copy utility and directing the output to a dataset specified as an "internal reader." Although there are some fancy, and often poorly understood bells and whistles in the TSO SUBMIT command, at it's heart it's just a copy program that copies the input dataset to a dataset defined as an "internal reader."
Last edited by steve-myers on Tue 14 Feb 2012, 04:27, edited 1 time in total.
steve-myers
 
Posts: 452
Joined: Tue 04 May 2010, 15:43

Re: Simple Hello World in JCL???

Postby prino » Mon 13 Feb 2012, 21:32

And what does all of the above have to do with FanDeZhi?

There are other fora much more suitable for this kind of discussion...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
Some programming here :mrgreen:
prino
 
Posts: 479
Joined: Sat 06 Jun 2009, 21:41
Location: Vilnius, Lithuania

Re: Simple Hello World in JCL???

Postby rsilver » Sun 19 Feb 2012, 18:24

prino wrote:And what does all of the above have to do with FanDeZhi?

There are other fora much more suitable for this kind of discussion...


does fdz have a fora for this type of stuff ? forgot about ICETOOL, you can create some nice looking reports with just JCL and DFSORT's ICETOOL

Code: Select all
//RSILVERJ JOB (12345678),'RSILVER',MSGCLASS=H,                         
//             MSGLEVEL=(1,1),CLASS=A,                                 
//             NOTIFY=&SYSUID,REGION=200M                               
//*------------------------------------------------------------------*//
//* STEP010 - DISPLAY HELLO WORLD                                    *//
//*------------------------------------------------------------------*//
//STEP010  EXEC PGM=ICETOOL                                             
//DFSMSG    DD SYSOUT=*                                                 
//TOOLMSG   DD SYSOUT=*                                                 
//LIST      DD SYSOUT=*                                                 
//INPUT     DD *                                                       
  HELLO WORLD                                                           
//TOOLIN    DD *                                                       
  DISPLAY FROM(INPUT) LIST(LIST) -                                     
  TITLE('HELLO WORLD') -                                               
  ON(1,15,CH)                                                           
//                                                                     
Richard (Rick) Silvers

E-mail.......: rsilvers@mebtel.net or rick_silvers@rsilvers.com
My Website: http://www.rsilvers.com/
Webmaster: http://main.nc.us/yancey/
rsilver
 
Posts: 92
Joined: Thu 10 Nov 2011, 13:08
Location: Mebane, NC USA


Return to Dezhi systems: Mainframe

Who is online

Users browsing this forum: No registered users and 0 guests

cron