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
 

 

Insert data at end of variable-length record

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 21, 2013 2:46 pm    Post subject: Insert data at end of variable-length record
Reply with quote

Hi,
I have a VB file of record length 100. I want to add 4 bytes of '0000' at the end of each record. For Example:
Input Record
Record 1: 80 bytes
Record 2: 50 bytes

Output record should be of 104 record length and of VB
The record 1: 80bytes+4 bytes '0000'
Record 2: 50 bytes+4 bytes '0000'
Can it be doable in SORT?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Tue May 21, 2013 3:13 pm    Post subject: Reply to: Insert spaces in VB File
Reply with quote

Well, if you can wait, first until September, then until your site moves up to z/OS 2.1, then it will be easy :-)

Quote:
In z/OS V2.1 DFSORT, several usability enhancements are planned. DFSORT will be designed to support new alphanumeric tests for both compare fields and parse fields, including combinations of alphanumeric character sets (uppercase and lowercase, and numeric). This support is intended to allow you to specify various sets of characters using a single compare condition or PARSE keyword rather than using compare conditions or PARSE keywords. Also, enhancements are planned for symbol processing, allowing symbols to be used for more DFSORT operands, and the number of parse fields supported is planned to be increased from the prior limit of 100 fields to 1,000 fields. Finally, new support is planned to allow you to specify that a string up to 50 characters in length be appended to variable-length output records.


Until that time, can you describe your records a bit more?

Do they have a "fixed" part and then a "variable" part? Or are they entirely variable? Do they contain just "character" data, or do you have any non-character fields (binary, packed-decimal)?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 21, 2013 3:28 pm    Post subject: Reply to: Insert spaces in VB File
Reply with quote

Quote:
Do they have a "fixed" part and then a "variable" part? Or are they entirely variable? Do they contain just "character" data, or do you have any non-character fields (binary, packed-decimal)?


Yes, there will be fixed part. The first 10 bytes is fixed and rest 90 bytes variable block.
They do contains only character fileds.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Tue May 21, 2013 4:25 pm    Post subject:
Reply with quote

Code:
  OPTION COPY
  INREC   IFTHEN=(WHEN=INIT,
                   FINDREP=(IN=C' ',OUT=X'FF',STARTPOS=15)),
          IFTHEN=(WHEN=INIT,
                   OVERLAY=(101:X)),
          IFTHEN=(WHEN=INIT,
                   FINDREP=(IN=C' ',OUT=C'0000',STARTPOS=15,DO=1)),
          IFTHEN=(WHEN=INIT,
                   FINDREP=(IN=X'FF',OUT=C' ',STARTPOS=15))
  OUTFIL VLTRIM=C' '


Change all the (significant, in that we want them on the output) spaces in a record to X'FF.

Overlay immediately after the last byte of the existing maximum, one blank. If there are records shorter than the maximum, the intervening bytes will be padded with EBCDIC space.

Now, change, once only, a space to C'0000'. The first four bytes after the existing data are now "0000", but there are trailing blanks (potentially) as well.

Change the X'FF's back to significant spaces.

Use OUTFIL with VLTRIM=C' ' to drop off the unnecessary trailing blanks which were generated by padding and/or the OVERLAY.

When you have DFSORT 2.1, change the Control Cards to the nice new ones :-)
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed May 22, 2013 11:08 am    Post subject: Reply to: Insert spaces in VB File
Reply with quote

Wow! It works like a charm...Thanks Bill
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
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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