Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPG400 - Alpha field greater than 256 characters

Status
Not open for further replies.

lambic

Technical User
Nov 28, 2002
68
GB
Hi,

It's been a while since I did any RPG400 coding so please bear with me!

I have a file which contains an alpha field of length 960 characaters. I need to be able to read this field, then split it into 12 sub-fields of 80 characters & output these to another file. I think I need to use a data structure to divide the field up, but I seem to have forgotten exactly what I need to code. I also recall that an alpha field can only be a max of 256 caharacters. Can anybody help please?

Cheers!
 
lambic,

What version of RPG and OS/400 are you on? The 256 restriction has been lifted in recent versions. There is still a limit, but it is huge, like 32K or something.

HTH,
MdnghtPgmr
 
It's an old version - both are version V3R2M0. We lifting data off the server prior to it's decommission (which is a shame, as it's such a reliable piece of kit).
 
You will have to write your program in RPG 4.

Something like this data structure should do the trick:
Code:
     D                 DS           960    Inz                    
     D Bigfld                  1    960                           
     D  Fld01                        80    Overlay(Bigfld)        
     D  Fld02                        80    Overlay(Bigfld : *NEXT)
     D  Fld03                        80    Overlay(Bigfld : *NEXT)
     D  Fld04                        80    Overlay(Bigfld : *NEXT)
     D  Fld05                        80    Overlay(Bigfld : *NEXT)
     D  Fld06                        80    Overlay(Bigfld : *NEXT)
     D  Fld07                        80    Overlay(Bigfld : *NEXT)
     D  Fld08                        80    Overlay(Bigfld : *NEXT)
     D  Fld09                        80    Overlay(Bigfld : *NEXT)
     D  Fld10                        80    Overlay(Bigfld : *NEXT)
     D  Fld11                        80    Overlay(Bigfld : *NEXT)
     D  Fld12                        80    Overlay(Bigfld : *NEXT)

Me transmitte sursum, Caledoni!

 
It's OK - I've figured it out now. Needed to redefine the input field as a data structure, and the sub-divide it into smaller fields for output. Worked fine.

Thankyou for your time assistance though.

Cheers
 
Sorry - Friday afternoon fingers! Should have said:

Thankyou for your time and assistance

Cheers



[blue]Agitare![/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top