Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL to find/verify the Record format of a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL to find/verify the Record format of a dataset
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed May 21, 2008 11:39 pm    Post subject: Reply to: JCL to find/verify the Record format of a dataset
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu May 22, 2008 11:35 pm    Post subject: Reply to: JCL to find/verify the Record format of a dataset
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts How could i share my personal dataset... James Halley TSO/ISPF 1 Fri Mar 23, 2018 9:41 pm
This topic is locked: you cannot edit posts or make replies. How could i share my personal dataset... samenxia163 TSO/ISPF 1 Fri Mar 09, 2018 12:18 pm
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us