Print a Infile ddname only to Output using Trailers
Posted:
Mon Aug 31, 2009 11:26 pm
by Fusion
Hi,
i'm trying to create a model for my fellow colleagues where the job will take in the Input DD name, do a record count and it should put the Output in a file with the ddname and its record count. I dont want to Hard code the DDnamessince it will used by many users. i Have the following Sysin * statements -
//STEP001 EXEC HDCOUNT,
// INFILE='XX.XXXXXXX.XXXXXXX'
//*
//STEP01.SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT,NODETAIL,REMOVECC,CONVERT,
TRAILER1=(1/,1:'--------------------------------------------------',
51:'------------------------',
1/,1:'FILE NAME: ',
12:' &INFILE ' , <<== This is where i want the INFILE provided to print the file name
3:'RECORD COUNT:',
17:COUNT=(M12,LENGTH=9),/)
/*
Re: Print a Infile ddname only to Output using Trailers
Posted:
Tue Sep 01, 2009 2:16 am
by MrSpock
Simple. All you need is your program to convert a variable name passed via the PARM= statement into it's actual value:
//MYJOB JOB (......)
//*
// SET INFILE='XX.XXXXXXX.XXXXXXX'
//*
//JS01 EXEC HDCOUNT,INFILE=&INFILE
//PS01.SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT,NODETAIL,REMOVECC,CONVERT,
TRAILER1=(1/,1:'--------------------------------------------------',
51:'------------------------',
1/,1:'FILE NAME: ',
12:FILENAME,
3:'RECORD COUNT:',
17:COUNT=(M12,LENGTH=9),/)
/*
//HDCOUNT PROC INFILE=
//*
//PS00 EXEC PGM=SOMEPGM,PARM='&INFILE'
//TMP DD DSN=&&TMP,DISP=(,PASS,UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),RECFM=FB,LRECL=80
//*
//PS01 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=&INFILE
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&TMP,DISP=(OLD,DELETE)
//*
where the data in SYMNAMES looks like this:
FILENAME,C'XX.XXXXXXX.XXXXXXX'
Re: Print a Infile ddname only to Output using Trailers
Posted:
Tue Sep 01, 2009 3:12 am
by Fusion
ok here's the deal...this is how i set up my proc
//HDCOUNT PROC INFILE='INPUT.FILE.NAME'
//*
//STEP01 EXEC PGM=SORT
//*
//SORTIN DD DSN=&INFILE,
// DISP=SHR
//*
//SORTOUT DD DSN=&INFILE..CPY, => the reason i dont use a temp DSN is coz there will be another step wer this
// DISP=(NEW,CATLG,DELETE), dsn will be XMITIP to a recipient together with a header (some details)
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=18400), the user can enter. The outputs will be concatenated
// UNIT=SYSDA, in a Memo format.
// SPACE=(TRK,(1,1),RLSE),
// LABEL=RETPD=5
//*
//SYSIN DD DUMMY
//*
//SYSPRINT DD SYSOUT=A,DCB=BLKSIZE=133,OUTLIM=200
//SYSOUT DD SYSOUT=A,DCB=BLKSIZE=133,OUTLIM=200
//SYSABEND DD SYSOUT=A,DCB=BLKSIZE=133,OUTLIM=500
The exec deck is as:
//* Job Card.........
//*
// JCLLIB ORDER=XXXXX.JCLLIB.CNTL
//*
//*
//STEP001 EXEC HDCOUNT,
// INFILE='FILENAME.FOR.USER'
//*
//STEP01.SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT,NODETAIL,REMOVECC,CONVERT,
TRAILER1=(1/,1:'--------------------------------------------------',
51:'------------------------',
1/,1:'FILE NAME: ',
12:&INFILE,/,
3:'RECORD COUNT:',
17:COUNT=(M12,LENGTH=9),/)
/*
//*
error i get---
. SYSIN :
. OPTION COPY
. OUTFIL FNAMES=SORTOUT,NODETAIL,REMOVECC,CONVERT,
. TRAILER1=(1/,1:'--------------------------------------------------',
. 51:'------------------------',
. 1/,1:'FILE NAME: ',
. *
. 12:&INFILE,/, this is what i am not sure if there is any keyword for SORT which
. 3:'RECORD COUNT:', can refer to any symbolics we put. In your e.g u had put
. 17:COUNT=(M12,LENGTH=9),/) 12:FILENAME,
. WER268A OUTFIL STATEMENT : SYNTAX ERROR
. WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************** BOTTOM OF DATA ********************************
The output should look like:
TO:
FROM:
SUBJECT:
-----------------
FILE NAME: FILENAME.FOR.USER
RECORD COUNT: XXXXXXXX
Re: Print a Infile ddname only to Output using Trailers
Posted:
Tue Sep 01, 2009 11:14 am
by MrSpock
Does Syncsort support the use of the SYMNAMES DD statement?
Re: Print a Infile ddname only to Output using Trailers
Posted:
Wed Sep 02, 2009 10:29 am
by Fusion
i have no idea what symnames is - havent seen this keyword in any of our jobs at work. Anyway after doing some research, it seems that we cannot use a symbolic in a dd statement with *, unless your job kicks off from a ESP where u can use symbolics for dates with %.