Hi Greg
I believe the data structure should be
dcl-ds *n;
s1con char(1) pos(1) dim(30);
s1cn01 char(9) pos(1);
s1cn02 char(9) pos(10);
s1cn03 char(4) pos(19);
s1cn04 char(4) pos(23);
s1cn05 char(4) pos(27);
end-ds;
your way - S1con was 900 characters - 30 x 30
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Greg Wilburn
Sent: Tuesday, January 7, 2020 2:36 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Convert DS to Free Format
I give up... I've been pulling my hair out trying to convert this to free format:
D DS
D S1CON 1 30
D S1CN01 1 9
D S1CN02 10 18
D S1CN03 19 22
D S1CN04 23 26
D S1CN05 27 30
D*
Using the JCR Tools, it converted to this:
dcl-ds *n;
s1con char(30) pos(1);
s1cn01 char(9) pos(1);
s1cn02 char(9) pos(10);
s1cn03 char(4) pos(19);
s1cn04 char(4) pos(23);
s1cn05 char(4) pos(27);
end-ds;
I had to add DIM(30) to the S1CON so the program logic would work (the old code used MOVEA to move an array into S1CON)
dcl-ds *n;
s1con char(30) pos(1) dim(30);
s1cn01 char(9) pos(1);
s1cn02 char(9) pos(10);
s1cn03 char(4) pos(19);
s1cn04 char(4) pos(23);
s1cn05 char(4) pos(27);
end-ds;
No matter what I do... I get 1 character in S1CN01 and nothing more.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.