Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Squeeze variable length data using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Jan 11, 2013 3:32 pm    Post subject: Squeeze variable length data using DFSORT
Reply with quote

Hi Bill/Skolusu,

My input and output files are of FB, and LRELC=80. My input record contains certain report names. I need to attach a string to that report name and create an output file.

i/p data: data starts in position 3

Code:

Report started
  BATCHSMF
  BDR
  BIND
  CLRLINK
  COBALL
Report ended


Expected O/P data:

Code:

PUT XXXX(BATCHSMF) BATCHSMF.TXT
PUT XXXX(BDR) BDR.TXT
PUT XXXX(BIND) BIND.TXT
PUT XXXX(CLRLINK) CLRLINK.TXT
PUT XXXX(COBALL) COBALL.TXT


I used the below code, but it is not properly working. Can someone please help?

Code:

INREC IFTHEN=(WHEN=(3,8,SS,EQ,C' '),                           
       BUILD=(C'PUT ',C'''XXXX(',3,8,SQZ=(SHIFT=LEFT,
              TRAIL=C')'''),C' ',3,8,SQZ=(SHIFT=LEFT,           
              TRAIL=C'.TXT'),80:X)),       
          IFTHEN=(WHEN=NONE,                                   
       BUILD=(C'PUT ',C'''XXXX(',3,8,C')''',C' ',
        3,8,C'.TXT',80:X))


This is working when the string is of full 8 bytes, like incase of the name BATCHSMF. But others are not coming out properly.

Thanks for the help.

Regards
Amar
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Jan 11, 2013 7:05 pm    Post subject:
Reply with quote

Code:
Code:

INREC IFTHEN=(WHEN=(3,8,SS,EQ,C' '),                           
       BUILD=(C'PUT ',C'''XXXX(',3,8,SQZ=(SHIFT=LEFT,
              TRAIL=C')'''),C' ',3,8,SQZ=(SHIFT=LEFT,           
              TRAIL=C'.TXT'),80:X)),       
          IFTHEN=(WHEN=NONE,                                   
       BUILD=(C'PUT ',C'''XXXX(',3,8,C')''',C' ',
        3,8,C'.TXT',80:X))


Why are you checking from byte 3 for length 8 for 8 blanks? Do you not want to check byte 3 for length 2 equal to blanks?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jan 11, 2013 7:16 pm    Post subject: Reply to: Squeeze variable length data using DFSORT
Reply with quote

Unless you want to pay me, don't ask for me. You are asking for everybody and anybody. See? Garry's stepped in, so don't go waiting, let us know.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Jan 11, 2013 10:15 pm    Post subject:
Reply with quote

Hi Garry,

The name can be maximum of 8 bytes. So, I followed that approach to check for even a single byte with in 8 bytes starting from position 3. I think there is a mistake in the card or there can be a better approach.

Hi Bill,

I just thought to get solution from anyone. Normally you or Skolusu respond to DFSORT queries. So, I just referred the names there. Please ignore them.

Regards
Amar
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 11, 2013 11:07 pm    Post subject:
Reply with quote

Hello,

It is better to ask questions of the forum and then thank individuals when appropriate (rather than naming specific people with the question) icon_wink.gif

Is this now working? If not, post the current control statements and the actual output along with any dignostic info generated.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jan 12, 2013 3:08 am    Post subject: Reply to: Squeeze variable length data using DFSORT
Reply with quote

V S Amarendra Reddy,

Please do NOT address your questions to individuals. Use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
REPORT STARTED                                             
  BATCHSMF                                                 
  BDR                                                       
  BIND                                                     
  CLRLINK                                                   
  COBALL                                                   
REPORT ENDED                                               
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
  INCLUDE COND=(1,1,CH,EQ,C' ')                             
                                                           
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,                     
  BUILD=(C'PUT XXXX(',3,8,C')',                             
         81:3,8,SQZ=(SHIFT=LEFT,TRAIL=C'.TXT',LENGTH=12))),
  IFTHEN=(WHEN=INIT,                                       
  OVERLAY=(9:9,72,SQZ=(SHIFT=LEFT),                         
           9:9,84,SQZ=(SHIFT=LEFT,MID=C' ')))               
//*
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Sun Jan 13, 2013 7:13 pm    Post subject:
Reply with quote

Hi Skolusu,

Thanks a lot for your response. I wouldn't address to anybody in future.

Thank you once again.

Regards
Amar
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Tue Jan 15, 2013 4:00 pm    Post subject: Reply to: Squeeze variable length data using DFSORT
Reply with quote

Hi Skolusu,

I have tested the code and it is working fine. Thank you for that. But I am not able to understand the logic you have applied here even though I know the functionality of each DFSORT parameters used here.

Could you please explain the logic behind the code?

Regards
Amar
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jan 15, 2013 5:33 pm    Post subject:
Reply with quote

What you could do is comment the code and execute it again again and again by uncommenting them

By doing that, You could understand what happens in the code yourself and also there are manuals to assist on the syntax explanation
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jan 15, 2013 8:08 pm    Post subject:
Reply with quote

Hello,

Suggest you make a copy of the working JCL and sort control statements.

Then make a small change and watch what happens. Repeat until how the code works is clear.

The documentation does a good job explaining . . . icon_confused.gif
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Tue Jan 15, 2013 9:08 pm    Post subject:
Reply with quote

Hi,

I think I got it. icon_smile.gif

Regards
Amar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 30 Fri Dec 09, 2016 10:25 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us