Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a utitlity to concatenate all dataset having common node 1

Status
Not open for further replies.

deveshjogal

Programmer
Dec 30, 2002
61
0
0
Hi all

I receive about 400 files via FTP or XCOM or similar services which have first 4 node common.

I dont want to hardcode all datasetname in JCL because its not necessary that everytime I will have the same no. of datasets. Again using a GDG is difficult as no. of files well exceeds 400 at current; and it will require a lot of coordination to ask all customer to change their file transfer script.

Instead I need a utility to which if I provide first 4 nodes it should able to generate a JCL code which will concatenate all datasets begining with those 4 nodes into a single dataset. This is what similar to ISPF 3.4 option.
I am not sure this is possible in JCL or not but shud be possible thru Rexx/Clist. Sadly I never tried any of this languages.

I hope I am clear with my requirement; My Platform is OS/390.


Devesh
 
Hi Devesh,

How big are your files ?

Could you give me one sample of the name you use ?

Regards,
 
Hi

The file can have any no. of records. The filename has following pattern

DDPCN.LTCARE.DAILY.INPUT.V0001
DDPCN.LTCARE.DAILY.INPUT.V0002
DDPCN.LTCARE.DAILY.INPUT.V0003
. . .
. . .
. . .
DDPCN.LTCARE.DAILY.INPUT.V0400
DDPCN.LTCARE.DAILY.INPUT.V0401
. . .
. . .
so on...


But it is not necessary that everyday I will receive all datasets. Some people dont send datasets everyday.
so some files may be missing on a particular day. My proposed JCL shud concatenate all the Datasets avaialble at that point of time and then delete them.


Devesh

 
Try this (obviously you need to modify the jobcard);

/* Rexx */
InLevel = 'DDPCN.LTCARE.DAILY.INPUT'
queue "//JOBNAME JOB ACCNT,'MERGE',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID"
queue "//*"
queue "//STEP1 EXEC PGM=IEBGENER"
queue "//SYSUT2 DD DSN=MY.MERGED.DATA.SET,DISP=SHR"
queue "//SYSPRINT DD SYSOUT=*"
queue "//SYSIN DD DUMMY"
Address 'ISPEXEC'
"Control Errors Return"
Start = 1
"LMDINIT LISTID(LISTID) LEVEL("InLevel")"
do until rc > 0
"LMDLIST LISTID("LISTID") DATASET(DSNAME) OPTION(LIST)"
if rc = 0 then do
if Start then do
Start = 0
queue "//SYSUT1 DD DSN="DsName",DISP=SHR"
end
else queue "// DD DSN="DsName",DISP=SHR"
end
end
"LMFREE LISTID("LISTID")"
"Control Errors Cancel"
queue "//*"
queue "$$"
Address 'TSO'
"SUB * END($$)"
return 0
 
Hi deveshjogal,

one idea how to do this is:

Use one step in a batch job (REXX in batch) to create JCL using file tailoring.
First, find all datasets. This could be done with a utility by Neil Hancock, CSILCAT.REXX at
Then, create a table (TBCREATE), fill the table with the names you get back from the CSILCAT function.

Use a skeleton file and do file tailoring (FTOPEN, FTINCL, FTCLOSE), to create JCL letting the names of your files replace the variable name in the skeleton file. The skeleton file would include a ICEGENER step with SYSUT1 (input files) with a variable name part as a concatenation of datasets. SYSUT2 could be a fixed name dataset, a GDG, or having a variable name. I am not shure what the max number of datasets in a concatention is, never tried to use 400 datasets in one. Possibly you have to split this step into two steps using the first 255 as input to the first step and the rest as input to the second step.

Write the created JCL to a permanent file

In a next step in the job you submit the JCL




Instead I need a utility to which if I provide first 4 nodes it should able to generate a JCL code which will concatenate all datasets begining with those 4 nodes into a single dataset. This is what similar to ISPF 3.4 option.
I am not sure this is possible in JCL or not but shud be possible thru Rexx/Clist. Sadly I never tried any of this languages.

I hope I am clear with my requirement; My Platform is OS/390.
 
Hi deveshjogal,

Sorry for my late reply,

You can try this code :

/* REXX */

/* TRACE I */

MESSAGE_SETTING = MSG("OFF")

ADDRESS ISPEXEC "CONTROL ERRORS RETURN "

/***************/
/* ALLOCATIONS */
/***************/


/* YOUR JCL LIBRARY */
"ALLOC FI(ISPFILE) DA('XXX.XXXXXX.JCLLIB') SHR"

/* YOUR TABLE LIBRARY */
ADDRESS ISPEXEC "LIBDEF ISPTABL DATASET ID('XXXX.XXXX.TABLIB')"

/* YOUR SKLON LIBRARY */
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('XXXX.XXXX.SKLLIB')"

/******************/
/* CREATE TABLE */
/******************/

ADDRESS ISPEXEC 'TBERASE' TABXX

ADDRESS ISPEXEC 'TBCREATE TABXX KEYS(NAME) REPLACE'

/******************/
/* START */
/******************/

FICH = DDPCN.LTCARE.DAILY.INPUT.

/* OPEN A OUTPUT TRAP FO A TSO COMMAND */

X = OUTTRAP("TEMP.")

"LISTCAT ENT('"FICH"*') NAME"

TEST = 1

DO R = 1 TO TEMP.0

IF INDEX(TEMP.R,'NONVSAM') ^= 0 THEN
DO
NAME = SUBSTR(TEMP.R,39,4)
DSNAME = STRIP(NAME.R,B)

IF TEST = 1 THEN NAME1 = DSNAME
ELSE ADDRESS ISPEXEC "TBADD " TABXX

TEST = 0
END

END

MEMBER = CONCAT

ADDRESS ISPEXEC FTOPEN
ADDRESS ISPEXEC "FTINCL CONCAT"
ADDRESS ISPEXEC "FTCLOSE NAME("MEMBER")"

ADDRESS ISPEXEC "TBCLOSE" TABXX
"FREE F (ISPFILE)"
ADDRESS ISPEXEC "LIBDEF ISPTABL"
ADDRESS ISPEXEC "LIBDEF ISPSLIB"

EXIT


You should first put this skl in your skl library :


//XXXXXXXX JOB XXXXXXX,CLASS=C,MSGCLASS=X,MSGLEVEL=(1,1)
//*
//DEL EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE XXXX.XXXX.XXXX,PRG
//*
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=&NAME1
)DOT TABXX
// DD DISP=SHR,DSN=&DSNAME
)ENDDOT
//*
//SYSUT2 DD DSN=XXXX.XXXX.XXXX,DISP=(,CATLG),UNIT=3390,
// VOL=SER=YYYYYY,SPACE=(CYL,(500,500),RLSE)
//SYSIN DD DUMMY
//*


Regards,

Tzu





 
Thanks all

I will be implementing these solution.

devesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top