View previous topic :: View next topic
|
Author |
Message |
ansnero
New User
Joined: 26 May 2006 Posts: 13
|
|
|
|
Hi,
I have an input dataset. Does any body know how I can write a JCL where
I can verify whether the RECFM of input dataset is VB or FB?
Thanks
Nero |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
If the tape has standard labels you can dump the header records. Consult the DFSMS Using Tapes manual for the fields indicating RECFM.
Code: |
//DUMPHDR EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=FILE.NAME,VOL=SER=111111,
// LABEL=(1,BLP),UNIT=TAPE,DISP=OLD,
// RECFM=FB,LRECL=80,BLKSIZE=8000
//SYSUT2 DD SYSOUT=*,
// RECFM=FB,LRECL=80,BLKSIZE=8000
//SYSIN DD DUMMY |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Use TSO LISTDS in batch:
Code: |
//STEPX EXEC PGM=IKJEFT01,
// PARM='LISTDS ''MY.DATASET'''
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
|
or a SORT:
Code: |
//STEPX EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=MY.DATASET
//SORTOUT DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=ALL
/*
|
or a REXX exec:
Code: |
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *,DLM=@@
/* REXX */
RC = LISTDSI(IN 'FILE')
SAY SYSRECFM
EXIT 0
@@
//SYSUT2 DD DSN=&&PDS(X),DISP=(,PASS),UNIT=VIO,
// SPACE=(TRK,(1,1,1))
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//STEP2 EXEC PGM=IKJEFT01,PARM='%X'
//SYSPROC DD DSN=&&PDS,DISP=(OLD,DELETE)
//IN DD DISP=SHR,DSN=MY.DATASET
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
|
|
|
Back to top |
|
|
ansnero
New User
Joined: 26 May 2006 Posts: 13
|
|
|
|
Hi, Thanks a lot for the solution. What if I need to the output to be used in the next step of the JCL. Some thing like if the input file is VB then execute some proc.. ? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
That's up to you. The assumption from your original post is that you would capture the results into a dataset, and then in a subsequent step read that dataset and take the appropriate course of action.
If you were to check the RECFM from within a program, then you could interrogate the results and set a return-code value. Then, subsequent steps could execute (or be sypassed) based on the return-code value. |
|
Back to top |
|
|
|