Get ready for zOS Version 2 release 1

The next zOS update (Version 2 release 1) is coming in 2013 September. There are many new cool features added to zOS 2.1. The new zOS requires IBM System z9 or higher hardware to run.

Read more about zOS 2.1 at IBM page.

http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?subtype=ca&infotype=an&appname=iSource&supplier=877&letternum=ENUSZP13-0013

 

Submit or Retrieve Jobs with FTP / Alternative For Remote Job entry (RJE)

This post is about an alternative for remote job entry, you can use the TCP/IP FTP service in zOS and a Shell/command prompt to retrieve, List, and submit Jobs to Mainframe.

Basic Commands used in this article

FTP                   – To start FTP
Open remore_system_ip – To connect to host via FTP
QUOTE site filetype=JES     – Connect to JESPLEX, (conect to JES in layman terms)
DIR                   – List Jobs
Get filename          – Get Job dataset from remote system
PUT filename          – Submit Job

Make Sure that the FTP is up and running in your mainframe system.

You can do this by find the “TCPIP” job in your spool.

Connect to Mainframe via FTP

Open the command prompt/Shell and Enter FTP.
Enter Open your mainframe_host_ip
Enter your user ID followed by password

C:>ftp
ftp> open demomvs.demopkg.ibm.com

Connected to demomvs.demopkg.ibm.com.
220-FTPD1 IBM FTP CS V1R13 at demomvs.demopkg.IBM.COM, 05:53:23 on 2012-11-30.
220 Connection will close if idle for more than 5 minutes.
User (demomvs.demopkg.ibm.com:(none)): dds1764
331 Send password please.
Password:
230 DDS1764 is logged on.  Working directory is “DDS1764.”.
ftp>

At this point you are connected to MVS subsystem,  if you issue a DIR you can see your MVS datasets, issue SITE FILETYPE=JES to get connected to JESPLEX

ftp> quote site filetype=jes
200 SITE command was accepted

Issue a DIR command to see the jobs.

Unlike SDSF, the dir command display the last ran job, first in the list

ftp> dir
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01683 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01682 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01681 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01680 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01678 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01676 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01675 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01673 DDS1764  OUTPUT A        RC=0016 4 spool files
DDS1764J JOB01672 DDS1764  OUTPUT A        RC=0016 4 spool files
DDS1764J JOB01667 DDS1764  OUTPUT A        RC=0016 5 spool files
DDS1764J JOB01665 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764J JOB01662 DDS1764  OUTPUT A        (JCL error) 3 spool files
DDS1764C JOB00417 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS17641 JOB00414 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764E JOB05786 DDS1764  OUTPUT A        RC=0000 4 spool files
DDS17641 JOB04559 DDS1764  OUTPUT A        RC=0000 5 spool files
DDS17641 JOB04557 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS17641 JOB04555 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS17641 JOB04498 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764  TSU01992 DDS1764  ACTIVE TSU
250 List completed successfully.
ftp: 1430 bytes received in 0.70Seconds 2.03Kbytes/sec.
ftp>

Issue DIR JOBID to see the files associated with the JOB

ftp> dir JOB01982
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS1764
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000
——–
         ID  STEPNAME PROCSTEP C DDNAME   BYTE-COUNT
         001 JES2              A JESMSGLG      1137
         002 JES2              A JESJCL         425
         003 JES2              A JESYSMSG      4303
         004 STP010            A SYSOUT        2645
         005 STP010            A JNF1JMSG      2746
         006 STP010            A JNF2JMSG      2746
6 spool files
250 List completed successfully.
ftp: 500 bytes received in 0.00Seconds 166.67Kbytes/sec.

Issue GET JOBID.n “destination_file” to ftp the job files from Mainframe to your machine. If you issue GET JOBID.n (n is a number) you will get the nth file from JOB, if it is GET JOBID.X you will get all the files belongs to that JOB

ftp> get JOB01982.x “C:temp1JOB01982.x.txt”
200 Port request OK.
125 Sending all spool files for requested Jobid
250 Transfer completed successfully.
ftp: 22154 bytes received in 1.53Seconds 14.47Kbytes/sec.
ftp> get JOB01982.1 “C:temp1JOB01982.1.txt”
200 Port request OK.
125 Sending data set DDS1764.DDS1764J.JOB01982.D0000002.JESMSGLG
250 Transfer completed successfully.
ftp: 1312 bytes received in 0.00Seconds 1312.00Kbytes/sec.
ftp>

Issue PUT “JCLL_location”  (JCLL_location is the JCL file path in your local machine). Eg. in my Machine the JCL is located at “C:temp1sort_jcl.txt”

image

ftp> put “C:temp1sort_jcl.txt”
200 Port request OK.
125 Sending Job to JES internal reader FIXrecfm 80
250-It is known to JES as JOB02315
250 Transfer completed successfully.
ftp: 754 bytes sent in 0.37Seconds 2.02Kbytes/sec.
ftp>

Issue DIR to see the latest JOB

250 Transfer completed successfully.
ftp: 754 bytes sent in 0.37Seconds 2.02Kbytes/sec.
ftp> dir
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS1764
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB02315 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01683 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01682 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01681 DDS1764  OUTPUT A        RC=0016 6 spool files

 

Guys try this yourself, if this post helped you, don’t forget to Comment/like/share the page and of course visit the below advertisement.

Cheers- Shibu Thannikkunnath

Installing and configuring 3270 Terminal emulator in Mac

Step 1. Download 3270 client for MAC OSX

Download tn3270 from here – http://www.brown.edu/cis/tn3270/index.html#latest . When I’m writing this article the latest version of tn3270 is 3.3b6 (beta). It worked perfectly in my 2012(mid) Macbook pro Retina display.

Step 2. Mount the dmg and open the disk in finder.

Screen Shot 2012-11-29 at 7.46.32 PM

Step 3. Copy tn3270x Application file to your applications folder

Step 4. Invoke tn3270x by double clicking on the application

Screen Shot 2012-11-29 at 7.50.15 PM

Fill your hostname on “Host Name” field. By default the port will be 23, but if you want you can change the port number by clicking on “Special” Button

Screen Shot 2012-11-29 at 7.52.40 PM

Once you are done with your settings, click on “open connection” Button.

Screen Shot 2012-11-29 at 7.55.50 PM

I have used Fandezhi/efglobe mainframe, it is a free mainframe and can be used for your skills development. If you want to know more about creating an id, visit my post about getting a free mainframe id (http://mainframegeek.me/2012/11/23/free-mainframe-id-to-practice/)

That’s it; you know how to go from here J Hey guys, if this post helped you, subscribe for my posts, share it or like my Facebook page.

Cheers –Shibu-

          

 

Declare numeric field with More than 18 Digits in Cobol

Have you ever wondered about the 18digits maximum limit of Numerical variable declaration (PIC 9(18) ) in Cobol?

Well you can override it in Enterprise Cool, or in other words if Language environment (a.k.a LE) is available at your shop. The Language environment is introduced back in 2000 by IBM, which is a common application layer for many Programming languages. The LE has a lot of cool features which I’ll be covering future posts. So keep coming back.

Here is a sample program for Numeric field declaration with more than 18 digits. The Compiler directive (CBL) is that really turning the ship around.

This compiler-directing statement selectively suppresses output or causes output to be produced. The keywords *CONTROL and *CBL are synonymous.

The Program logic is simple its just move a 31 digit number to the number 1 variable, then add it with itself and display it.

If you Don’t have mainframe access to try it out, visit my post on getting a free mainframe id, it really helps.  http://mainframegeek.me/2012/11/23/free-mainframe-id-to-practice/ . It’s a raw mainframe so you won’t be getting handy compile JCL on this mainframe, let me know if you need one, I can help you.

 CBL ARITH(EXTEND)
IDENTIFICATION DIVISION.
PROGRAM-ID. COB18DIG.
AUTHOR.     SHIBU.T.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
77  WS-NUM1                      PIC 9(31).
*
PROCEDURE DIVISION.
A0000100-MAIN-PARA.
MOVE 1234567890123456789012345678901
TO WS-NUM1.
DISPLAY ‘WS-NUM1 BEFORE ADDITION: ‘ WS-NUM1.
ADD WS-NUM1                 TO WS-NUM1.
DISPLAY ‘WS-NUM1 AFTER ADDITION: ‘ WS-NUM1.
STOP RUN.

 

The compile and run JCL will complete with return-code 000, here is the output I got in my machine.

image

Does my Program, post helped you? Comment, rate or like my facebook page (top right corner of this page) and click on the adds listed below. It really help me to make this website alive.

-Cheers, Shibu

Setup FTP from Mainframe to Non-Mainframe Method III

Using Microsoft IIS –FTP (Internet Information Services

As I Promised beginning of this series, here is the third method to transfer files from Mainframe to non Mainframe (Windows) . I have used Windows 7 X64 professional Operating system on my laptop and Internet Information Server 7.5.

You could also read other methods I’ve written about FTP’ing files from IBM Mainframe to Windows. These methods are easy to use and utilizes the free resources available in IBM Mainframe as well as Windows/free wares.

1. Simple FTP with Windows Bat file – http://mainframegeek.me/2012/11/20/setup-ftp-from-mainframe-to-non-mainframe-method-ii-using-bat-file/

2. Setup FTP with Filezilla server.

http://mainframegeek.me/2012/09/12/setup-ftp-from-mainframe-to-personal-computermethod-i-using-filezilla-server-on-windows/

3. Setup FTP with IIS (Internet Information Service) FTP server.

http://http://mainframegeek.me/2012/11/23/setup-ftp-from-mainframe-to-non-mainframe-method-iii/

By default Windows comes with Internet Information services. You just need to turn them on.

1. Turn On FTP server in Internet Information Services.

Navigate to Control Panel>Programs and features/Add or remove programs, and click on Turn windows features on or off. It will take  a while to turn on the service.

clip_image002_thumb[2]

2. Add a directory to our FTP server service

Navigate to Control Panel>Administrative tools and open Internet Information services

image

Right click on the FTP area and select View sites,

image

Now right click on the workspace and select add FTP site

Enter a FTP site name and choose directory where you want your incoming (From Mainframe) files stored to.

 clip_image008_thumb[2]

Click on next, select an IP Address (Copy to a text file for using in JCL) make sure you selected No SSL (you won’t be able to transfer files otherwise) and click on next. remember I said in the first method, FTP always uses port 21, so leave it as it is.

image

Click on Next and Enable anonymous authentication (or you can use a user id and password) and hit finish

clip_image012_thumb[2]

On the sites window, right click the FTP site you just created and select Basic Settings

3. Enable windows security

Click on connect as , then select specific user and click on set and enter your windows user id and password

image

Hit Ok for all the dialog boxes and go back to mainframe and edit your JCL as below

4. Submit FTP job from Mainframe

Copy paste the below JCL to your ISPF editor, make the changes as I mentioned below·

  • //STEP001 EXEC PGM=FTP,PARM=’255.255.255.0 —- Change IP address to the one you copied to text file during FTP server setup  (Step 2)
  • update windows (Same credentials you entered on Basic settings window) userid/pasword and file list on //INPUT DD*
  • Update your Data set names followed by the filename on windows on PUT statement

Complete JCL

//DDS1764J JOB NOTIFY=DDS1764
//STEP001 EXEC PGM=FTP,PARM=’255.255.255.0 (EXIT’
//SYSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//INPUT DD *
Windows_user_id
Windows_user_password
DIR
PUT ‘DDS1764.PGMG.CBL(FLEPGM)’ ToIIS.txt
QUIT

Now Submit the JCL (it will complete with MAXCC 000). Due to security issues (I don’t want some spammer to submit random FTP jobs to my PC Winking smile ) I have blurred my ip address.

image 

Then check your shared folder (On your PC) for received file. Did you forget your shared folder? refer back to step 2 to see the folder.

· image

and That’s it now you are familiar with the 3 FTP methods which I know, FTP with IIS as well as Filezilla are same in a way, just the server software on the windows system is changing.

Try these three methods, let me know if you know any other methods (leave a comment on this page or email me @ shibubalakrishnan@live.com). 

If this tutorial helped you, please share the page on facebook, like it and please support me by clicking on the below ads.

Setup FTP from Mainframe to Non-Mainframe –Method II using Bat file

Here is another method with which you can transfer files from Mainframe to a windows Machine. To use this method you need to have a .Bat file and a file with list of files need to be transferred and valid Mainframe credentials.

You could also read other methods I’ve written about FTP’ing files from IBM Mainframe to Windows. These methods are easy to use and utilizes the free resources available in IBM Mainframe as well as Windows/free wares.

1. Simple FTP with Windows Bat file – http://mainframegeek.me/2012/11/20/setup-ftp-from-mainframe-to-non-mainframe-method-ii-using-bat-file/

2. Setup FTP with Filezilla server.

http://mainframegeek.me/2012/09/12/setup-ftp-from-mainframe-to-personal-computermethod-i-using-filezilla-server-on-windows/

3. Setup FTP with IIS (Internet Information Service) FTP server.

http://http://mainframegeek.me/2012/11/23/setup-ftp-from-mainframe-to-non-mainframe-method-iii/

Copy the contents of below table and save it as script.txt. You can save anywhere you want, I saved it on C:temp1 folder. Change my_mainframe_userid and my_mainframe_password to your mainframe user id and password. By default the your HLQ (High level qualifier) will be your mainframe id, so whatever DD names you mention in the script file will have HLQ (High level Qualifier) padded, e.g HLQ.DDS1764.PGMG.CBL(ASCEBCB1) ,

To avoid this, we issue  cd ..    . Update the DD names with your list of data set names, you can either use PDS member names, a PS or Compressed (xmited) PDS or everything. there is no limit for the number of files, but keep in mind that this could eat a lot of bandwidth, followed by the destination file. Save this file as script.txt in your windows machine.

my_mainframe_userid
my_mainframe_password
cd ..
get “DDS1764.PGMG.CBL(ASCEBCB1)”  “C:temp101.txt”
get “DDS1764.PGMG.CBL(ASCED)”  “C:temp102.txt”
get “DDS1764.PGMG.CBL(ASMLNK1)”  “C:temp103.txt”
get “DDS1764.PGMG.CBL(COB18DIG)”  “C:temp104.txt”
get “DDS1764.PGMG.CBL(DIVZERO)”  “C:temp105.txt”
quit

Copy the contents of below table and save it as batchftp.bat .   Before oyu save the file, change my_mainframe_ip  to your mainframe host ip for name. when you save the file from Microsoft notepad, make sure you choose file name: batchftp.bat and Save as type: All Files (*.*) .

echo off
cls
echo Batch FTP From Mainframe to Windows
echo   ***** Created by Shibu Thannikkunnath
echo   ***** mainframegeek@hotmail.com
echo   ***** http://mainframegeek.me
pause
ftp -s:script.txt my_mainframe_ip
exit
pause

 

Make sure you keep both the script.txt as well as the batchftp.bat file in the same folder. Now double click on the batchftp.bat to start download.  Once the script finished you can see all the transferred files in the folder mentioned in script.txt.

image

 

Try the script, let me know if you have any questions. If you think this tutorial helped you, don’t forget to like my facebook page, rate or share.  and support me by watching the below video (Ad)

-Cheers

Shibu

Setup FTP from Mainframe to Non-Mainframe –Method I using Filezilla server on Windows

In this series, I’m going to cover the methods used for FTPing files from Mainframe to Non-Mainframe Platform.  Initially I’ll cover the processes to FTP from Mainframe and later I’m planning to cover the advanced topics like Secure FTP and FTF Methods.

The biggest Challenges while FTPing file from Mainframe are

In Mainframe Files are in EBCDIC format and Non-Mainframe platforms are in ASCII, so if you FTP files with packed Decimals in it (COMP, COMP-1, COMP-3 etc), Target system will not be able to read them properly, SO you need to unpack the fields before you transfer them over FTP

When Transferring Variable length (VB) files (Files with Occurs depending on fields in copybook) , the destination program has to modify to read the counter variable from File and then iterate to read the field. Another solution is that you can change the variable length record to Fixed length record prior to transmitting the file.

You could also read other methods I’ve written about FTP’ing files from IBM Mainframe to Windows. These methods are easy to use and utilizes the free resources available in IBM Mainframe as well as Windows/free wares.

1. Simple FTP with Windows Bat file – http://mainframegeek.me/2012/11/20/setup-ftp-from-mainframe-to-non-mainframe-method-ii-using-bat-file/

2. Setup FTP with Filezilla server.

http://mainframegeek.me/2012/09/12/setup-ftp-from-mainframe-to-personal-computermethod-i-using-filezilla-server-on-windows/

3. Setup FTP with IIS (Internet Information Service) FTP server.

http://http://mainframegeek.me/2012/11/23/setup-ftp-from-mainframe-to-non-mainframe-method-iii/

FTP uses Port 21, when you send files from zOS to Windows PC, zOS expects a FTP server listening on Port 21 at windows box. This is the bare minimum requirement for FTPing, (a client to send file and a FTP server on the receiver side). zOS has a FTP server built into it and that’s why we are able to send files from PC to Mainframe(Using Command prompt, Windows Shell is the next Method in this series).

You can use this method to transfer a single Member / a PDS or a huge list of PDS’es to Mainframe. There is no limit for the data which you can send over FTP but, it can burn down you company bandwidth Winking smile

When  you FTP a bunch of datasets, you can compress them into a single one or add as a list in the JCL. See this link to know about compressing the  dataset using IEBCOPY –http://mainframegeek.me/2011/01/20/the-iebcopy/

Step1. Make windows ready

· Step1. Download Filezilla – it’s a freeware/open-source software.

· Step2. Install

  • Just Double click on the exe file to install, accept all the defaults and click on finish.
  • Soon after the installation, filezilla server interface program will run and you will get a dialog box, just click ok. You will be on the server interface
  •  image
  • Select Edit>Groups
  • Click on Add button and enter a group name (I used “Admin”), click on ok.
  • Click on the Shared folders Node on page Pane (Left Side), then click on Add button and choose a Folder where you want your FTP’ed file to be stored into. Select all the access (read/Write/delete) and click on set as Home directory
  •  image
  • Click on ok.
  • No go back to Edit>Users
  • Click on add button, Enter a user name click on Ok and check password box and enter a password and click on ok. 9Make a note of User id and password, you need to provide this in the JCL you submit from Mainframe)
  •  image
  • Click on Ok.
  • Now your system is ready and listening to PORT 21, user id/Password will the one you created in previous step.

Step2. FTP File from Mainframe.

//DDS1764J  JOB NOTIFY=DDS1764                        
//STEP001 EXEC PGM=FTP,PARM='<your Windows machine IP> (EXIT’
//SYSPRINT  DD SYSOUT=*                               
//OUTPUT    DD SYSOUT=*                               
//INPUT     DD *                                      
<Enter your filezilla User Id>                                                     
<Enter your File zilla Password>                                               
DIR                                                   
PUT ‘<Source PDS(Member) or PDS’ ‘Target file_name.txt’  
PUT ‘<Source PDS(Member1) or PDS’ ‘Target file_name1.txt’
PUT ‘<Source PDS(Member2) or PDS’ ‘Target file_name.txt’        
QUIT
                                                                                     

Changes on the above jcl

  • Update your machine IP address on Step001. If you don’t know your system password, go the end of this webpage  – //STEP001 EXEC PGM=FTP,PARM='<your Windows machine IP> (EXIT’
  • Update Filezilla user id and password in input – in the above jcl, <Enter your filezilla User Id>, <Enter your File zilla Password>
  • Update the put command with your file list –  PUT ‘<Source PDS(Member) or PDS’ ‘Target file_name.txt’
  • Submit JCL

image

Once you submit the JCL you can monitor the log on filezilla screen.

image

Step3. Confirm reception of file.

You can see the FTP’ed file on the Filezilla Home directory (Directory you added while installing filezilla).

clip_image002[9]

 

How to Find Host IP Address sin windows Windows

  • Go to Windows Command Prompt and type “IPCONFIG” and Press Enter.
  • Scroll down till you see the IPv4 address, I have blurred my IP address in the screenshot due to security issues.
  • image

 

That’s it for the day, Guys If this tutorial helped you or if it’s a useful information then please promote my website by sharing on facebook, g+ or or by rating the page.

If you have any questions or suggestions please add it into the comment section or email me to shibuthannikkunnath@gmail.com.  For the guys who suggested the topics, please keep visiting my website, I’ll be adding them soon.

Cheers

-Shibu Thannikkunnath-

How to Fix “GDG Generation Not Found JCL Error”

Here is the snippet to avoid JCL error due to NO GDG Generations are found on SMS.

You know that the only possible way to avoid DATASET NOT FOUND JCL Error is “Create datasets or use Dummy” here is a method to handle the errors in JCL itself.

You can have IDCAMS to issue LISTCAT LVL to list all the generations for the GDG and the move the out put to an input file, then use SORT utility to Check the resultant file for the .G and V00 characters on the file. If no GDG generations found set Return code of the step to 4 (it can be anything). then setup COND parameter for an IEFBR step in such a way that if the CONDCODE matches 4 (“COND=(4,NE)”), create the versions :)

JCL.

//R0318BMJ  JOB ‘GDG VER FINDER’,NOTIFY=R0318B               
//IDCAMS   EXEC PGM=IDCAMS                                   
//SYSPRINT DD DSN=&&TEMP,DISP=(,PASS)                        
//SYSIN    DD *                                              
LISTCAT LVL(‘TSHRCI.PATMAN.REPORT.GROUP’) ALL               
/*                                                           
//*                                                          
//GETPOS   EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=&&TEMP,DISP=SHR                            
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                              
OPTION    NULLOUT=RC4,VLSCMP                                
SORT      FIELDS=COPY                                       
 INCLUDE   COND=(48,2,CH,EQ,C’.G’,AND,54,3,CH,EQ,C’V00′)     
/*                                                           
//MODEL    EXEC PGM=IEFBR14,COND=(4,NE,GETPOS)               
//GDGMODEL DD   DSN=TSHRCI.PATMAN.REPORT.GROUP(+1),          
//         DISP=(NEW,CATLG,DELETE),                          
//         UNIT=SYSDA,                                       
//         SPACE=(TRK,(1,1),RLSE),                           
//         DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)      
//SYSPRINT DD   SYSOUT=*                                     
//SYSIN    DD DUMMY
                                          

INCLUDE   COND=(48,2,CH,EQ,C’.G’,AND,54,3,CH,EQ,C’V00′) 

Once you executed IDCAMS step the messages from LISTCAT will be moved to &&TEMP dataset, then using the above CONDITION statement SORT utility will check for .G and V00 characters on the TEMPDATASET, if found SOR will skip the step else if set RETURN CODE 4.

The TEMP Dataset is FBA, so you need to add 4 bytes to the actual position of the characters on TEMP dataset. 44 and 50 are the Character positions of .G & V00 on my TEMPDATASET, after adding 4 it will become 48 and 54.  To find the positions of your characters replace TEMP with a dataset on your system then, check the file. “Don’t forget to add 4 bytes”

//MODEL    EXEC PGM=IEFBR14,COND=(4,NE,GETPOS)

This will execute only if the GETPOS step returned a return code of 4.

Let me know if you have any concerns on the JCL. and Like it/rate it/Comment on it you like the post.

Thanks

-Shibu-

Programming a CICS-DPL-COBOL application & setting up the region.

DPL (Distributed Program Link) enables a Local CICS program to issue a EXEC CICS LINK to a program in the remote CICS region which return control to the calling program. DPL provides the below advantages for a CICS application.

  1. It allows a non OS390/zOS application to use DL/I, SQL, BDAM and VSAM files owned by a zOS/os390 system.
  2. Allows CICS programmer to use LU 6.2 link Protocol without knowing the protocol.
Restrictions of DPL.

You cannot use the below CICS services on the remote application.

  1. You cannot issue any terminal control commands. e.g. SEND, RECEIVE.
  2. No BMS commands.
  3. No security commands like SIGNON or SIGNOFF.

If you are receiving any abends on the remote application and it didn’t handle the abend by itself then, abend code will returned to the Main program.

Defining and installing CICS entries.

Assume that you have a Mainframe connectivity like below.

image

Here I have 2 TSO sessions, 8 CICS regions, 2 IMS, 1 CICSPlex/SM and few Session manager setups and Misce sessions.

I am using the CICSA and CICSB regions, I.e my Main program is in CICSA and it then calling the program on CICSB using a COMMAREA, second program will write the message passed in commarea into a VSAM file, set a message onto COMMAREA and returns into CICSA region.

Before you are getting started with your program, make sure that MRO/ISC is configured in your Mainframe, you can contact you system Admin or follow my instructions below.

  1. Go to your CICS region batch job in spool.
  2. Open the JESYSMSG and Check for ISC and IRCSTRT init parms are setup to YES.
  3. IF the above initparms are not setup to YES then you need to ask your sysadmin to set this up before you continue with DPL program.
Usually SYSADMIN do the below steps to setup ISC or IRCSTRT.
  1. Bring down CICS region using master console or Perform SHUTDOWN using CEMT.
  2. Find SIP parameter for the region.
  3. Go to SYSIN PDS of the Installed CICS TS.
  4. Find the DFH$SIP<SIP PARM> member and add the ISC and IRCSTRT parms.
  5. Restart CICS region.

You can also issue a CEMT I IRC to check whether IRC is setup for the region.

image

Steps to create CICS table entries for a DPL program.

  1. Define and Install the main program on LOCAL CICS region as usual.
  2. Define and install Mirror Entries of remote CICS transaction and program on LOCAL CIS region. Set the remote Attributes (Remote System as the 4 digit remote CICS region ID, and program name) You can see the remote system ID on SYSID field once you issue a CEMT/CEDA command (See below screenshots).
  3. Go to Remote CICS region and define and Install only remote Program and Transaction.
  4. Compile CICS programs and move Load module to the respective libraries of local and Remote CICS regions.
  5. Perform New copy for the Local program on Local CICS region and Remote program on remote region.
  6. Invoke the Local CICS program using the defined Transaction on Local CICS region.
DPL Sample program

Main program.

IDENTIFICATION DIVISION.
PROGRAM-ID. CDPL01A.
AUTHOR.     SHIBU.T.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
77  WS-MSG-1                    PIC X(100).
77  WS-MSG-LEN                  PIC S9(4) COMP.
*
01  WS-COMMAREA.
     02  WS-RECID                PIC X(10).
     02  WS-MSG                  PIC X(40).
     02  WS-PROG-ID              PIC X(08).
LINKAGE SECTION.
01  DFHCOMMAREA.
     02  LS-COMMAREA.
         03  LS-RECID            PIC X(10).
         03  LS-MSG              PIC X(40).
         03  LS-PROG-ID          PIC X(08).
PROCEDURE DIVISION.
A0001-MAIN-PARA.
     MOVE SPACES                 TO WS-COMMAREA WS-MSG-1.
     IF EIBCALEN = 0 THEN
        PERFORM A00150-INITIALIZE
     ELSE
        PERFORM A00200-LINK
     END-IF.

*
A00150-INITIALIZE.
     MOVE ‘PROGRAM ON CICSAOR1 REGION’
                                 TO WS-MSG.
     MOVE ‘1000000123’           TO WS-RECID.
     MOVE ‘CDPL01A’              TO WS-PROG-ID.
     MOVE ‘WS-MSG BEFORE DPL: ‘  TO WS-MSG-1(1:20).
     MOVE WS-MSG                 TO WS-MSG-1(21:26).
     MOVE ‘* PROGRAM-ID: ‘       TO WS-MSG-1(47:14).
     MOVE WS-PROG-ID             TO WS-MSG-1(61:08).
     EXEC CICS SEND TEXT
         FROM(WS-MSG-1)
         ERASE
     END-EXEC.
     EXEC CICS RETURN
         TRANSID(‘AA05′)
         COMMAREA(WS-COMMAREA)
     END-EXEC.

*
A00200-LINK.
     MOVE LS-COMMAREA            TO WS-COMMAREA.
     EXEC CICS LINK
         PROGRAM(‘CDPL01B’)
         COMMAREA(WS-COMMAREA)
     END-EXEC.

     MOVE SPACES                 TO WS-MSG-1.
     MOVE ‘WS-MSG AFTER  DPL: ‘  TO WS-MSG-1(1:20).
     MOVE WS-MSG                 TO WS-MSG-1(21:26).
     MOVE ‘* PROGRAM-ID: ‘       TO WS-MSG-1(47:14).
     MOVE WS-PROG-ID             TO WS-MSG-1(61:08).
     EXEC CICS SEND TEXT
         FROM(WS-MSG-1)
         ERASE
     END-EXEC.
     EXEC CICS RETURN
     END-EXEC.

Sub Program on Remote region.

IDENTIFICATION DIVISION.
PROGRAM-ID. CDPL01B.
AUTHOR.     SHIBU.T.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
77  WS-MSG-1                    PIC X(100).
77  WS-MSG-LEN                  PIC S9(4) COMP.
01  WS-FILE-DT.
     02  WS-DAT.
         03  WS-KEY              PIC X(10).
         03  WS-DAT1             PIC X(40) VALUE SPACES.
         03                      PIC X(60) VALUE SPACES.
*
01  WS-COMMAREA.
     02  WS-RECID                PIC X(10) VALUE SPACES.
     02  WS-MSG                  PIC X(40).
     02  WS-PROG-ID              PIC X(08).
LINKAGE SECTION.
01  DFHCOMMAREA.
     02  LS-COMMAREA.
         03  LS-RECID            PIC X(10).
         03  LS-MSG              PIC X(40).
         03  LS-PROG-ID          PIC X(08).
PROCEDURE DIVISION USING DFHCOMMAREA.
A0001-MAIN-PARA.
*    MOVE SPACES                 TO WS-COMMAREA WS-MSG-1.
     MOVE LS-RECID               TO WS-KEY.
     MOVE LS-MSG                 TO WS-DAT1.
     EXEC CICS WRITE
          DATASET(‘VFILE1′)
          FROM(WS-DAT)
          LENGTH(LENGTH OF WS-DAT)
          RIDFLD(WS-KEY)
     END-EXEC.
     MOVE ‘PROGRAM ON CICSAORB REGION’
                                 TO WS-MSG.
     MOVE ‘CDPL01B’              TO WS-PROG-ID.
     MOVE WS-COMMAREA            TO LS-COMMAREA.
     EXEC CICS RETURN
     END-EXEC.

Compile aCICS programs and Move load modules to respective LOAD LIBS of CICS regions.

Please refer to http://mainframegeek.wordpress.com/2011/10/11/prepare-compile-define-install-execute-a-cics-cobol-program/ for more info on how to prepare compile a COBOL-CICS program, how to find LOAD LIB od CICS region and move the Load module.

Defining and Installing Resources to CICS.
On CICS REGION CICSA

Step 1 Create and Install Program entries for the Main program on CICSA, defining is similar to a normal CICS program.

clip_image002[12]

Step 2 Install the program.

clip_image002[32]

Step 3 Define Transaction Entry for Main program on CICSA, you need to mention main program name (CDPL01A) while defining Transaction entry.

clip_image002[8]

Step 4  Install the transaction.

clip_image002[10]

Step 5 Define Mirror Program.

clip_image002[14]

clip_image002[16]

clip_image002[18]

Step 6 Define and Install Mirror Transaction.

clip_image002[22]

clip_image002[24]

clip_image002[26]

on remote region

Step 7 Define, Install Program and Transaction entries .

image

clip_image002[6]

clip_image002[28]

clip_image002[30]

Step 9 Execute Program.

Issue AA05 on CICSA to execute program, do a cedf if you want to see what is exactly happening in the program. This is a pseudo-conversation program, it displays commarea content before links to the remote app. Press enter to issue LINK.

clip_image002[34]

clip_image002[36]

Control came back from Remote app, you can see the commarea contents which set up by remote app.

You can also open the file to ensure that Remote app is getitng COMMAREA conts correctly ( Remote app will write the commarea contents to VSAM file). Look for th last line, that is the message passed on commarea.

clip_image002[38]