Print a Infile ddname only to Output using Trailers



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Print a Infile ddname only to Output using Trailers

Postby Fusion » Mon Aug 31, 2009 11:26 pm

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),/)                           
/*                                                                   
Fusion
 
Posts: 4
Joined: Mon Aug 31, 2009 11:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Print a Infile ddname only to Output using Trailers

 

Re: Print a Infile ddname only to Output using Trailers

Postby MrSpock » Tue Sep 01, 2009 2:16 am

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'
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Print a Infile ddname only to Output using Trailers

Postby Fusion » Tue Sep 01, 2009 3:12 am

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
Fusion
 
Posts: 4
Joined: Mon Aug 31, 2009 11:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Print a Infile ddname only to Output using Trailers

Postby MrSpock » Tue Sep 01, 2009 11:14 am

Does Syncsort support the use of the SYMNAMES DD statement?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Print a Infile ddname only to Output using Trailers

Postby Fusion » Wed Sep 02, 2009 10:29 am

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 %.
Fusion
 
Posts: 4
Joined: Mon Aug 31, 2009 11:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Print a Infile ddname only to Output using Trailers

Postby dick scherrer » Thu Sep 03, 2009 1:05 am

Hello,

Does Syncsort support the use of the SYMNAMES DD statement?
Yes, it does. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post