IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 1206
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: 1206
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

Active User


Joined: 15 Aug 2015
Posts: 352
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

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

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: 2508
Location: NY,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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 1
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts IGZ0035S THERE WAS AN UNSUCCESSFUL OP... COBOL Programming 3

Back to Top