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

Multiple tasks in one DFSORT ?


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

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Wed Nov 15, 2006 1:30 am
Reply with quote

Hello everyone,
This is my challenge, I have VARIABLE length input file and want to remove blanks, and squeeze data to left, change all *'s to zeroes, ignore some data and extract other data to finally create an output file in FIXED length.

How can all this be done in one DFSORT job ? or is iyt more that one.

would someone be able to provide solution ?

Input file looks like this
00375 1035 49ABCD
00378 *151 01ABCDE FGHIJKLM
35680 *880 99ZZZZZZ XXXX

OUTPUT TO LOOK LIKE THIS...
003751035ABCD
003780151ABCDE FGHIJKLM
356800880ZZZZZZ XXXX
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Wed Nov 15, 2006 1:49 am
Reply with quote

I just found out we do not have the SQZ function installed. so how can I get around that problem ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 15, 2006 2:28 am
Reply with quote

If that's the way your data looks, then you don't need SQZ to do what you want to do. You say you have variable length input, but I suspect it's really FB with records having different numbers of blanks at the end rather than VB. At any rate, here's FB and VB versions of the job:

FB version

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=... output file (FB)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,5,7,1,CHANGE=(1,C'*',C'0'),NOMATCH=(7,1),
    8,3,14,14)
/*


VB version

Code:

//S2    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=&&VB,DISP=(OLD,PASS)                             
//SORTOUT DD DSN=&&O1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//SYSIN    DD    *                                               
  OPTION COPY                                                     
  INREC BUILD=(1,9,11,1,CHANGE=(1,C'*',C'0'),NOMATCH=(11,1),     
    12,3,18)
/*                                                     
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Wed Nov 15, 2006 9:56 pm
Reply with quote

Thanks for all your help Frank
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Wed Nov 15, 2006 10:06 pm
Reply with quote

I managed to create the desired result but in the following three separate steps...

1) Convert from VB to FB

//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=FB1,VTOF,OUTREC=(5,80)


2) Reformat data

//SYSIN DD *
OPTION COPY
INREC BUILD=(1,5,6:7,4,12:14,65)


3) Change Asterisk to Zero

OPTION COPY
ALTSEQ CODE=(5CF0)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)


Thanks Frank for making it more efficient ..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 15, 2006 11:29 pm
Reply with quote

Per your offline note, you really are trying to convert from VB to FB as you said originally but I misunderstood. Here's how to do that in one pass with DFSORT. I assume you're using TRAN=ALTSEQ because the * can be anywhere in the record, so I've factored that in.

Code:

  OPTION COPY
  ALTSEQ CODE=(5CF0)
  INREC BUILD=(1,4,5,TRAN=ALTSEQ)
  OUTFIL VTOF,OUTREC=(5,5,6:11,4,12:18,65)
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Thu Nov 16, 2006 10:29 pm
Reply with quote

Good point about
Quote:
I assume you're using TRAN=ALTSEQ because the * can be anywhere in the record, ...
What if I would want to use ALTSEQ in a particular position in the record ?
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 DFSORT GUID DFSORT/ICETOOL 2
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top