viernes, 24 de abril de 2009

Tutorial REXX 2°

Operadores.
= igual
>mayor
>=mayor o igual
<=menor o igual <>distinto
& and
| or
&& or exclusivo
Ciclos y condiciones en REXX.
Como ya todos saben programar esta clase la voy a hacer mas rapida limitandome anda mas a mostrar las sintaxys mediante ejemplos dejandole a ustedes la interpretacion. Si surgiera una duda no tituveenen postear su pregunta.
/* REXX EJEMPLO 3 */
/* DO WHILE */
SAY "Ingrese un numero, corte con el -1"
pull A
DO WHILE A <> -1
SAY "NUMERO " A
SAY "Ingrese un numero, corte con el -1"
PULL A
END
/* REXX EJ 4*/
DO I=0 TO 10 BY 2
SAY "NUMERO PAR: " I
END
/* REXX EJ 5*/
PULL I
IF I=0 THEN
DO
SAY "I=0"
END

Tutorial REXX 1°

Hoy voy a empezar con un tutorial REXX empezando desde 0 haciendo nuestro primer "HOLA MUNDO" y luego en posteriores clases llegando a hacer nuestras propias aplicaciones con pantallas para el ISPF.

El REXX bajo mainframe funciona como un lenguaje interpretado. Al igual que otros lenguajes como JavaScript, etc...
Su sintaxis es muy similar al COBOL por lo que no creo que tengan demasiados problemas.

Sin mas preambulos vamos a hacer neustra primera aplicacion REXX y a explicarla.


Creemos en nuestra libreria un dataset con el nombre "Ejemplo1".
Dentro del dataset en la linea de comandos escribimos Highlight REXX, del mismo modo que lo ahce con COBOL nos resaltara las sentecias del REXX.
Y dentro de el vamos a escribir lo siguiente.

/* REXX NUESTRO PRIMER PROGRAMA*/
SAY "HOLA MUNDO"

Los comentarios dentro de un programa rexx se escrima entre /* esto es un comentario */
La primera linea de un programa REXX siempre debe contener la palabra REXX en un comentario.
En la segunda linea estamos usando la sentencia SAY, que al igual que el DISPLAY en cobol sirve como salida por pantalla y entre comillas ponemos el string a mostrar.

Bastante sencillo no?

Vamos con otro ejemplo.
/* REXX EJEMPLO 2*/
SAY "INGRESAR UN NUMERO"
PULL A
SAY "INGRESAR OTRO"
PULL B
C=A+B
SAY "LA SUMA DE " A " MAS " B " DA " C "."

Como veran el pull sirve apra leer del teclado.
Esto fue todo por hoy, espero les haya servido ya se que fue muy sencillo pero ya vendran cosas mas dificiles.

Comandos TSO

Les dejo a continuacion una lista util de comando TSO con su explciacion en ingles.
#
Invokes a command processor located in a load library allocated to file CMDLIB.
AD
Puts a discrete RACF profile on a specific dataset.
ALias
Gives alias names to members of partitioned datasets. Because use of this command on a load library produces unpredictable results, it is advisable to use LINK in this situation.
ALLOCate
Allocates or creates temporary datasets, associates a file name with a data set, or designates files for output.
ATTRib
Defines DCB parameters to be used with a subsequent ALLOCATE command.
CALL
Executes load modules (programs already compiled and link edited) at the terminal.
CHANGE
Changes the name of a member of a partitioned dataset which is allocated SHR (allocated to more than one user or job at a time). Use of this command on a load library produces unpredictable results.
CODE
Produces an explanation of system completion codes and FORTRAN error codes.
CONCAT
Concatenates (combines) two or more datasets under a single file name. The ALLOCATE command can also perform this function.
DCF
Invokes IBM's Document Composition Facility (DCF) text formatting program.
DD
Deletes the RACF profile for a dataset
DELete
Deletes a data set or a member of a partitioned dataset.
DISASSEM
Disassembles a load module.
DUPlicat
Prints the contents of a dataset.
Edit
Invokes the IBM line editor.
EXec
Executes a clist (command procedure).
FREE
Frees data sets and files allocated to the user's TSO session and deletes attribute lists.
Free All
Frees all data sets and files allocated to the user's TSO session except those allocated by the LOGON procedure.
GI
Invokes ISPF (Interactive Systems Productivity Facility).
HELP
Obtain help about TSO commands.
HELPJCL
Lists the statements necessary to use a catalogued procedure.
HEX
Performs hexadecimal addition or subtraction at the terminal.
IOF
Allows you to show the status of jobs and to browse, print, or cancel the output from jobs.
JOURNAL
List amount of money charged to an account or computer ID.
KERMIT
Transfer a file between a microcomputer and the OS/390 mainframe system.
LD
Lists the RACF profile for a dataset.
LINK
Executes the linkage editor from the terminal.
List
Lists the contents of a sequential dataset or of a member of a partitioned dataset.
LISTAlc
Lists the names of datasets and files currently allocated to the user.
LISTBc
Lists messages saved in the broadcast dataset.
LISTCat
Lists the names of catalogued datasets.
LISTDs
Lists DCB attributes of a dataset or of the members of a partitioned dataset.
LISTHEX
Lists the contents of a dataset in hexadecimal.
LISTLOAD
Lists the names of members of a load library, along with the size and attributes of each load module.
LOADgo
Executes the loader, which loads an object deck (compiled program), resolves external references, and executes the program, from the terminal.
LOGOFF
Ends a TSO session.
LOGON
Initiates a TSO session.
PDS
Access and manipulate the directory and members of a PDS (partitioned dataset).
PE
Provides another user RACF access to specified datasets.
PROFile
Defines certain user characteristics which control the flow of information to and from the user's terminal.
REName
Changes the name of a sequential dataset, of a partitioned dataset, or of a member of a partitioned dataset, or creates an alias for a member of a partitioned dataset. This will not work for load modules (DO NOT rename a permanent dataset).
Run
Compiles, loads, and executes the source statements in a data set.
SAS
Invokes interactive SAS.
SCAN
Searches a load module for a specified hexadecimal string.
SCRatch
Deletes a member of a partitioned dataset.
SEnd
Sends messages to other TSO users.
SHow
Shows the status of a particular job, the status of all jobs belonging to the user, the number of jobs awaiting execution, or the different output files for a particular job.
SIZE
Displays amount of space allocated to a dataset and how much of that space is used.
SPACE
Lists the names of disk packs available to house temporary datasets and how much space is available on them.
SPEAKEZ
Invokes the SPEAKEASY processor.
SUBmit
Submits a job from the terminal (NOTE: SUB is the alias for this command).
TERMinal
Defines terminal characteristics (such as number of lines per screen).
TEST
Debugs assembler language programs at the terminal.
TIME
Displays cumulative CPU time, cumulative session time, service units used, local time of day, and today's date.
TYPE
Prints a message at the user's terminal.
US
Lists all TSO users currently logged on and displays the number of such users.
WhatLine
Lists all TSO users currently logged on together with their line numbers and terminal names.
WHEN
Tests the system return code from a previously executed command.
WHOGOT
Determines to what user or to what job a particular dataset is allocated.
?
Displays additional information if a user has just received a message terminating with a plus sign (+).

Iniciar ISPF Automaticamente con REXX

Buenos dias, hoy les voy a contar como generar un sencillo script en REXX que inicie automaticamente el ISPF cuando nos logueamos al TSO.
Esto en varias implementaciones del ISPF ya viene echo, pero como no sucede en todas considero bueno mostrar como hacerlo.

Cuando uno se loguea al TSO luego de pasar la validacion RACF el puntero se queda en un pantalla negra titilando seguido de la palabra READY. En este momento si ingresamos ISPF y enter se abrira el ISPF.

Para evitar esto lo que podemos ahcer es allocar en la SYSPROC o SYSEXEC un pequeño script que lo haga por nostros.

Para los que no saben cuando uno se loguea al systema se carga automaticamente el archivo de logon guardado en la SYSEXEC de no encontrarlo ahy lo busca en la SYSPROC. Si no saben que libreria esta identificada como SYSPROC O SYSEXEC en su tso pueden ejecutar el comando "LISTALC STATUS" y verificarlo ahy.

Bueno dicho esto les voy a pasar a mostrar el pequeño script, el cual luego debemos guardar con el nombre "LOGON" dentro de la libreria mensionada.
Script

/* REXX */
"ISPF"

Fin script

Asi es tan corto como eso, la primera linea nos indica q es un programa REXX, y la segunda linea al estar entre comillas lo considera comando TSO y lo ejecuta.

Entonces guardando este pequeño script en la libreria con el nombre de LOGON, cada vez que iniciemos el tso se abrira automaticamente el ISPF.

Espero haber sido claro cualquier cosa no duden en preguntar y los invito a dejar comentarios diciedno que les parecio y sobre que quieren escuchar.

viernes, 3 de abril de 2009

ISPF 5 Tips

Buenos días, hoy les hago llegar 10 tips para ISPF que fueron publicados en el foro de ibm hace un tiempo. Como los considero utiles e interesante les dejo la traduccion a continuacion para ustedes.

TIP # 001

ISPF

Si estas editando un programa y queres saver los cambios que hiciste desde la ultima ves que salvaste.

Respuesta:

usar COMPARE SESSION en la linea de commando

- Puede ser usado como la opcion 3.13


TIP # 002

ISPF

Cuando se modifica o se crea un PDS se registra el id del usuario que realizo la ultima modificacion.

Pero es posible cambiar este id?

Respuesta:

Si es posible!! Eligiendo el elemento con la letra G, se desplegara un pop up para cambiar el id que lo edito.


TIP # 003

ISPF

Suponte que estas en una ventana de ISPF y quieres saber en que region TSO te encuentras.

Respuesta:

Tipea en la linea de commandos: SAREA

Se abrira ISPF STATISTICS Pop-up mostrandote la region y mas informacion.


TIP # 004

ISPF

Todos los comandos entrados en la linea de comandos luego de ejectarse se borran.

Pero si quieres repetir el comando varias veces puedes usar el simbolo &. Los comandos precedidos pro este simbolo permaneceran en la linea de comandos para que puedan volverse a usar.

Ejemplo:

COMMAND ===> &C '110-PARA' '220-PARA' SCROLL ===> CSR

****** ************************ TOP OF DATA **************

000001 IDENTIFICATION DIVISION.

000002 PROGRAM-ID. COBOLSAMY.

000003 DATE-WRITTEN. APRIL 2004.


TIP # 005

ISPF

Cuando se intenta abrrir algun elemento aveces sucede que nos informa "member in use" si queremos saber que usuario lo esta usando solo tenemos que presionar dos veces la tecla F1.


Proximamente pondre mas un saludo