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

SORTIN assuming different RECFM for a VSAM file.


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

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Thu Feb 21, 2013 8:06 am
Reply with quote

Hi All

I have been trying to understand why the RECFM of my IAM VSAM file has been assumed F or V in different cases.

To be more clear, I have a VB VSAM file from which I need to extract few records. I say its a VB vsam file because the AVG record length and the MAx record length are different.

My JCL has a step to extract few records from my VSAM file.




Code:


//TESTJCLA JOB 1704,'TEST SORT',MSGCLASS=Q,MSGLEVEL=(1,1),CLASS=7,
//             NOTIFY=&SYSUID                                     
//*                                                                 
//*******************************************************************
//STEP020  EXEC PGM=SORT,COND=(0,NE)                               
//******************************************************************
//***                                                            ***
//******************************************************************
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=PROD.MASTER.MARKET,                         
//            DISP=SHR                                               
//SORTOUT  DD DSN=TEST.MASTER.WORK.MARKETO.OUTFB,             
//            DISP=(NEW,CATLG,DELETE),                             
//            UNIT=3390,                                           
//            SPACE=(CYL,(5,1),RLSE),                               
//            DCB=(RECFM=FB,LRECL=4982,BLKSIZE=0,BUFNO=8)           
//*                                                                 
//SYSIN    DD *
 SORT FIELDS=COPY                                                           
 INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')                               
//*                                                                 
//SORTWK01 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK02 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK03 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK04 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK05 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK06 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//*                                                                 
//*******************************************************************
//STEP030  EXEC PGM=SORT,COND=(0,NE)                               
//******************************************************************
//***                                                            ***
//******************************************************************
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=PROD.MASTER.MARKET,                         
//            DISP=SHR                                             
//SORTOUT  DD DSN=TEST.MASTER.WORK.MARKETO.OUTVB,             
//            DISP=(NEW,CATLG,DELETE),                             
//            UNIT=3390,                                           
//            SPACE=(CYL,(5,1),RLSE),                               
//            DCB=(RECFM=VB,LRECL=4982,BLKSIZE=0,BUFNO=8)           
//*                                                                 
//SYSIN    DD *
 SORT FIELDS=COPY                                                           
 INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')                               
//*                                                                 
//SORTWK01 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK02 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK03 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK04 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK05 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//SORTWK06 DD UNIT=3390,SPACE=(CYL,(20,2),RLSE)                     
//*                                                                 



The SYSOUT from both the step is below.

STEP020 SYSOUT.

Code:


SYSIN :                                                                     
 SORT FIELDS=COPY                                                           
 INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')                               

WER161B  ALTERNATE PARM USED                                                 
WER276B  SYSDIAG= 946049, 2835054, 2835054, 1986975                         
WER164B  8,864K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
WER164B     0 BYTES RESERVE REQUESTED, 1,424K BYTES USED                     
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                             
[color=red]
WER108I  SORTIN   : RECFM=F    ; LRECL=  4978; CISIZE = 22528                 
WER073I  SORTIN   : DSNAME=PROD.MASTER.MARKET                         
WER110I  SORTOUT  : RECFM=FB   ; LRECL=  4982; BLKSIZE= 24910               
WER074I  SORTOUT  : DSNAME=TEST.MASTER.WORK.MARKETO.OUTFB
[/color]             
WER410B  7,836K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,     
WER410B     0 BYTES RESERVE REQUESTED, 1,296K BYTES USED                     
WER055I  INSERT          0, DELETE      27113                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                               
WER416B  VSAM WAS USED FOR SORTIN                                           
WER416B  SORTOUT  : EXCP'S=0,UNIT=3390,DEV=BE74,CHP=(7778797A8788898A,1),VOL=TSTG85
WER054I  RCD IN      27113, OUT          0                                   
WER169I  RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1                               
WER052I  END SYNCSORT - TESTJCLA,STEP020,,DIAG=CA00,51C6,E22C,006E,82D2,6CCB,2228,04E0



STEP030 SYSOUT:

Code:


SYSIN :                                                                     
 SORT FIELDS=COPY                                                           
 INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')                               

WER161B  ALTERNATE PARM USED                                                 
WER276B  SYSDIAG= 940500, 2829505, 2829505, 1986975                         
WER164B  8,864K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
WER164B     0 BYTES RESERVE REQUESTED, 1,404K BYTES USED                     
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                             
[color=red]
WER108I  SORTIN   : RECFM=V    ; LRECL=  4978; CISIZE = 22528               
WER073I  SORTIN   : DSNAME=PROD.MASTER.MARKET                         
WER110I  SORTOUT  : RECFM=VB   ; LRECL=  4982; BLKSIZE= 27998               
WER074I  SORTOUT  : DSNAME=TEST.MASTER.WORK.MARKETO.OUTVB               
[/color]   
WER410B  7,836K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,     
WER410B     0 BYTES RESERVE REQUESTED, 1,280K BYTES USED                     
WER055I  INSERT          0, DELETE      27067                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                               
WER416B  VSAM WAS USED FOR SORTIN                                           
WER416B  SORTOUT  : EXCP'S=1,UNIT=3390,DEV=3838,CHP=(4C4D4E4F5C5D5E5F,1),VOL=TSTG36
WER054I  RCD IN      27113, OUT         46                                   
WER169I  RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1                               
WER052I  END SYNCSORT - TESTJCLA,STEP030,,DIAG=8000,5346,A82A,0064,C8D6,6CEB,2A28,A4E6



My Question is , why does the SORTIN assume the RECFM as F in step020 and RECFM as V in step030.
Has that assumed the RECFM based on the SORTOUT RECFM ?? If so why shud it. Note that only the STEP030 has got some output records.

If the SORTIN were an flat file the step020 would have abended for sure. I have tested that as well and it abended. Should the above JCL also not abend considering this... ?


STEP020

WER108I SORTIN : RECFM=F ; LRECL= 4978; CISIZE = 22528
WER073I SORTIN : DSNAME=PROD.MASTER.MARKET
WER110I SORTOUT : RECFM=FB ; LRECL= 4982; BLKSIZE= 24910
WER074I SORTOUT : DSNAME=TEST.MASTER.WORK.MARKETO.OUTFB


STEO030

WER108I SORTIN : RECFM=V ; LRECL= 4978; CISIZE = 22528
WER073I SORTIN : DSNAME=PROD.MASTER.MARKET
WER110I SORTOUT : RECFM=VB ; LRECL= 4982; BLKSIZE= 27998
WER074I SORTOUT : DSNAME=TEST.MASTER.WORK.MARKETO.OUTVB


Background:
In my prod job it was mistakenly given as FB in the SORTOUT recfm and because of that the Job extracted no records and it failed in the corresponding step as per the logic. When we analysed we found that the RECFM in the output step was the reason and hence the condition is position 5 did not match out exactly. That is when i got this doubt and tested with two different RECFM in the sortout and found the RECFM of the SORTIN is assumed differently in both the cases.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Feb 21, 2013 8:35 am
Reply with quote

From DFSORT manual,
Quote:
If the selected record type is not what you want DFSORT to use, specify RECORD TYPE=F or RECORD TYPE=V as appropriate.

The same point might apply to SYNCSORT as well. Please check SYNCSORT manual.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Feb 21, 2013 2:37 pm
Reply with quote

In case of FB for SORTOUT, try this and see what you get in output:

Code:
//SYSIN    DD *
 SORT FIELDS=COPY                                                           
 INCLUDE COND=(1,8,CH,EQ,C'HASD0002',OR,                                 
               1,8,CH,EQ,C'HASD0002',OR,                               
               1,8,CH,EQ,C'HASD0002',OR,                               
               1,8,CH,EQ,C'HASD0002')

And remove the LRECL=4982 while you SUBmit the Job.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 21, 2013 2:58 pm
Reply with quote

Vinodh S,

What are you trying to do with this?

Code:
INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')


No matter how many times you ask the same question, the answer will always be the same, if nothing has changed, and here there has been no opportunity for change...
Back to top
View user's profile Send private message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Thu Feb 21, 2013 11:45 pm
Reply with quote

Bill Woodger wrote:
Vinodh S,

What are you trying to do with this?

Code:
INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002',OR,                               
               5,8,CH,EQ,C'HASD0002')


No matter how many times you ask the same question, the answer will always be the same, if nothing has changed, and here there has been no opportunity for change...


Hi All

Sorry, with the SORTCARD having the same Include cond. Its different , but when i just pasted here, I changed it. It would be something like this.

Code:
INCLUDE COND=(5,8,CH,EQ,C'HASD0002',OR,                                 
               5,8,CH,EQ,C'GSPD0002',OR,                               
               5,8,CH,EQ,C'LOWE0002',OR,                               
               5,8,CH,EQ,C'KNWE0003')
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Feb 23, 2013 5:00 am
Reply with quote

Possibly the difference is because in your first sort you specified RECFM=FB for SORTOUT and in the second your RECFM=VB
Back to top
View user's profile Send private message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Sat Feb 23, 2013 9:48 am
Reply with quote

Nic Clouston wrote:
Possibly the difference is because in your first sort you specified RECFM=FB for SORTOUT and in the second your RECFM=VB


Nic, thats exactly is what my question is. Why should the Input file attributes change upon what my Output Attribute is ? Should the Input file's attribute not be retained what ever the case be.. ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 23, 2013 2:03 pm
Reply with quote

Please re-read the topic.

Please take off the RECFM from the SORTOUT in both steps and re-run.

Please then specify:

Quote:
specify RECORD TYPE=F or RECORD TYPE=V as appropriate.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 23, 2013 6:15 pm
Reply with quote

Quote:
Why should the Input file attributes change upon what my Output Attribute is ? Should the Input file's attribute not be retained what ever the case be.. ?
Because VSAM files do not use record descriptor words; hence SORT is determining whether to treat the input file as fixed or variable based UPON WHAT YOU TELL SORT about the output file. VSAM files, since you must specify average and maximum record length for every KSDS file, may be treated as always having variable length records so the behavior you are experiencing is not entirely unexpected. You don't tell SORT via control statements whether or not the input file is fixed or variable, so it is reasonable for SORT to use the output file attributes to determine what the input file attributes are.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top