Taking a particular word from particular row using SORT



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

Taking a particular word from particular row using SORT

Postby sange-sherin » Wed Nov 27, 2013 4:11 pm

Hello,

Below is the requirement

I need to take the count from trailer record (position 2 to 11) of my input file and have to write into FB output file

Input file: VB and record length=200

example:
H
D00000010001000GLBEB05*********
T00000000010000000001

I need a out put file as FB (80)

0000000001 (from the trailer record - position 2 to 11)

Can you please provide me the sort syntax for this?
sange-sherin
 
Posts: 25
Joined: Thu Nov 21, 2013 6:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Taking a particular word from particular row using SORT

Postby BillyBoyo » Wed Nov 27, 2013 4:25 pm

Break your task down into pieces:

First you want to include all the records that you do want (the trailer). You do this with INCLUDE.

Then you want to create the data in your required format. You do this with BUILD.

BUILD can't live on its own, so has to be on INREC, OUTREC, OUTFIL or IFTHEN.

  OPTION COPY
  INCLUDE COND=(1,1,CH,EQ,C'T')
  INREC BUILD=(2,10)


There is a very good DFSORT Getting Started manual. You should locate it, and work through it bit by bit. There are also many examples of Control Cards here and elsewhere. It is very simple to set up some experiments with DD * for your SORTIN and SYSIN.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Taking a particular word from particular row using SORT

Postby sange-sherin » Wed Nov 27, 2013 5:41 pm

Hi BillyBoyo,

I am getting error while using this. My input file is VB.

SYSOUT details:
SYNCSORT FOR Z/OS 1.4.1.0R U.S. PATENTS: 4210961, 5117495 (C) 2
Prudential Financial z/OS
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1D3F7, MODEL 2827 506
SYSIN :
OPTION COPY
INCLUDE COND=(1,1,CH,EQ,C'T')
INREC BUILD=(2,10)
WER276B SYSDIAG= 207369, 3306220, 3306220, 5168775
WER415I DSM FACILITY ACTIVE: STORAGE ADJUSTED BY 0 BYTES
WER164B 9,052K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,180K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VB ; LRECL= 204; BLKSIZE= 32720
WER073I SORTIN : DSNAME=BEJGB2.X186625.CONTROL.D131125.TEST2
WER235A INREC RDW NOT INCLUDED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
sange-sherin
 
Posts: 25
Joined: Thu Nov 21, 2013 6:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Taking a particular word from particular row using SORT

Postby BillyBoyo » Wed Nov 27, 2013 6:08 pm

You have SyncSort, not DFSORT, so topic moved to correct part of the forum.

Sorry, I missed that your input was VB.

SORTOUT takes its its characteristics from SORTIN, with amendments from Control Cards.

To create an FB from a VB you need to use OUTFIL to convert it. Since a BUILD is needed for that, we shift the whole thing to OUTFIL:

  OPTION COPY
  INCLUDE COND=(5,1,CH,EQ,C'T')
  OUTFIL BUILD=(6,10),VTOF


Because a variable-length record has a four-byte RDW pre-pended, the start positions must change by adding four. The VTOF is to convert Variable TO Fixed length.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Taking a particular word from particular row using SORT

Postby sange-sherin » Thu Nov 28, 2013 12:12 pm

Hi BillyBoyo,

I am facing the following error:

SYSIN :
  OPTION COPY                                                     
    INCLUDE COND=(5,1,CH,EQ,C'T')                                 
    OUTFIL BUILD=(6,10),VTOF                                       
WER276B  SYSDIAG= 1970652, 4205828, 4205828, 4971150               
WER415I  DSM FACILITY ACTIVE:  STORAGE ADJUSTED BY 0 BYTES         
WER164B  9,052K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 1,180K BYTES USED           
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                   
WER108I  SORTIN   : RECFM=VB   ; LRECL=   204; BLKSIZE= 32720     
WER073I  SORTIN   : DSNAME=BEJGB2.X186625.CONTROL.D131125.TEST2   
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE= 32720     
WER074I  SORTOUT  : DSNAME=BEJGB2.X186625.SORTTRA.D131128.TEST2   
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Please find my JCL :

//SORT1 EXEC PGM=SORT                                           
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=INPUT FILE (VB),DISP=SHR 
//SORTOUT  DD DSN=OUTPUT FILE (FB,80),DISP=OLD
//SYSIN   DD *                                                 
  OPTION COPY                                                   
    INCLUDE COND=(5,1,CH,EQ,C'T')                               
    OUTFIL BUILD=(6,10),VTOF                                   
/*
sange-sherin
 
Posts: 25
Joined: Thu Nov 21, 2013 6:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Taking a particular word from particular row using SORT

Postby NicC » Thu Nov 28, 2013 2:01 pm

sange-sherin

Please use the code tags when posting code/JCL/data and such like that requires a fixed pitch font. If you do not know how then either go into the full editor or search the forum.

What have you tried in order to fix the error? as far as I can see your input file is 204 bytes LRECL (4 rdw + 200 data) and your output file has LRECL= 80.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Taking a particular word from particular row using SORT

Postby sange-sherin » Thu Nov 28, 2013 2:57 pm

Hi NicC,

I am not able to understand the error.............

Can you please provide me a solution?
sange-sherin
 
Posts: 25
Joined: Thu Nov 21, 2013 6:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Taking a particular word from particular row using SORT

Postby NicC » Thu Nov 28, 2013 4:31 pm

What do you not understand? You have a record of 200 bytes and you are trying to write it to a file with an LRECL of 80. 200 into 80 does not go.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Taking a particular word from particular row using SORT

Postby sange-sherin » Thu Nov 28, 2013 5:05 pm

HI NicC,

My output file should be FB 80... thats why i am writing to FB 80.
sange-sherin
 
Posts: 25
Joined: Thu Nov 21, 2013 6:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Taking a particular word from particular row using SORT

Postby NicC » Thu Nov 28, 2013 6:02 pm

So you have to tell sort that you only want to build 80 bytes.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post