IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to find/verify the Record format of a dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Wed May 21, 2008 11:00 pm
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Wed May 21, 2008 11:29 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed May 21, 2008 11:39 pm
Reply with quote

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
View user's profile Send private message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Thu May 22, 2008 10:55 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 22, 2008 11:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top