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

Need help in parsing record in VBA file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Oct 11, 2019 2:31 pm
Reply with quote

Hello All,

My Input is VBA file with record length 85 .

Input1:
Code:


total record length 75
abcf
asjkkkk
sdjjjjk
    / CLMPER LAST CHANGED BY EG
total record length 76
abcf
asjkkkk
sdjjjjk
   / CLTPER LAST CHANGED BY FGERG



I am looking for below output
Code:
CLMPER
CLTPER


So basically I am looking for all the ID prefix by / and suffix by C' LAST CHANGED BY '

I tried sort as below
Code:


//JS030    EXEC PGM=ICEMAN,                               
//             REGION=0M                                   
//SYSOUT    DD SYSOUT=*                                   
//SYSPRINT  DD SYSOUT=*                                   
//SYMNAMES  DD *                                           
FLD2,%00                                                   
EQUAL,'/ '                                                 
VARB,' LAST CHANGED BY '                                   
//SORTIN    DD DSN=inputfile,DISP=SHR
//SORTOUT   DD DSN=Outputfile,
//             DISP=(NEW,CATLG,DLET),
//             UNIT=(SYSDA,9),
//             SPACE=(TRK(1,1),RLSE)
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)       


//SYSIN     DD *                                           
  SORT FIELDS=COPY                                         
  INCLUDE COND=(5,81,SS,EQ,C' LAST CHANGED BY ')           
  INREC PARSE=(%=(STARTAT=EQUAL),                         
               %00=(ENDBEFR=VARB,FIXLEN=8)),               
               BUILD=(%00,80:X)                           
/*                                                       


Its failing with Invalid data attribute sortout recfm and blksize.

Please advise
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Oct 11, 2019 3:10 pm
Reply with quote

Able to achieve above using

Code:
SORT FIELDS=COPY                                       
OPTION VLSCMP                                     <====  added   
INCLUDE COND=(5,81,SS,EQ,C' LAST CHANGED BY ')         
OUTFIL VTOF,PARSE=(%=(STARTAT=EQUAL),                  <==== added
             %00=(ENDBEFR=VARB,FIXLEN=8)),             
             BUILD=(%00,80:X)                         


Thanks
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Fri Oct 11, 2019 10:06 pm
Reply with quote

It was basically failing because you had mixed SORTIN VBA and SORTOUT FB w/o specifying VTOF. icon_rolleyes.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Tue Oct 15, 2019 5:36 pm
Reply with quote

Joerg.Findeisen wrote:
It was basically failing because you had mixed SORTIN VBA and SORTOUT FB w/o specifying VTOF. icon_rolleyes.gif

The parameter
Code:
 … COND=(5,81,SS,EQ,C' LAST CHANGED BY ')
would fail on any varying length record shorter that 81 bytes, unless either option VLSCMP, or PARM="VLTESTI=2' was used.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Tue Oct 15, 2019 8:19 pm
Reply with quote

And refer to Ask Professor Sort for more such tricks.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top